Skip to content
Snippets Groups Projects
Verified Commit 8346098b authored by Maarten de Waard's avatar Maarten de Waard :angel:
Browse files

make sure debian bug workaround is only applied when necessary

parent cace6276
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,9 @@
# We work around a Debian Bullseye issue with installing snaps on Xen nodes:
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983357 (Debian link)
# https://code.greenhost.net/greenhost/sysops/-/issues/915#note_108038 (GH # internal link)
- name: Get kbd device name
# Once the debian issue is solved and Greenhost has patched the kernel, these
# three workaround commands can be removed.
- name: Workaround debian bug 1/3
shell: journalctl -k | awk '/Xen.Virtual.Keyboard/ {print $11}'
args:
# Only run this if kubectl snap has not been installed yet
......@@ -59,16 +61,25 @@
failed_when: false
changed_when: false
- name: Workaround debian bug 2/3
# kubectl needs to get installed as "classic" snap
command: mount --bind /dev/zero /sys/{{ kbd_device.stdout }}/uevent
args:
creates: /snap/bin/kubectl
when: kdb_device.stdout != ""
- name: Install kubectl snap
# kubectl needs to get installed as "classic" snap
command: "{{ item }}"
command: snap install --classic kubectl
args:
creates: /snap/bin/kubectl
with_items:
# mount and umount commands are part of the workaround mentioned above
- sudo mount --bind /dev/zero /sys/{{ kbd_device.stdout }}/uevent
- snap install --classic kubectl
- sudo umount /sys/{{ kbd_device.stdout }}/uevent
- name: Workaround debian bug 3/3
# kubectl needs to get installed as "classic" snap
command: umount /sys/{{ kbd_device.stdout }}/uevent
args:
creates: /snap/bin/kubectl
when: kdb_device.stdout != ""
- name: Create kubectl symlink to /usr/local/bin
file:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment