blob: 4a33dea011a046798cef0201cab130a37f0f0428 [file] [log] [blame]
Zack Williams5223dd92017-02-28 23:38:02 -07001---
2# head-mgmtbr/tasks/main.yml
3
4- name: Create mgmtbr bridge configuration
5 template:
6 src: "mgmtbr.cfg.j2"
7 dest: /etc/network/interfaces.d/mgmtbr.cfg
8 owner: root
9 group: root
10 mode: 0644
11 register: mgmtbr_config
12
13- name: Bring up mgmtbr if reconfigured
14 when: mgmtbr_config.changed and ansible_mgmtbr is not defined
15 command: ifup mgmtbr
16 tags:
17 - skip_ansible_lint # needs to be run here or the next steps will fail
18
Zack Williams0ab8f512017-06-29 08:41:51 -070019- name: Default to accept forwarded traffic
20 iptables:
21 chain: FORWARD
22 policy: ACCEPT
23
Zack Williams5223dd92017-02-28 23:38:02 -070024- name: Configure NAT for mgmtbr
25 iptables:
26 table: nat
27 chain: POSTROUTING
28 out_interface: "{{ mgmtbr_nat_interface }}"
29 jump: MASQUERADE
30
31- name: Configure forwarding for mgmtbr
32 iptables:
33 chain: FORWARD
34 in_interface: mgmtbr
35 jump: ACCEPT
36