Add enabling startup jails.

This commit is contained in:
Tom Alexander 2022-10-28 21:24:06 -04:00
parent 33d2118c15
commit 46f182803e
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -40,3 +40,23 @@
loop:
- src: new_jail.bash
dest: /usr/local/bin/new_jail
- name: Enable Jails
community.general.sysrc:
name: jail_enable
value: "YES"
path: /etc/rc.conf.d/jail
when: jail_list|community.general.json_query('[?enabled==`true`]')|length > 0
- name: Set enabled jail list
community.general.sysrc:
name: jail_list
value: "{{ jail_list|community.general.json_query('[?enabled==`true`].name')|join(' ') }}"
path: /etc/rc.conf.d/jail
when: jail_list|community.general.json_query('[?enabled==`true`]')|length > 0
- name: Disable Jails
file:
path: /etc/rc.conf.d/jail
state: absent
when: jail_list|community.general.json_query('[?enabled==`true`]')|length == 0