2021-04-29 20:20:50 +08:00
|
|
|
---
|
2023-12-05 06:24:00 +08:00
|
|
|
- name: Check ansible version
|
|
|
|
import_playbook: ansible_version.yml
|
|
|
|
|
|
|
|
# These are inventory compatibility tasks to ensure we keep compatibility with old style group names
|
2021-04-29 20:20:50 +08:00
|
|
|
|
|
|
|
- name: Add kube-master nodes to kube_control_plane
|
|
|
|
hosts: kube-master
|
|
|
|
gather_facts: false
|
2021-08-26 03:01:54 +08:00
|
|
|
tags: always
|
2021-04-29 20:20:50 +08:00
|
|
|
tasks:
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Add nodes to kube_control_plane group
|
2021-04-29 20:20:50 +08:00
|
|
|
group_by:
|
|
|
|
key: 'kube_control_plane'
|
|
|
|
|
|
|
|
- name: Add kube-node nodes to kube_node
|
|
|
|
hosts: kube-node
|
|
|
|
gather_facts: false
|
2021-08-26 03:01:54 +08:00
|
|
|
tags: always
|
2021-04-29 20:20:50 +08:00
|
|
|
tasks:
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Add nodes to kube_node group
|
2021-04-29 20:20:50 +08:00
|
|
|
group_by:
|
|
|
|
key: 'kube_node'
|
|
|
|
|
|
|
|
- name: Add k8s-cluster nodes to k8s_cluster
|
|
|
|
hosts: k8s-cluster
|
|
|
|
gather_facts: false
|
2021-08-26 03:01:54 +08:00
|
|
|
tags: always
|
2021-04-29 20:20:50 +08:00
|
|
|
tasks:
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Add nodes to k8s_cluster group
|
2021-04-29 20:20:50 +08:00
|
|
|
group_by:
|
|
|
|
key: 'k8s_cluster'
|
|
|
|
|
|
|
|
- name: Add calico-rr nodes to calico_rr
|
|
|
|
hosts: calico-rr
|
|
|
|
gather_facts: false
|
2021-08-26 03:01:54 +08:00
|
|
|
tags: always
|
2021-04-29 20:20:50 +08:00
|
|
|
tasks:
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Add nodes to calico_rr group
|
2021-04-29 20:20:50 +08:00
|
|
|
group_by:
|
|
|
|
key: 'calico_rr'
|
|
|
|
|
|
|
|
- name: Add no-floating nodes to no_floating
|
|
|
|
hosts: no-floating
|
|
|
|
gather_facts: false
|
2021-08-26 03:01:54 +08:00
|
|
|
tags: always
|
2021-04-29 20:20:50 +08:00
|
|
|
tasks:
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Add nodes to no-floating group
|
2021-04-29 20:20:50 +08:00
|
|
|
group_by:
|
|
|
|
key: 'no_floating'
|
2023-12-05 06:24:00 +08:00
|
|
|
|
|
|
|
- name: Install bastion ssh config
|
|
|
|
hosts: bastion[0]
|
2024-08-28 13:30:56 +08:00
|
|
|
gather_facts: false
|
2023-12-05 06:24:00 +08:00
|
|
|
environment: "{{ proxy_disable_env }}"
|
|
|
|
roles:
|
|
|
|
- { role: kubespray-defaults }
|
|
|
|
- { role: bastion-ssh-config, tags: ["localhost", "bastion"] }
|