refactor: restructure inventory, split roles and add new services
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- name: include network configuration
|
||||
include_tasks: network.yml
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
- name: deploy ifupdown interfaces config
|
||||
ansible.builtin.template:
|
||||
src: interfaces
|
||||
dest: /etc/network/interfaces
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
register: interfaces_conf
|
||||
|
||||
- name: reload ifupdown2
|
||||
command: ifreload -a
|
||||
when: interfaces_conf.changed
|
||||
@@ -0,0 +1,20 @@
|
||||
{% for item in ifupdown2 %}
|
||||
auto {{ item.iface }}
|
||||
iface {{ item.iface }}{% if item.method is defined %} inet {{ item.method }}
|
||||
{% endif %}
|
||||
|
||||
{% if item.address is defined %}
|
||||
address {{ item.address }}
|
||||
{% endif %}
|
||||
{% if item['vlan-raw-device'] is defined %}
|
||||
vlan-raw-device {{ item['vlan-raw-device'] }}
|
||||
{% endif %}
|
||||
{% if item.routing is defined %}
|
||||
{% for route in item.routing %}
|
||||
{{ route }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if not loop.last %}
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
Reference in New Issue
Block a user