forked from TimeBye/kubeadm-ha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
94-restore-cluster.yml
45 lines (43 loc) · 1.25 KB
/
94-restore-cluster.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
- hosts: localhost
become: no
tasks:
- name: "校验 Ansible 版本"
assert:
msg: "Ansible 版本最低要求 2.8.0,当前版本为 {{ ansible_version.string }},请升级 Ansible 版本。"
that:
- ansible_version.string is version("2.8.0", ">=")
vars:
ansible_connection: local
- hosts:
- all
vars_prompt:
name: "restore_confirmation"
prompt: "确认要恢复群集吗? 输入“yes”确认恢复群集。"
default: "no"
private: no
pre_tasks:
- name: 恢复确认
fail:
msg: "恢复确认失败,取消恢复集群操作。"
when: restore_confirmation != "yes"
gather_facts: false
tasks:
- name: "设置代理服务器环境变量"
set_fact:
proxy_env:
http_proxy: "{{ http_proxy | default ('') }}"
HTTP_PROXY: "{{ http_proxy | default ('') }}"
https_proxy: "{{ https_proxy | default ('') }}"
HTTPS_PROXY: "{{ https_proxy | default ('') }}"
no_proxy: "{{ no_proxy | default ('') }}"
NO_PROXY: "{{ no_proxy | default ('') }}"
no_log: true
- hosts:
- all
roles:
- prepare/variables
- prepare/base
- prepare/container-engine
- prepare/kubernetes
- restore
environment: "{{ proxy_env }}"