It changes the directory layout of the ansible playbook to a more "best practices" friendly approach using ansible roles and a real inventory file Co-authored-by: Ilya Kreymer <ikreymer@users.noreply.github.com>
		
			
				
	
	
		
			55 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
---
 | 
						|
- name: Set SELinux to disabled state
 | 
						|
  selinux:
 | 
						|
    state: disabled
 | 
						|
  when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux', 'Rocky Linux']
 | 
						|
 | 
						|
- name: Enable IPv4 forwarding
 | 
						|
  sysctl:
 | 
						|
    name: net.ipv4.ip_forward
 | 
						|
    value: "1"
 | 
						|
    state: present
 | 
						|
    reload: yes
 | 
						|
 | 
						|
- name: Enable IPv6 forwarding
 | 
						|
  sysctl:
 | 
						|
    name: net.ipv6.conf.all.forwarding
 | 
						|
    value: "1"
 | 
						|
    state: present
 | 
						|
    reload: yes
 | 
						|
  when: ansible_all_ipv6_addresses
 | 
						|
 | 
						|
- name: Add br_netfilter to /etc/modules-load.d/
 | 
						|
  copy:
 | 
						|
    content: "br_netfilter"
 | 
						|
    dest: /etc/modules-load.d/br_netfilter.conf
 | 
						|
    mode: "u=rw,g=,o="
 | 
						|
  when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux', 'Rocky Linux']
 | 
						|
 | 
						|
- name: Load br_netfilter
 | 
						|
  modprobe:
 | 
						|
    name: br_netfilter
 | 
						|
    state: present
 | 
						|
  when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux', 'Rocky Linux']
 | 
						|
 | 
						|
- name: Set bridge-nf-call-iptables (just to be sure)
 | 
						|
  sysctl:
 | 
						|
    name: "{{ item }}"
 | 
						|
    value: "1"
 | 
						|
    state: present
 | 
						|
    reload: yes
 | 
						|
  when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux', 'Rocky Linux']
 | 
						|
  loop:
 | 
						|
    - net.bridge.bridge-nf-call-iptables
 | 
						|
    - net.bridge.bridge-nf-call-ip6tables
 | 
						|
 | 
						|
- 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', 'Rocky Linux']
 |