feat(ansible): Deploy coredns with HelmChart instead of builtin method and other small QoL changes

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl committed 2023-07-03 11:30:13 -04:00
1 parent df96293874
commit 46d68b8d95
16 files changed
+369 -226

No files matched your search

+11 -28
View File
@@ -1,7 +1,6 @@
---
- hosts:
- master
- worker
- name: Prepare System
hosts: all
become: true
gather_facts: true
any_errors_fatal: true
@@ -28,12 +27,12 @@
block: |
127.0.1.1 {{ inventory_hostname }}
# https://github.com/cilium/cilium/issues/18706
- name: Network | Cilium (1)
- name: Networking | Cilium (1)
ansible.builtin.lineinfile:
dest: /etc/systemd/networkd.conf
regexp: ManageForeignRoutingPolicyRules
line: ManageForeignRoutingPolicyRules=no
- name: Network Configuration | Cilium (2)
- name: Networking | Cilium (2)
ansible.builtin.lineinfile:
dest: /etc/systemd/networkd.conf
regexp: ManageForeignRoutes
@@ -43,12 +42,10 @@
block:
- name: Packages | Install required packages
ansible.builtin.apt:
name: "{{ ubuntu.packages | default([]) }}"
name: hdparm,htop,ipvsadm,lm-sensors,nano,nfs-common,nvme-cli,
socat,python3-kubernetes,python3-yaml
state: present
update_cache: true
- name: Packages | Remove leaf packages
ansible.builtin.apt:
autoremove: true
- name: Packages | RasPi packages
ansible.builtin.apt:
name: ["linux-modules-extra-raspi"]
@@ -56,14 +53,6 @@
notify: Reboot
when: "'raspi' in ansible_kernel"
- name: User Configuration
block:
- name: User Configuration | Add additional SSH public keys
ansible.posix.authorized_key:
user: "{{ ansible_user }}"
key: "{{ item }}"
loop: "{{ public_ssh_keys | default([]) }}"
- name: System Configuration (1)
block:
- name: System Configuration (1) | Disable ufw
@@ -87,13 +76,13 @@
community.general.modprobe:
name: "{{ item }}"
state: present
loop: [br_netfilter, ip_vs, ip_vs_rr, overlay, rbd]
loop: ["br_netfilter", "ceph", "ip_vs", "ip_vs_rr", "nbd", "overlay", "rbd"]
- name: System Configuration (2) | Enable kernel modules on boot
ansible.builtin.copy:
mode: 0644
mode: "0644"
content: "{{ item }}"
dest: "/etc/modules-load.d/{{ item }}.conf"
loop: [br_netfilter, ip_vs, ip_vs_rr, overlay, rbd]
loop: ["br_netfilter", "ceph", "ip_vs", "ip_vs_rr", "nbd", "overlay", "rbd"]
- name: System Configuration (2) | Set sysctls
ansible.posix.sysctl:
name: "{{ item.key }}"
@@ -103,15 +92,9 @@
with_dict: "{{ sysctl_config }}"
vars:
sysctl_config:
net.ipv4.ip_forward: 1
net.ipv4.conf.all.forwarding: 1
net.ipv4.conf.all.rp_filter: 0
net.ipv4.conf.default.rp_filter: 0
net.ipv6.conf.all.forwarding: 1
net.bridge.bridge-nf-call-iptables: 1
net.bridge.bridge-nf-call-ip6tables: 1
fs.inotify.max_queued_events: 65536
fs.inotify.max_user_watches: 524288
fs.inotify.max_user_instances: 512
fs.inotify.max_user_instances: 8192
- name: System Configuration (2) | Disable swap at runtime
ansible.builtin.command: swapoff -a
when: ansible_swaptotal_mb > 0