Add network interfaces config
This commit is contained in:
@@ -106,6 +106,7 @@ common_tty: True
|
||||
common_git: True
|
||||
common_sysctl: False
|
||||
common_logrotate: True
|
||||
common_interfaces: False
|
||||
common_iptables: True
|
||||
common_iptables_v4: "iptables_default_v4.j2"
|
||||
common_iptables_v6: "iptables_default_v6.j2"
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
- name: apt-get update
|
||||
apt: update_cache=yes
|
||||
|
||||
- name: restart networking
|
||||
service: name=networking state=restarted
|
||||
|
||||
- name: iptables restore v4
|
||||
listen: iptables restore
|
||||
command: iptables-restore /etc/iptables/rules.v4
|
||||
|
||||
5
tasks/interfaces.yml
Normal file
5
tasks/interfaces.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: interfaces - /etc/network/interfaces
|
||||
template: "dest=/etc/network/interfaces src={{ common_interfaces }} owner=root group=root mode=0644"
|
||||
notify:
|
||||
restart networking
|
||||
@@ -69,6 +69,10 @@
|
||||
when: common_logrotate
|
||||
tags: ['common', 'logrotate']
|
||||
|
||||
- import_tasks: interfaces.yml
|
||||
when: common_interfaces
|
||||
tags: ['common', 'interfaces']
|
||||
|
||||
- import_tasks: iptables.yml
|
||||
when: common_iptables and ansible_os_family == "Debian"
|
||||
tags: ['common', 'iptables']
|
||||
|
||||
Reference in New Issue
Block a user