diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2025-12-18 16:50:37 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2025-12-18 16:50:37 +0200 |
| commit | 0fcfd8f3636695e9973504792e9102e01571a6a7 (patch) | |
| tree | aa47975e2f7aef2a2e438e5b9988af5d800fa9e6 /tasks/jails.yml | |
| parent | d2d64fed66dfd6b4682bea118323315879bc30a5 (diff) | |
Improvements
Diffstat (limited to 'tasks/jails.yml')
| -rw-r--r-- | tasks/jails.yml | 49 |
1 files changed, 8 insertions, 41 deletions
diff --git a/tasks/jails.yml b/tasks/jails.yml index fe94126..58d22d8 100644 --- a/tasks/jails.yml +++ b/tasks/jails.yml @@ -11,52 +11,19 @@ - { name: "zroot/jails", mountpoint: "/usr/local/jails" } - { name: "zroot/jails/media" } - { name: "zroot/jails/templates" } - - { name: "zroot/jails/templates/{{ jail_userland_version }}" } + - { + name: "zroot/jails/templates/{{ jail_userland_14_3 }}", + userland: "{{ jail_userland_14_3 }}", + } + - { + name: "zroot/jails/templates/{{ jail_userland_15_0 }}", + userland: "{{ jail_userland_15_0 }}", + } - { name: "zroot/jails/containers" } loop_control: loop_var: dataset include_tasks: jails_dataset.yml -- name: Check if userland snapshot already exists - shell: zfs list -t snapshot -o name | grep -Fxq "zroot/jails/templates/{{ jail_userland_version }}@base" - failed_when: false - changed_when: false - register: zfs_userland_check - -- name: Set up userland - when: zfs_userland_check.rc != 0 - block: - - name: Download userland - get_url: - url: https://download.freebsd.org/ftp/releases/amd64/amd64/{{ jail_userland_version }}/base.txz - dest: /usr/local/jails/media/{{ jail_userland_version }}-base.txz - owner: root - group: wheel - mode: "0644" - - - name: Unarchive userland - shell: tar -xzf /usr/local/jails/media/{{ jail_userland_version }}-base.txz -C /usr/local/jails/templates/{{ jail_userland_version }} - - - name: Copy localtime to jail userland - copy: - remote_src: true - src: /etc/localtime - dest: /usr/local/jails/templates/{{ jail_userland_version }}/etc/localtime - - - name: Copy resolv.conf to jail userland - shell: | - cat /etc/resolv.conf > /usr/local/jails/templates/{{ jail_userland_version }}/etc/resolv.conf - chmod 644 /usr/local/jails/templates/{{ jail_userland_version }}/etc/resolv.conf - - - name: Update userland to latest patch level - shell: freebsd-update -b /usr/local/jails/templates/{{ jail_userland_version }}/ fetch install - - - name: Disable syslogd in the template - shell: echo 'syslogd_enable="NO"' >> /usr/local/jails/templates/{{ jail_userland_version }}/etc/rc.conf - - - name: Create userland ZFS snapshot - shell: zfs snapshot zroot/jails/templates/{{ jail_userland_version }}@base - - name: Configure jails block: - name: Configure jail.conf |
