mirror of
https://github.com/PyratLabs/ansible-role-k3s
synced 2024-11-09 23:13:30 +01:00
Merge pull request #59 from networkpanic/feature/archlinux
Archlinux support
This commit is contained in:
commit
e473064f61
8 changed files with 34 additions and 6 deletions
|
@ -14,6 +14,7 @@ The host you're running Ansible from requires the following Python dependencies:
|
|||
This role has been tested on Ansible 2.7.0+ against the following Linux Distributions:
|
||||
|
||||
- Amazon Linux 2
|
||||
- Archlinux
|
||||
- CentOS 8
|
||||
- CentOS 7
|
||||
- Debian 9
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
|
||||
# k3s cluster state, options: installed, started, stopped, restarted
|
||||
# k3s cluster state, options: installed, started, stopped, restarted, uninstalled
|
||||
# (default: installed)
|
||||
k3s_cluster_state: installed
|
||||
|
||||
|
|
15
tasks/build/install-docker-archlinux.yml
Normal file
15
tasks/build/install-docker-archlinux.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
|
||||
- name: Ensure docker is installed using Pacman
|
||||
pacman:
|
||||
name: docker
|
||||
state: present
|
||||
register: ensure_docker_prerequisites_installed
|
||||
until: ensure_docker_prerequisites_installed is succeeded
|
||||
retries: 3
|
||||
delay: 10
|
||||
notify:
|
||||
- restart docker
|
||||
become: "{{ k3s_become_for_package_install | ternary(true, false, k3s_become_for_all) }}"
|
||||
|
||||
- meta: flush_handlers
|
1
tasks/build/install-docker-prerequisites-archlinux.yml
Normal file
1
tasks/build/install-docker-prerequisites-archlinux.yml
Normal file
|
@ -0,0 +1 @@
|
|||
---
|
|
@ -23,12 +23,12 @@
|
|||
|
||||
- import_tasks: build/install-docker.yml
|
||||
when: k3s_use_docker
|
||||
and ansible_distribution | replace(" ", "-") | lower not in ['amazon', 'suse', 'opensuse-leap']
|
||||
and ansible_distribution | replace(" ", "-") | lower not in ['amazon', 'suse', 'opensuse-leap', 'archlinux']
|
||||
and (k3s_non_root is not defined or not k3s_non_root)
|
||||
|
||||
- include_tasks: build/install-docker-{{ ansible_distribution | replace(" ", "-") | lower }}.yml
|
||||
when: k3s_use_docker
|
||||
and ansible_distribution | replace(" ", "-") | lower in ['amazon', 'suse', 'opensuse-leap']
|
||||
and ansible_distribution | replace(" ", "-") | lower in ['amazon', 'suse', 'opensuse-leap', 'archlinux']
|
||||
and (k3s_non_root is not defined or not k3s_non_root)
|
||||
|
||||
- import_tasks: build/download-k3s.yml
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
|
||||
- import_tasks: teardown/uninstall-docker.yml
|
||||
when: k3s_use_docker
|
||||
and ansible_distribution | replace(" ", "-") | lower not in ['amazon', 'suse', 'opensuse-leap']
|
||||
and ansible_distribution | replace(" ", "-") | lower not in ['amazon', 'suse', 'opensuse-leap', 'archlinux']
|
||||
and (k3s_non_root is not defined or not k3s_non_root)
|
||||
|
||||
- include_tasks: teardown/uninstall-docker-{{ ansible_distribution | replace(" ", "-") | lower }}.yml
|
||||
when: k3s_use_docker
|
||||
and ansible_distribution | replace(" ", "-") | lower in ['amazon', 'suse', 'opensuse-leap']
|
||||
and ansible_distribution | replace(" ", "-") | lower in ['amazon', 'suse', 'opensuse-leap', 'archlinux']
|
||||
and (k3s_non_root is not defined or not k3s_non_root)
|
||||
|
||||
- include_tasks: teardown/uninstall-docker-prerequisites-{{ ansible_os_family | lower }}.yml
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
become: "{{ k3s_become_for_kubectl | ternary(true, false, k3s_become_for_all) }}"
|
||||
|
||||
- name: Ensure uninstalled nodes are drained
|
||||
command: "{{ k3s_install_dir }}/kubectl drain {{ item }} --ignore-daemonsets"
|
||||
command: "{{ k3s_install_dir }}/kubectl drain {{ item }} --ignore-daemonsets --delete-local-data"
|
||||
delegate_to: "{{ k3s_control_delegate }}"
|
||||
run_once: true
|
||||
when: item in kubectl_get_nodes_result.stdout
|
||||
|
|
11
tasks/teardown/uninstall-docker-archlinux.yml
Normal file
11
tasks/teardown/uninstall-docker-archlinux.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
|
||||
- name: Ensure docker is uninstalled using Pacman
|
||||
pacman:
|
||||
name: docker
|
||||
state: absent
|
||||
register: ensure_docker_uninstalled
|
||||
until: ensure_docker_uninstalled is succeeded
|
||||
retries: 3
|
||||
delay: 10
|
||||
become: "{{ k3s_become_for_uninstall | ternary(true, false, k3s_become_for_all) }}"
|
Loading…
Reference in a new issue