Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 1 | --- |
| 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 Williams | 0ab8f51 | 2017-06-29 08:41:51 -0700 | [diff] [blame] | 19 | - name: Default to accept forwarded traffic |
| 20 | iptables: |
| 21 | chain: FORWARD |
| 22 | policy: ACCEPT |
| 23 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 24 | - 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 | |