feat: changed lxc to vm in k3s

This commit is contained in:
Lino Silva
2023-01-03 11:59:54 +00:00
parent 1913d6417c
commit c9c9861a82
33 changed files with 413 additions and 164 deletions
+50 -9
View File
@@ -1,30 +1,62 @@
---
- name: Run the equivalent of "apt-get update" as a separate step
ansible.builtin.apt:
update_cache: yes
- name: Upgrade the OS (apt-get dist-upgrade)
ansible.builtin.apt:
upgrade: full
- name: Install QMEU Guest Agent
ansible.builtin.apt:
name: qemu-guest-agent
update_cache: yes
state: present
- name: Install NFS-Common
ansible.builtin.apt:
name: nfs-common
update_cache: yes
state: present
- name: Install open-iscsi
ansible.builtin.apt:
name: open-iscsi
update_cache: yes
state: present
- name: Install util-linux
ansible.builtin.apt:
name: util-linux
update_cache: yes
state: present
- name: Set same timezone on every Server
timezone:
community.general.system.timezone:
name: "{{ system_timezone }}"
when: (system_timezone is defined) and (system_timezone != "Your/Timezone")
- name: Set SELinux to disabled state
selinux:
ansible.posix.selinux:
state: disabled
when: ansible_os_family == "RedHat"
- name: Enable IPv4 forwarding
sysctl:
ansible.posix.sysctl:
name: net.ipv4.ip_forward
value: "1"
state: present
reload: yes
- name: Enable IPv6 forwarding
sysctl:
ansible.posix.sysctl:
name: net.ipv6.conf.all.forwarding
value: "1"
state: present
reload: yes
- name: Enable IPv6 router advertisements
sysctl:
ansible.posix.sysctl:
name: net.ipv6.conf.all.accept_ra
value: "2"
state: present
@@ -35,16 +67,25 @@
content: "br_netfilter"
dest: /etc/modules-load.d/br_netfilter.conf
mode: "u=rw,g=,o="
when: ansible_os_family == "RedHat"
- name: Load br_netfilter
modprobe:
community.general.system.modprobe:
name: br_netfilter
state: present
when: ansible_os_family == "RedHat"
- name: Add overlay to /etc/modules-load.d/
copy:
content: "overlay"
dest: /etc/modules-load.d/overlay.conf
mode: "u=rw,g=,o="
- name: Load overlay
community.general.system.modprobe:
name: overlay
state: present
- name: Set bridge-nf-call-iptables (just to be sure)
sysctl:
ansible.posix.sysctl:
name: "{{ item }}"
value: "1"
state: present