Commit a0cd8204 authored by Pietsch, Martin's avatar Pietsch, Martin

remove parts of _jailconfig.yml and add them to _jailcreation.yml and _jaildevfs.yml

parent cac21746
......@@ -32,55 +32,3 @@
{% do container.update({'jailname': container.name | replace('.', '_')}) -%}
{{ container }}
- name: install fstab for container
template:
src: "{{ '%s.j2' | format(container.container_options['mount.fstab'] | basename) }}"
dest: "{{ '/etc/%s' | format(container.container_options['mount.fstab'] | basename) }}"
mode: 0644
when: container.container_options['mount.fstab'] is defined
- name: configure containers devfs
block:
- name: set devfs rules for container
ini_file:
path: /etc/defaults/devfs.rules
create: yes
allow_no_value: yes
section: "devfsrules_jail_{{ container.jailname }}={{ container.container_options['devfs_ruleset'] }}"
option: "{{ _rule }}"
register: _devfs_result
loop: "{{ ['add include $devfsrules_hide_all', 'add include $devfsrules_unhide_basic', 'add include $devfsrules_unhide_login'] | union(container.container_options['devfs_rules']) }}"
loop_control:
loop_var: _rule
- name: restart devfs
service:
name: devfs
state: restarted
when: _devfs_result.changed == True
when: container.container_options['devfs_ruleset'] is defined and container.container_options['devfs_rules'] is defined
- name: create "{{ container.name }}" container
jail:
name: "{{ container.jailname }}"
mirror: "{{ freebsd_install_local_mirror | default(freebsd_install_home_mirror) }}"
rcconf:
sendmail_enable: "NONE"
packages:
- python3
usehostdns: yes
usehostrepo: yes
create_nullfs: yes
state: create
options: "{{ container.container_options }}"
- name: start "{{ container.name }}" container
jail:
name: "{{ container.jailname }}"
state: start
- import_tasks: registercontainer.yml
- name: install and configure container package
include_tasks: _pkginstall.yml
- include_role:
name: system.freebsd
tasks_from: _jailconfig
- name: install fstab for container
template:
src: "{{ '%s.j2' | format(container.container_options['mount.fstab'] | basename) }}"
dest: "{{ '/etc/%s' | format(container.container_options['mount.fstab'] | basename) }}"
mode: 0644
when: container.container_options['mount.fstab'] is defined
- name: create "{{ container.name }}" container
jail:
name: "{{ container.jailname }}"
mirror: "{{ freebsd_install_local_mirror | default(freebsd_install_home_mirror) }}"
rcconf:
sendmail_enable: "NONE"
packages:
- python3
usehostdns: yes
usehostrepo: yes
create_nullfs: yes
state: create
options: "{{ container.container_options }}"
- name: start "{{ container.name }}" container
jail:
name: "{{ container.jailname }}"
state: start
- import_tasks: registercontainer.yml
- name: install and configure container package
include_tasks: _pkginstall.yml
- block:
- include_role:
name: system.freebsd
tasks_from: _jailconfig
- name: set devfs rules for container
ini_file:
path: /etc/defaults/devfs.rules
create: yes
allow_no_value: yes
section: "devfsrules_jail_{{ container.jailname }}={{ container.container_options['devfs_ruleset'] }}"
option: "{{ _rule }}"
register: _devfs_result
loop: "{{ ['add include $devfsrules_hide_all', 'add include $devfsrules_unhide_basic', 'add include $devfsrules_unhide_login'] | union(container.container_options['devfs_rules']) }}"
loop_control:
loop_var: _rule
- name: restart devfs
service:
name: devfs
state: restarted
when: _devfs_result.changed == True
when: container.container_options['devfs_ruleset'] is defined and container.container_options['devfs_rules'] is defined
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment