Improve task naming
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
2769cff893
commit
38f8dd96e1
25
playbook.yml
25
playbook.yml
@ -100,51 +100,48 @@
|
|||||||
- cluster.k3s.yml
|
- cluster.k3s.yml
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
- name: Initial node
|
- block:
|
||||||
block:
|
|
||||||
|
|
||||||
- name: Install K3s binary
|
- name: \[Initial node\] Install K3s binary
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: "curl -sfL https://get.k3s.io | sh -s - server --cluster-init --disable local-storage,traefik --tls-san {{ cluster.virtualip | ansible.utils.ipaddr('address') }}"
|
cmd: "curl -sfL https://get.k3s.io | sh -s - server --cluster-init --disable local-storage,traefik --tls-san {{ cluster.virtualip | ansible.utils.ipaddr('address') }}"
|
||||||
|
|
||||||
- name: Retrieve token
|
- name: \[Initial node\] Retrieve token
|
||||||
ansible.builtin.slurp:
|
ansible.builtin.slurp:
|
||||||
src: /var/lib/rancher/k3s/server/token
|
src: /var/lib/rancher/k3s/server/token
|
||||||
register: k3s_token
|
register: k3s_token
|
||||||
|
|
||||||
- name: Store token
|
- name: \[Initial node\] Store token
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
clustertoken: "{{ k3s_token.content | b64decode | trim }}"
|
clustertoken: "{{ k3s_token.content | b64decode | trim }}"
|
||||||
|
|
||||||
- name: Install 'kube-vip'
|
- block:
|
||||||
block:
|
|
||||||
|
|
||||||
- name: Retrieve manifest for RBAC
|
- name: \[Install 'kube-vip'\] Retrieve manifest for RBAC
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: https://kube-vip.io/manifests/rbac.yaml
|
url: https://kube-vip.io/manifests/rbac.yaml
|
||||||
return_content: yes
|
return_content: yes
|
||||||
register: manifest_rbac
|
register: manifest_rbac
|
||||||
|
|
||||||
- name: Pull image
|
- name: \[Install 'kube-vip'\] Pull image
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: ctr image pull ghcr.io/kube-vip/kube-vip:latest
|
cmd: ctr image pull ghcr.io/kube-vip/kube-vip:latest
|
||||||
|
|
||||||
- name: Generate manifest for daemonSet
|
- name: \[Install 'kube-vip'\] Generate manifest for daemonSet
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: "ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:latest vip /kube-vip manifest daemonset --interface {{ ansible_default_ipv4.interface }} --address {{ cluster.virtualip | ansible.utils.ipaddr('address') }} --inCluster --taint --controlplane --services --arp --leaderElection"
|
cmd: "ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:latest vip /kube-vip manifest daemonset --interface {{ ansible_default_ipv4.interface }} --address {{ cluster.virtualip | ansible.utils.ipaddr('address') }} --inCluster --taint --controlplane --services --arp --leaderElection"
|
||||||
register: manifest_daemonset
|
register: manifest_daemonset
|
||||||
|
|
||||||
- name: Inject manifest for installation
|
- name: \[Install 'kube-vip'\] Inject manifest for installation
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: kube-vip.j2
|
src: kube-vip.j2
|
||||||
dest: /var/lib/rancher/k3s/server/manifests/kube-vip.yml
|
dest: /var/lib/rancher/k3s/server/manifests/kube-vip.yml
|
||||||
|
|
||||||
when: inventory_hostname == ansible_play_hosts[0]
|
when: inventory_hostname == ansible_play_hosts[0]
|
||||||
|
|
||||||
- name: Additional nodes
|
- block:
|
||||||
block:
|
|
||||||
|
|
||||||
- name: Install K3s binary
|
- name: \[Additional nodes\] Install K3s binary
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: "curl -sfL https://get.k3s.io | sh -s - server --disable local-storage,traefik"
|
cmd: "curl -sfL https://get.k3s.io | sh -s - server --disable local-storage,traefik"
|
||||||
environment:
|
environment:
|
||||||
|
Loading…
Reference in New Issue
Block a user