- name: Jails hosts: all vars_files: - doctor.vars.yml roles: - criecm.iocage tasks: - name: fdescfs fstab lineinfile: line: 'fdesc /dev/fd fdescfs rw 0 0' state: present path: /etc/fstab - name: Create bind9 jail iocage: name: bind9 state: present properties: "{{ jails.bind9 }}" register: jails_bind9_created - name: Set bind9 properties iocage: name: bind9 state: set properties: "{{ jails.bind9 }}" register: jails_bind9_changed when: not jails_bind9_created.changed - name: Restart jails iocage: name: bind9 state: restarted when: jails_bind9_changed.changed - name: Create tor jail iocage: name: tor state: present properties: "{{ jails.tor }}" register: jails_tor_created - name: Set tor properties iocage: name: tor state: set properties: "{{ jails.tor }}" register: jails_tor_changed when: not jails_tor_created.changed - name: Restart jails iocage: name: tor state: restarted when: jails_tor_changed.changed