2019-04-29 16:40:20 +08:00
|
|
|
---
|
2020-04-23 04:33:44 +08:00
|
|
|
- name: Check ansible version
|
|
|
|
import_playbook: ansible_version.yml
|
2019-04-29 16:40:20 +08:00
|
|
|
|
2021-03-24 08:26:05 +08:00
|
|
|
- name: Add kube-master nodes to kube_control_plane
|
|
|
|
# This is for old inventory which contains kube-master instead of kube_control_plane
|
|
|
|
hosts: kube-master
|
|
|
|
gather_facts: false
|
|
|
|
tasks:
|
|
|
|
- name: add nodes to kube_control_plane group
|
|
|
|
group_by:
|
|
|
|
key: 'kube_control_plane'
|
|
|
|
|
2019-04-29 16:40:20 +08:00
|
|
|
- hosts: bastion[0]
|
|
|
|
gather_facts: False
|
2021-02-24 01:44:02 +08:00
|
|
|
environment: "{{ proxy_disable_env }}"
|
2019-04-29 16:40:20 +08:00
|
|
|
roles:
|
|
|
|
- { role: kubespray-defaults}
|
|
|
|
- { role: bastion-ssh-config, tags: ["localhost", "bastion"]}
|
|
|
|
|
|
|
|
- hosts: "{{ groups['etcd'] | first }}"
|
2021-02-24 01:44:02 +08:00
|
|
|
environment: "{{ proxy_disable_env }}"
|
2019-04-29 16:40:20 +08:00
|
|
|
roles:
|
|
|
|
- { role: kubespray-defaults}
|
|
|
|
- { role: recover_control_plane/etcd }
|
|
|
|
|
2021-03-24 08:26:05 +08:00
|
|
|
- hosts: "{{ groups['kube_control_plane'] | first }}"
|
2021-02-24 01:44:02 +08:00
|
|
|
environment: "{{ proxy_disable_env }}"
|
2019-04-29 16:40:20 +08:00
|
|
|
roles:
|
2021-03-02 05:38:16 +08:00
|
|
|
- { role: kubespray-defaults}
|
2021-02-03 18:06:29 +08:00
|
|
|
- { role: recover_control_plane/control-plane }
|
2019-04-29 16:40:20 +08:00
|
|
|
|
|
|
|
- include: cluster.yml
|
|
|
|
|
2021-03-24 08:26:05 +08:00
|
|
|
- hosts: "{{ groups['kube_control_plane'] }}"
|
2021-02-24 01:44:02 +08:00
|
|
|
environment: "{{ proxy_disable_env }}"
|
2019-04-29 16:40:20 +08:00
|
|
|
roles:
|
|
|
|
- { role: kubespray-defaults}
|
|
|
|
- { role: recover_control_plane/post-recover }
|