Using Ansible os family instead of multiple Ansible os distributions (#6)
* Using Ansible os family instead of multiple Ansible os distributions * Added option to set timezone, this could save a bit of headache if someone has certificate problems Co-authored-by: janic <janic.voser@schulen-unteraegeri.ch>
This commit is contained in:
parent
97bed143b5
commit
1ce3319087
@ -4,6 +4,9 @@ k3s_version: v1.23.4+k3s1
|
||||
ansible_user: ansibleuser
|
||||
systemd_dir: /etc/systemd/system
|
||||
|
||||
# Set your timezone
|
||||
system_timezone: "Your/Timezone"
|
||||
|
||||
# interface which will be used for flannel
|
||||
flannel_iface: "eth0"
|
||||
|
||||
|
||||
@ -1,8 +1,13 @@
|
||||
---
|
||||
- name: Set same timezone on every Server
|
||||
timezone:
|
||||
name: "{{ system_timezone }}"
|
||||
when: (system_timezone is defined) and (system_timezone != "Your/Timezone")
|
||||
|
||||
- name: Set SELinux to disabled state
|
||||
selinux:
|
||||
state: disabled
|
||||
when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux']
|
||||
when: ansible_os_family == "RedHat"
|
||||
|
||||
- name: Enable IPv4 forwarding
|
||||
sysctl:
|
||||
@ -23,13 +28,13 @@
|
||||
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']
|
||||
when: ansible_os_family == "RedHat"
|
||||
|
||||
- name: Load br_netfilter
|
||||
modprobe:
|
||||
name: br_netfilter
|
||||
state: present
|
||||
when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux']
|
||||
when: ansible_os_family == "RedHat"
|
||||
|
||||
- name: Set bridge-nf-call-iptables (just to be sure)
|
||||
sysctl:
|
||||
@ -37,7 +42,7 @@
|
||||
value: "1"
|
||||
state: present
|
||||
reload: yes
|
||||
when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux']
|
||||
when: ansible_os_family == "RedHat"
|
||||
loop:
|
||||
- net.bridge.bridge-nf-call-iptables
|
||||
- net.bridge.bridge-nf-call-ip6tables
|
||||
@ -50,4 +55,4 @@
|
||||
insertafter: EOF
|
||||
path: /etc/sudoers
|
||||
validate: 'visudo -cf %s'
|
||||
when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux']
|
||||
when: ansible_os_family == "RedHat"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user