Commit 15106a28 authored by Pietsch, Martin's avatar Pietsch, Martin

introduce key 'jailname' for jail definition

parent 824ffd31
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
container: >- container: >-
{% do container.container_options.update({'ip4.addr': container_options.ipv4 | join(',')}) if container_options.ipv4 is defined -%} {% do container.container_options.update({'ip4.addr': container_options.ipv4 | join(',')}) if container_options.ipv4 is defined -%}
{% do container.container_options.update({'ip6.addr': container_options.ipv6 | join(',')}) if container_options.ipv6 is defined -%} {% do container.container_options.update({'ip6.addr': container_options.ipv6 | join(',')}) if container_options.ipv6 is defined -%}
{% do container.update({'jailname': container.name | replace('.', '_')}) -%}
{{ container }} {{ container }}
- name: install fstab for container - name: install fstab for container
...@@ -36,10 +37,11 @@ ...@@ -36,10 +37,11 @@
src: "{{ '%s.j2' | format(container.container_options['mount.fstab'] | basename) }}" src: "{{ '%s.j2' | format(container.container_options['mount.fstab'] | basename) }}"
dest: "{{ '/etc/%s' | format(container.container_options['mount.fstab'] | basename) }}" dest: "{{ '/etc/%s' | format(container.container_options['mount.fstab'] | basename) }}"
mode: 0644 mode: 0644
when: container.container_options['mount.fstab'] is defined
- name: create "{{ container.name }}" container - name: create "{{ container.name }}" container
jail: jail:
name: "{{ container.name }}" name: "{{ container.jailname }}"
mirror: "{{ freebsd_install_local_mirror | default(freebsd_install_home_mirror) }}" mirror: "{{ freebsd_install_local_mirror | default(freebsd_install_home_mirror) }}"
rcconf: rcconf:
sendmail_enable: "NONE" sendmail_enable: "NONE"
...@@ -53,7 +55,7 @@ ...@@ -53,7 +55,7 @@
- name: start "{{ container.name }}" container - name: start "{{ container.name }}" container
jail: jail:
name: "{{ container.name }}" name: "{{ container.jailname }}"
state: start state: start
- import_tasks: registercontainer.yml - import_tasks: registercontainer.yml
......
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