Showing
1 changed file
with
8 additions
and
37 deletions
1 | --- | 1 | --- |
2 | -# switch vpn/ldap | 2 | +# domain switch |
3 | 3 | ||
4 | - hosts: localhost | 4 | - hosts: localhost |
5 | 5 | ||
@@ -7,12 +7,11 @@ | @@ -7,12 +7,11 @@ | ||
7 | - name: "confirmation" | 7 | - name: "confirmation" |
8 | prompt: "Start to change . Please Enter YES to continue" | 8 | prompt: "Start to change . Please Enter YES to continue" |
9 | private: no | 9 | private: no |
10 | - - name: "switch_to_where" | ||
11 | - prompt: "Please choose master or slave: [master|slave]" | ||
12 | - default: slave | ||
13 | - private: no | ||
14 | - name: "switch_domain" | 10 | - name: "switch_domain" |
15 | - prompt: "Please choose vpn or ldap: [vpn|ldap]" | 11 | + prompt: "Please input switch_domain" |
12 | + private: no | ||
13 | + - name: "switch_ip" | ||
14 | + prompt: "Please input switch_ip" | ||
16 | private: no | 15 | private: no |
17 | 16 | ||
18 | vars_files: | 17 | vars_files: |
@@ -27,38 +26,10 @@ | @@ -27,38 +26,10 @@ | ||
27 | msg: "user do not type YES" | 26 | msg: "user do not type YES" |
28 | when: confirmation != 'YES' | 27 | when: confirmation != 'YES' |
29 | 28 | ||
30 | -# vpn switch to slave | ||
31 | - - name: domain switch to slave | 29 | + - name: domain switch |
32 | domain_modify: | 30 | domain_modify: |
33 | secretId: "{{ qcloud_key.SecretId }}" | 31 | secretId: "{{ qcloud_key.SecretId }}" |
34 | secretKey: "{{ qcloud_key.SecretKey }}" | 32 | secretKey: "{{ qcloud_key.SecretKey }}" |
35 | - domain_name: "vpn.yoho.cn" | ||
36 | - value: "106.38.39.122" | ||
37 | - when: switch_domain == 'vpn' and switch_to_where == 'slave' | 33 | + domain_name: "{{ switch_domain }}" |
34 | + value: "{{ switch_ip }}" | ||
38 | 35 | ||
39 | -# vpn switch to master | ||
40 | - - name: switch to master | ||
41 | - domain_modify: | ||
42 | - secretId: "{{ qcloud_key.SecretId }}" | ||
43 | - secretKey: "{{ qcloud_key.SecretKey }}" | ||
44 | - domain_name: "vpn.yoho.cn" | ||
45 | - value: "218.94.75.58" | ||
46 | - when: switch_domain == 'vpn' and switch_to_where == 'master' | ||
47 | - | ||
48 | -# ldap switch to slave | ||
49 | - - name: domain switch to slave | ||
50 | - domain_modify: | ||
51 | - secretId: "{{ qcloud_key.SecretId }}" | ||
52 | - secretKey: "{{ qcloud_key.SecretKey }}" | ||
53 | - domain_name: "ldap.yoho.cn" | ||
54 | - value: "106.38.39.124" | ||
55 | - when: switch_domain == 'ldap' and switch_to_where == 'slave' | ||
56 | - | ||
57 | -# ldap switch to master | ||
58 | - - name: switch to master | ||
59 | - domain_modify: | ||
60 | - secretId: "{{ qcloud_key.SecretId }}" | ||
61 | - secretKey: "{{ qcloud_key.SecretKey }}" | ||
62 | - domain_name: "ldap.yoho.cn" | ||
63 | - value: "58.213.75.179" | ||
64 | - when: switch_domain == 'ldap' and switch_to_where == 'master' |
-
Please register or login to post a comment