mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2025-12-25 00:12:37 +01:00
Handle apparmor for Debian 11 when parser not present
Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
owner: "{{ ansible_user }}"
|
owner: "{{ ansible_user }}"
|
||||||
mode: "u=rwx,g=rx,o="
|
mode: "u=rwx,g=rx,o="
|
||||||
|
|
||||||
- name: Pause to allow server startup
|
- name: Pause to allow first server startup
|
||||||
when: (groups['server'] | length) > 1
|
when: (groups['server'] | length) > 1
|
||||||
ansible.builtin.pause:
|
ansible.builtin.pause:
|
||||||
seconds: 10
|
seconds: 10
|
||||||
@@ -54,6 +54,14 @@
|
|||||||
owner: "{{ ansible_user }}"
|
owner: "{{ ansible_user }}"
|
||||||
mode: "u=rw,g=,o="
|
mode: "u=rw,g=,o="
|
||||||
|
|
||||||
|
- name: Add K3s autocomplete to user bashrc
|
||||||
|
become: true
|
||||||
|
become_user: "{{ ansible_user }}"
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: "k3s completion bash -i"
|
||||||
|
register: out
|
||||||
|
changed_when: out.rc != 0
|
||||||
|
|
||||||
- name: Change server to API endpoint instead of localhost
|
- name: Change server to API endpoint instead of localhost
|
||||||
ansible.builtin.command: >-
|
ansible.builtin.command: >-
|
||||||
/usr/local/bin/k3s kubectl config set-cluster default
|
/usr/local/bin/k3s kubectl config set-cluster default
|
||||||
|
|||||||
@@ -129,7 +129,7 @@
|
|||||||
register: apparmor_status
|
register: apparmor_status
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: Install Apparmor Parser
|
- name: Install Apparmor Parser [Suse]
|
||||||
when:
|
when:
|
||||||
- apparmor_status.stdout == "Y"
|
- apparmor_status.stdout == "Y"
|
||||||
- ansible_os_family == 'Suse'
|
- ansible_os_family == 'Suse'
|
||||||
@@ -137,6 +137,15 @@
|
|||||||
name: apparmor-parser
|
name: apparmor-parser
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
- name: Install Apparmor Parser [Debian]
|
||||||
|
when:
|
||||||
|
- apparmor_status.stdout == "Y"
|
||||||
|
- ansible_distribution == 'Debian'
|
||||||
|
- ansible_facts['distribution_major_version'] == "11"
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: apparmor
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Add /usr/local/bin to sudo secure_path
|
- name: Add /usr/local/bin to sudo secure_path
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
line: 'Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin'
|
line: 'Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin'
|
||||||
|
|||||||
Reference in New Issue
Block a user