2022-06-24 22:54:36 +00:00
|
|
|
- name: Create folder structure(s)
|
2022-06-24 21:44:10 +00:00
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
loop:
|
2022-06-24 22:50:44 +00:00
|
|
|
- /var/lib/rancher/k3s/agent/images
|
2022-07-14 08:33:26 +00:00
|
|
|
- /var/lib/rancher/k3s/server/manifests
|
2022-06-24 22:50:44 +00:00
|
|
|
- /opt/metacluster/k3s
|
|
|
|
|
|
|
|
- name: Download & install K3s binary
|
|
|
|
ansible.builtin.get_url:
|
2022-06-26 16:06:15 +00:00
|
|
|
url: https://github.com/k3s-io/k3s/releases/download/{{ platform.k3s.version }}/k3s
|
2022-06-24 22:50:44 +00:00
|
|
|
dest: /usr/local/bin/k3s
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
|
|
|
|
|
|
|
- name: Download K3s images tarball
|
|
|
|
ansible.builtin.get_url:
|
2022-06-26 16:06:15 +00:00
|
|
|
url: https://github.com/k3s-io/k3s/releases/download/{{ platform.k3s.version }}/k3s-airgap-images-amd64.tar.gz
|
2022-06-24 22:50:44 +00:00
|
|
|
dest: /var/lib/rancher/k3s/agent/images
|
|
|
|
|
|
|
|
- name: Download K3s install script
|
|
|
|
ansible.builtin.get_url:
|
|
|
|
url: https://get.k3s.io
|
2022-06-27 06:44:16 +00:00
|
|
|
dest: /opt/metacluster/k3s/install.sh
|
2022-06-24 22:50:44 +00:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
2022-07-14 12:54:04 +00:00
|
|
|
|
|
|
|
- name: Inject manifests
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: helmchartconfig.j2
|
|
|
|
dest: /var/lib/rancher/k3s/server/manifests/{{ item.name }}-config.yaml
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0600
|
|
|
|
loop: "{{ platform.packaged_components }}"
|
|
|
|
loop_control:
|
|
|
|
label: "{{ item.name }}"
|
2022-08-16 13:16:20 +00:00
|
|
|
notify:
|
|
|
|
- Apply manifests
|
|
|
|
|
|
|
|
- name: Trigger handlers
|
|
|
|
ansible.builtin.meta: flush_handlers
|