Add network interfaces config

This commit is contained in:
Daniel A. Maierhofer
2018-09-20 11:17:04 +02:00
parent 827ca87a39
commit 32cb76a1d5
4 changed files with 13 additions and 0 deletions

View File

@@ -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"

View File

@@ -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
View 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

View File

@@ -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']