From cc1b02f99e457d2a5a440698e9bae1ca30f408e1 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 25 Jul 2025 00:09:01 +0300 Subject: Initial impl of vnet jails --- tasks/jails.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'tasks/jails.yml') diff --git a/tasks/jails.yml b/tasks/jails.yml index 8233dc5..7cbe707 100644 --- a/tasks/jails.yml +++ b/tasks/jails.yml @@ -37,18 +37,23 @@ - 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 and resolv.conf to jail userland + - name: Copy localtime to jail userland copy: remote_src: true - src: "{{ item }}" - dest: "/usr/local/jails/templates/{{ jail_userland_version }}{{ item }}" - loop: - - /etc/resolv.conf - - /etc/localtime + 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 @@ -67,3 +72,6 @@ loop_control: loop_var: jail include_tasks: jail_single.yml + +- name: Configure ingress jail + include_tasks: jail_ingress.yml -- cgit v1.3