Make hostname in jail able to set from config

This commit is contained in:
László Károlyi 2020-09-21 18:57:38 +02:00
parent 9202a2643c
commit b0173c836a
Signed by: karolyi
GPG key ID: 2DCAF25E55735BFE

View file

@ -8,6 +8,15 @@
}}
_iter_config_lines: []
- name: Setting hostname for jail
set_fact:
_iter_config_opts: >-
{{
_iter_config_opts| combine(
{ 'host.hostname': _iter_config_opts.get('host.hostname', 'jail-' + vars['jail_' + jail_name + '_newest_id']) }
)
}}
- name: Converting config dict into config lines
set_fact:
_iter_config_lines: >-
@ -34,7 +43,6 @@
block: |
{{ vars['jail_' + jail_name + '_newest_id'] }} {
path="{{ vars['jail_' + jail_name + '_new_path']|quote }}";
host.hostname="jail-{{ vars['jail_' + jail_name + '_newest_id'] }}";
ip4.addr="lo0|{{ vars['jail_' + jail_name + '_new_ip4'] }}"/32;
{{ _iter_flattened_config }}
}
@ -50,7 +58,6 @@
block: |
{{ vars['jail_' + jail_name + '_newest_id'] }} {
path="{{ vars['jail_' + jail_name + '_new_path']|quote }}";
host.hostname="jail-{{ vars['jail_' + jail_name + '_newest_id'] }}";
ip4.addr="lo0|{{ vars['jail_' + jail_name + '_new_ip4'] }}/32";
ip6.addr="bridge0|{{ vars['jail_' + jail_name + '_ip6'] }}/128";
{{ _iter_flattened_config }}