---
#- name: Untaint the control nodes
#  become_user: fdamstra
#  shell: "kubectl taint nodes --all node-role.kubernetes.io/master-"
#  ignore_errors: true # Errors out if already tainted

- name: Download k9s
  get_url:
    url: https://github.com/derailed/k9s/releases/download/v0.24.7/k9s_Linux_arm64.tar.gz
    dest: /usr/local/src/k9s_Linux_arm64.tar.gz
  register: new_k9s
  tags: wip

- name: Extract k9s if Changed
  ansible.builtin.unarchive:
    src: /usr/local/src/k9s_Linux_arm64.tar.gz
    dest: /usr/local/bin
    creates: /usr/local/bin/k9s
    exclude:
      - LICENSE
      - README
    copy: no
  when: new_k9s.changed
  tags: wi

# This is kind of a duplicate. We want to extract it if it doesn't exist, too.
- name: Extract k9s if it doesnt exist
  ansible.builtin.unarchive:
    src: /usr/local/src/k9s_Linux_arm64.tar.gz
    dest: /usr/local/bin
    creates: /usr/local/bin/k9s
    exclude:
      - LICENSE
      - README
    copy: no
  tags: wip
