feat: rename ansible hosts groups to controllers and workers
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
6 files changed
+7
-7
No files matched your search
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
kubernetes:
|
kubernetes:
|
||||||
children:
|
children:
|
||||||
master:
|
controllers:
|
||||||
hosts:
|
hosts:
|
||||||
{% for item in nodes.inventory %}
|
{% for item in nodes.inventory %}
|
||||||
{% if item.controller %}
|
{% if item.controller %}
|
||||||
@@ -11,7 +11,7 @@ kubernetes:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if nodes.inventory | selectattr('controller', 'equalto', False) | list | length %}
|
{% if nodes.inventory | selectattr('controller', 'equalto', False) | list | length %}
|
||||||
worker:
|
workers:
|
||||||
hosts:
|
hosts:
|
||||||
{% for item in nodes.inventory %}
|
{% for item in nodes.inventory %}
|
||||||
{% if not item.controller %}
|
{% if not item.controller %}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Cluster kube-vip
|
- name: Cluster kube-vip
|
||||||
hosts: master
|
hosts: controllers
|
||||||
serial: 1
|
serial: 1
|
||||||
become: true
|
become: true
|
||||||
gather_facts: true
|
gather_facts: true
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
- name: Details
|
- name: Details
|
||||||
ansible.builtin.command: "k3s kubectl get node {% raw %}{{ inventory_hostname }}{% endraw %} -o json"
|
ansible.builtin.command: "k3s kubectl get node {% raw %}{{ inventory_hostname }}{% endraw %} -o json"
|
||||||
register: kubectl_get_node
|
register: kubectl_get_node
|
||||||
delegate_to: "{% raw %}{{ groups['master'][0] }}{% endraw %}"
|
delegate_to: "{% raw %}{{ groups['controllers'][0] }}{% endraw %}"
|
||||||
failed_when: false
|
failed_when: false
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
name: "{% raw %}{{ inventory_hostname }}{% endraw %}"
|
name: "{% raw %}{{ inventory_hostname }}{% endraw %}"
|
||||||
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
||||||
state: cordon
|
state: cordon
|
||||||
delegate_to: "{% raw %}{{ groups['master'][0] }}{% endraw %}"
|
delegate_to: "{% raw %}{{ groups['controllers'][0] }}{% endraw %}"
|
||||||
|
|
||||||
- name: Drain
|
- name: Drain
|
||||||
kubernetes.core.k8s_drain:
|
kubernetes.core.k8s_drain:
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
wait_timeout: 900
|
wait_timeout: 900
|
||||||
pod_selectors:
|
pod_selectors:
|
||||||
- app!=rook-ceph-osd # Rook Ceph
|
- app!=rook-ceph-osd # Rook Ceph
|
||||||
delegate_to: "{% raw %}{{ groups['master'][0] }}{% endraw %}"
|
delegate_to: "{% raw %}{{ groups['controllers'][0] }}{% endraw %}"
|
||||||
|
|
||||||
- name: Update
|
- name: Update
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
@@ -67,4 +67,4 @@
|
|||||||
name: "{% raw %}{{ inventory_hostname }}{% endraw %}"
|
name: "{% raw %}{{ inventory_hostname }}{% endraw %}"
|
||||||
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
kubeconfig: /etc/rancher/k3s/k3s.yaml
|
||||||
state: uncordon
|
state: uncordon
|
||||||
delegate_to: "{% raw %}{{ groups['master'][0] }}{% endraw %}"
|
delegate_to: "{% raw %}{{ groups['controllers'][0] }}{% endraw %}"
|
||||||
Reference in new issue
Block a user