[iface] disable automatic deployment from interfaces variable
parent
2460120450
commit
332955082d
|
@ -1,4 +1,7 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
|
||||
loc_borg:
|
||||
to_exclude:
|
||||
- /var/mail
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
adm: ens18
|
||||
san: ens19
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
|
||||
loc_slapd:
|
||||
ip: "{{ query('ldap', 'ip4', 'daniel', 'adm') }}"
|
||||
replica: true
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
|
||||
loc_borg:
|
||||
to_backup:
|
||||
- /etc
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
|
||||
loc_debian_images:
|
||||
include_extra_images: true
|
||||
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
|
||||
loc_slapd:
|
||||
ip: "{{ query('ldap', 'ip4', 'jack', 'adm') }}"
|
||||
replica: true
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
adm: ens18
|
||||
san: ens19
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
|
||||
loc_debian_images:
|
||||
include_extra_images: true
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
adm: ens18
|
||||
via: ens19
|
||||
aurore: ens20
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
adm: ens18
|
||||
via: ens19
|
||||
aurore: ens20
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
adm: ens18
|
||||
via: ens19
|
||||
aurore: ens20
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
|
||||
loc_borg:
|
||||
to_backup:
|
||||
- /etc
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
|
||||
loc_debian_images:
|
||||
include_extra_images: true
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
|
||||
debian_mirror: 'file:/pool/mirror/pub/debian'
|
||||
|
||||
loc_postgres:
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
|
||||
loc_borg:
|
||||
to_backup:
|
||||
- /etc
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
---
|
||||
interfaces:
|
||||
disable: true
|
||||
|
||||
loc_borg:
|
||||
to_exclude:
|
||||
- /var/mail
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env ansible-playbook
|
||||
---
|
||||
- hosts: crans_vm,!routeurs_vm
|
||||
- hosts: server
|
||||
vars:
|
||||
network_interfaces: "{{ glob_network_interfaces | default({}) | combine(loc_network_interfaces | default({})) }}"
|
||||
roles:
|
||||
|
|
|
@ -35,7 +35,7 @@ include "./dhcp-failover.conf";
|
|||
|
||||
|
||||
{% for subnet in dhcp.subnets %}
|
||||
subnet {{ subnet.network | ansible.utils.netaddr('network') }} netmask {{ subnet.network | ansible.utils.netaddr('netmask') }} {
|
||||
subnet {{ subnet.network | ansible.utils.ipaddr('network') }} netmask {{ subnet.network | ansible.utils.ipaddr('netmask') }} {
|
||||
interface "{{ interfaces[subnet.vlan] }}";
|
||||
{% if subnet.default_lease_time is defined %}
|
||||
default-lease-time {{ subnet.default_lease_time }};
|
||||
|
@ -43,8 +43,8 @@ subnet {{ subnet.network | ansible.utils.netaddr('network') }} netmask {{ subnet
|
|||
{% if subnet.max_lease_time is defined %}
|
||||
max-lease-time {{ subnet.max_lease_time }};
|
||||
{% endif %}
|
||||
option subnet-mask {{ subnet.network | ansible.utils.netaddr('netmask') }};
|
||||
option broadcast-address {{ subnet.network | ansible.utils.netaddr('broadcast') }};
|
||||
option subnet-mask {{ subnet.network | ansible.utils.ipaddr('netmask') }};
|
||||
option broadcast-address {{ subnet.network | ansible.utils.ipaddr('broadcast') }};
|
||||
{% if subnet.routers is defined %}
|
||||
option routers {{ subnet.routers }};
|
||||
{% endif %}
|
||||
|
|
|
@ -9,17 +9,19 @@
|
|||
register: apt_result
|
||||
retries: 3
|
||||
until: apt_result is succeeded
|
||||
when: not (interfaces.disable is defined and interfaces.disable)
|
||||
|
||||
- name: Deploy default interfaces config
|
||||
template:
|
||||
src: network/interfaces.j2
|
||||
dest: /etc/network/interfaces
|
||||
mode: 0644
|
||||
when: interfaces is defined and not (interfaces.disable is defined and interfaces.disable)
|
||||
|
||||
- name: Deploy interfaces config
|
||||
template:
|
||||
src: network/interfaces.d/ifalias.j2
|
||||
dest: /etc/network/interfaces.d/{{ '%02d' | format(item.id) }}-{{ item.name | replace('_', '-') }}
|
||||
mode: 0644
|
||||
when: item.name in interfaces
|
||||
when: interfaces is defined and item.name in interfaces and not (interfaces.disable is defined and interfaces.disable)
|
||||
loop: "{{ network_interfaces.vlan }}"
|
||||
|
|
Loading…
Reference in New Issue