Merge branch 'domain_switch' into 'master'
新增域名修改模板 See merge request !91
Showing
1 changed file
with
35 additions
and
0 deletions
playbooks/domain.switch.yml
0 → 100644
1 | +--- | ||
2 | +# domain switch | ||
3 | + | ||
4 | +- hosts: localhost | ||
5 | + | ||
6 | + vars_prompt: | ||
7 | + - name: "confirmation" | ||
8 | + prompt: "Start to change . Please Enter YES to continue" | ||
9 | + private: no | ||
10 | + - name: "switch_domain" | ||
11 | + prompt: "Please input switch_domain" | ||
12 | + private: no | ||
13 | + - name: "switch_ip" | ||
14 | + prompt: "Please input switch_ip" | ||
15 | + private: no | ||
16 | + | ||
17 | + vars_files: | ||
18 | + - extra_vars/all.yml | ||
19 | + | ||
20 | + vars: | ||
21 | + qcloud_key: "{{ lookup('hashi_vault', 'secret=yoho/ops/qcloud token='+'{{vault.token}}'+' url='+'{{vault.server}}') }}" | ||
22 | + | ||
23 | + tasks: | ||
24 | + - name: "make sure user type YES to confirm" | ||
25 | + fail: | ||
26 | + msg: "user do not type YES" | ||
27 | + when: confirmation != 'YES' | ||
28 | + | ||
29 | + - name: domain switch | ||
30 | + domain_modify: | ||
31 | + secretId: "{{ qcloud_key.SecretId }}" | ||
32 | + secretKey: "{{ qcloud_key.SecretKey }}" | ||
33 | + domain_name: "{{ switch_domain }}" | ||
34 | + value: "{{ switch_ip }}" | ||
35 | + |
-
Please register or login to post a comment