From 7b0a154feda4f8e95b547ce0ba73176efa15b2b0 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Wed, 5 Jul 2023 18:49:18 -0400 Subject: [PATCH] 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 --- ansible/playbooks/cluster-prepare.yaml | 29 ++++++++++++++++---------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/ansible/playbooks/cluster-prepare.yaml b/ansible/playbooks/cluster-prepare.yaml index 769ff9d5..a535c6c0 100644 --- a/ansible/playbooks/cluster-prepare.yaml +++ b/ansible/playbooks/cluster-prepare.yaml @@ -24,12 +24,6 @@ nvme-cli,open-iscsi,parted,psmisc,python3,python3-apt,python3-kubernetes,python3-yaml, smartmontools,socat,software-properties-common,unzip,util-linux install_recommends: false - - name: Packages | Remove - ansible.builtin.apt: - name: apparmor - state: absent - purge: true - autoremove: true - name: User Configuration block: @@ -47,11 +41,23 @@ access_time: preserve - name: Network Configuration - notify: Restart systemd-networkd + notify: Reboot block: - name: Network Configuration | Set hostname ansible.builtin.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 - name: Network Configuration | Cilium (1) ansible.builtin.lineinfile: @@ -72,6 +78,11 @@ dest: /etc/profile.d/neofetch.sh mode: "0755" content: neofetch --config none + - name: System Configuration | Disable apparmor + ansible.builtin.systemd: + name: apparmor + state: stopped + masked: true - name: System Configuration | Disable swap ansible.posix.mount: name: "{{ item }}" @@ -103,10 +114,6 @@ fs.inotify.max_user_instances: 8192 handlers: - - name: Restart systemd-networkd - ansible.builtin.systemd: - service: systemd-networkd - state: restarted - name: Reboot ansible.builtin.reboot: msg: Rebooting nodes