2019-09-29 00:19:18 +02:00
|
|
|
---
|
|
|
|
- name: Set SELinux to disabled state
|
|
|
|
selinux:
|
|
|
|
state: disabled
|
2020-05-12 22:17:06 +02:00
|
|
|
when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux']
|
2019-09-29 00:19:18 +02:00
|
|
|
|
2019-10-28 04:34:34 +01:00
|
|
|
- name: Enable IPv4 forwarding
|
2019-09-29 00:19:18 +02:00
|
|
|
sysctl:
|
|
|
|
name: net.ipv4.ip_forward
|
|
|
|
value: "1"
|
|
|
|
state: present
|
|
|
|
reload: yes
|
|
|
|
|
2019-10-28 04:34:34 +01:00
|
|
|
- name: Enable IPv6 forwarding
|
2019-09-29 00:19:18 +02:00
|
|
|
sysctl:
|
|
|
|
name: net.ipv6.conf.all.forwarding
|
|
|
|
value: "1"
|
|
|
|
state: present
|
|
|
|
reload: yes
|
2021-07-10 14:49:21 +02:00
|
|
|
when: ansible_all_ipv6_addresses
|
2019-09-29 00:19:18 +02:00
|
|
|
|
2020-04-29 22:28:36 +02:00
|
|
|
- name: Add br_netfilter to /etc/modules-load.d/
|
|
|
|
copy:
|
|
|
|
content: "br_netfilter"
|
|
|
|
dest: /etc/modules-load.d/br_netfilter.conf
|
2020-09-22 20:08:35 +02:00
|
|
|
mode: "u=rw,g=,o="
|
2020-04-29 22:28:36 +02:00
|
|
|
when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux']
|
|
|
|
|
|
|
|
- name: Load br_netfilter
|
|
|
|
modprobe:
|
|
|
|
name: br_netfilter
|
|
|
|
state: present
|
|
|
|
when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux']
|
|
|
|
|
2019-10-28 04:34:34 +01:00
|
|
|
- name: Set bridge-nf-call-iptables (just to be sure)
|
2019-09-29 00:19:18 +02:00
|
|
|
sysctl:
|
2020-07-14 17:14:20 +02:00
|
|
|
name: "{{ item }}"
|
2019-09-29 00:19:18 +02:00
|
|
|
value: "1"
|
|
|
|
state: present
|
|
|
|
reload: yes
|
2020-05-12 22:17:06 +02:00
|
|
|
when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux']
|
2020-05-12 22:25:01 +02:00
|
|
|
loop:
|
|
|
|
- net.bridge.bridge-nf-call-iptables
|
|
|
|
- net.bridge.bridge-nf-call-ip6tables
|
2020-04-29 22:28:36 +02:00
|
|
|
|
|
|
|
- name: Add /usr/local/bin to sudo secure_path
|
|
|
|
lineinfile:
|
|
|
|
line: 'Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin'
|
|
|
|
regexp: "Defaults(\\s)*secure_path(\\s)*="
|
|
|
|
state: present
|
|
|
|
insertafter: EOF
|
|
|
|
path: /etc/sudoers
|
|
|
|
validate: 'visudo -cf %s'
|
|
|
|
when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux']
|