aboutsummaryrefslogtreecommitdiffstats
path: root/tasks/jails_dataset.yml
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2026-05-13 00:13:57 +0300
committerJan Tuomi <jan@jantuomi.fi>2026-05-16 18:42:27 +0300
commitb5860daf11ac353049cb1654b9414a129e5cfb96 (patch)
tree87ed89711e4f0e85ace0a97fa123199152c67302 /tasks/jails_dataset.yml
parent4715a28fdcd87440400d17154bfa361d99db29cc (diff)
Rework
Diffstat (limited to 'tasks/jails_dataset.yml')
-rw-r--r--tasks/jails_dataset.yml61
1 files changed, 0 insertions, 61 deletions
diff --git a/tasks/jails_dataset.yml b/tasks/jails_dataset.yml
deleted file mode 100644
index 9e2748c..0000000
--- a/tasks/jails_dataset.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-- name: "Check if dataset {{ dataset.name }} exists"
- shell: zfs list -o name | grep -Fxq "{{ dataset.name }}"
- changed_when: false
- failed_when: false
- register: check_dataset_exists
-
-- name: "Create ZFS dataset {{ dataset.name }}"
- shell: |
- {% if dataset.mountpoint is defined %}
- zfs create -o "mountpoint={{ dataset.mountpoint }}" -p "{{ dataset.name }}"
- {% else %}
- zfs create -p "{{ dataset.name }}"
- {% endif %}
- when: check_dataset_exists.rc != 0
-
-- name: Check if userland snapshot already exists
- shell: zfs list -t snapshot -o name | grep -Fxq "{{ dataset.name }}@base"
- failed_when: false
- changed_when: false
- register: zfs_userland_check
- when: dataset.userland is defined
-
-- name: Set up userland
- when: dataset.userland is defined and zfs_userland_check.rc != 0
- block:
- - name: Download userland
- get_url:
- url: https://download.freebsd.org/ftp/releases/{{ arch }}/{{ dataset.userland }}/base.txz
- dest: /usr/local/jails/media/{{ dataset.userland }}-base.txz
- owner: root
- group: wheel
- mode: "0644"
-
- - name: Unarchive userland
- shell: tar -xzf /usr/local/jails/media/{{ dataset.userland }}-base.txz -C /usr/local/jails/templates/{{ dataset.userland }}
-
- - name: Copy localtime to jail userland
- copy:
- remote_src: true
- src: /etc/localtime
- dest: /usr/local/jails/templates/{{ dataset.userland }}/etc/localtime
-
- - name: Copy resolv.conf to jail userland
- template:
- src: etc_resolv.conf.j2
- dest: /usr/local/jails/templates/{{ dataset.userland }}/etc/resolv.conf
- owner: root
- group: wheel
- mode: "0644"
-
- - name: Disable resolvconf in the template
- shell: echo 'resolvconf=NO' >> /usr/local/jails/templates/{{ dataset.userland }}/etc/resolvconf.conf
-
- - name: Update userland to latest patch level
- shell: freebsd-update -b /usr/local/jails/templates/{{ dataset.userland }}/ fetch install
-
- - name: Disable syslogd in the template
- shell: echo 'syslogd_enable="NO"' >> /usr/local/jails/templates/{{ dataset.userland }}/etc/rc.conf
-
- - name: Create userland ZFS snapshot
- shell: zfs snapshot zroot/jails/templates/{{ dataset.userland }}@base