fix(ansible): keep apparmor installed but mask the service

Also add task back in for updating `/etc/hosts` since hostname doesn't change this file
This commit is contained in:
Devin Buhl authored and GitHub committed 2023-07-05 18:49:18 -04:00
1 parent ff031182d6
commit 7b0a154fed
1 file changed
+18 -11
+18 -11
View File
@@ -24,12 +24,6 @@
nvme-cli,open-iscsi,parted,psmisc,python3,python3-apt,python3-kubernetes,python3-yaml, nvme-cli,open-iscsi,parted,psmisc,python3,python3-apt,python3-kubernetes,python3-yaml,
smartmontools,socat,software-properties-common,unzip,util-linux smartmontools,socat,software-properties-common,unzip,util-linux
install_recommends: false install_recommends: false
- name: Packages | Remove
ansible.builtin.apt:
name: apparmor
state: absent
purge: true
autoremove: true
- name: User Configuration - name: User Configuration
block: block:
@@ -47,11 +41,23 @@
access_time: preserve access_time: preserve
- name: Network Configuration - name: Network Configuration
notify: Restart systemd-networkd notify: Reboot
block: block:
- name: Network Configuration | Set hostname - name: Network Configuration | Set hostname
ansible.builtin.hostname: ansible.builtin.hostname:
name: "{{ inventory_hostname }}" name: "{{ inventory_hostname }}"
- name: Network Configuration | Update hosts
ansible.builtin.copy:
content: |
127.0.0.1 localhost
127.0.1.1 {{ inventory_hostname }}
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
dest: /etc/hosts
mode: preserve
# https://github.com/cilium/cilium/issues/18706 # https://github.com/cilium/cilium/issues/18706
- name: Network Configuration | Cilium (1) - name: Network Configuration | Cilium (1)
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
@@ -72,6 +78,11 @@
dest: /etc/profile.d/neofetch.sh dest: /etc/profile.d/neofetch.sh
mode: "0755" mode: "0755"
content: neofetch --config none content: neofetch --config none
- name: System Configuration | Disable apparmor
ansible.builtin.systemd:
name: apparmor
state: stopped
masked: true
- name: System Configuration | Disable swap - name: System Configuration | Disable swap
ansible.posix.mount: ansible.posix.mount:
name: "{{ item }}" name: "{{ item }}"
@@ -103,10 +114,6 @@
fs.inotify.max_user_instances: 8192 fs.inotify.max_user_instances: 8192
handlers: handlers:
- name: Restart systemd-networkd
ansible.builtin.systemd:
service: systemd-networkd
state: restarted
- name: Reboot - name: Reboot
ansible.builtin.reboot: ansible.builtin.reboot:
msg: Rebooting nodes msg: Rebooting nodes