mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2026-03-09 12:02:11 +01:00
Install airgap selinux rpms when avaliable (#500)
Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
@@ -177,7 +177,7 @@ $ cat inventory.yml
|
|||||||
airgap_dir: ./my-airgap # Paths are relative to the playbooks directory
|
airgap_dir: ./my-airgap # Paths are relative to the playbooks directory
|
||||||
```
|
```
|
||||||
|
|
||||||
Additionally, if deploying on an OS with SELinux, you will also need to download the latest [k3s-selinux RPM](https://github.com/k3s-io/k3s-selinux/releases/latest) and place it in the airgap folder.
|
Additionally, if deploying on an OS with SELinux, you will also need to download the latest [k3s-selinux RPM](https://github.com/k3s-io/k3s-selinux/releases/latest) and its dependencies `selinux-policy` and `container-selinux` RPMs and place them in the airgap folder.
|
||||||
|
|
||||||
|
|
||||||
It is assumed that the control node has access to the internet. The playbook will automatically download the k3s install script on the control node, and then distribute all three artifacts to the managed nodes.
|
It is assumed that the control node has access to the internet. The playbook will automatically download the k3s install script on the control node, and then distribute all three artifacts to the managed nodes.
|
||||||
|
|||||||
@@ -57,7 +57,9 @@
|
|||||||
# so we need to skip it if the file is not found
|
# so we need to skip it if the file is not found
|
||||||
skip: true
|
skip: true
|
||||||
|
|
||||||
|
# Dependencies are listed first so they get installed first in the next task
|
||||||
- name: Distribute K3s SELinux RPM
|
- name: Distribute K3s SELinux RPM
|
||||||
|
when: ansible_facts['os_family'] == 'RedHat' or ansible_facts['os_family'] == 'Suse'
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
dest: /tmp/
|
dest: /tmp/
|
||||||
@@ -65,16 +67,18 @@
|
|||||||
group: root
|
group: root
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
with_fileglob:
|
with_fileglob:
|
||||||
|
- "{{ airgap_dir }}/container-selinux*.rpm"
|
||||||
|
- "{{ airgap_dir }}/selinux-policy*.rpm"
|
||||||
- "{{ airgap_dir }}/k3s-selinux*.rpm"
|
- "{{ airgap_dir }}/k3s-selinux*.rpm"
|
||||||
register: airgap_selinux_copy
|
register: airgap_selinux_copy
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Install K3s SELinux RPM
|
- name: Install K3s SELinux RPM
|
||||||
when:
|
when:
|
||||||
- ansible_facts['os_family'] == 'RedHat'
|
- ansible_facts['os_family'] == 'RedHat' or ansible_facts['os_family'] == 'Suse'
|
||||||
- airgap_selinux_copy.skipped is false
|
- airgap_selinux_copy.skipped is false
|
||||||
ansible.builtin.dnf:
|
ansible.builtin.dnf:
|
||||||
name: "{{ airgap_selinux_copy.results[0].dest }}"
|
name: "{{ airgap_selinux_copy.results | selectattr('dest', 'defined') | map(attribute='dest') | list }}"
|
||||||
state: present
|
state: present
|
||||||
disable_gpg_check: true
|
disable_gpg_check: true
|
||||||
disablerepo: "*"
|
disablerepo: "*"
|
||||||
|
|||||||
Reference in New Issue
Block a user