|
|
---
|
|
|
# switch ldap
|
|
|
# switch vpn/ldap
|
|
|
|
|
|
- hosts: localhost
|
|
|
|
...
|
...
|
@@ -11,6 +11,9 @@ |
|
|
prompt: "Please choose master or slave: [master|slave]"
|
|
|
default: slave
|
|
|
private: no
|
|
|
- name: "switch_domain"
|
|
|
prompt: "Please choose vpn or ldap: [vpn|ldap]"
|
|
|
private: no
|
|
|
|
|
|
vars_files:
|
|
|
- extra_vars/all.yml
|
...
|
...
|
@@ -24,21 +27,38 @@ |
|
|
msg: "user do not type YES"
|
|
|
when: confirmation != 'YES'
|
|
|
|
|
|
# switch to slave
|
|
|
# vpn switch to slave
|
|
|
- name: domain switch to slave
|
|
|
domain_modify:
|
|
|
secretId: "{{ qcloud_key.SecretId }}"
|
|
|
secretKey: "{{ qcloud_key.SecretKey }}"
|
|
|
domain_name: "vpn.yoho.cn"
|
|
|
value: "106.38.39.122"
|
|
|
when: switch_domain == 'vpn' and switch_to_where == 'slave'
|
|
|
|
|
|
# vpn switch to master
|
|
|
- name: switch to master
|
|
|
domain_modify:
|
|
|
secretId: "{{ qcloud_key.SecretId }}"
|
|
|
secretKey: "{{ qcloud_key.SecretKey }}"
|
|
|
domain_name: "vpn.yoho.cn"
|
|
|
value: "218.94.75.58"
|
|
|
when: switch_domain == 'vpn' and switch_to_where == 'master'
|
|
|
|
|
|
# ldap switch to slave
|
|
|
- name: domain switch to slave
|
|
|
domain_modify:
|
|
|
secretId: "{{ qcloud_key.SecretId }}"
|
|
|
secretKey: "{{ qcloud_key.SecretKey }}"
|
|
|
domain_name: "ldap.yoho.cn"
|
|
|
value: "106.38.39.124"
|
|
|
when: switch_to_where == 'slave'
|
|
|
when: switch_domain == 'ldap' and switch_to_where == 'slave'
|
|
|
|
|
|
# switch to master
|
|
|
# ldap switch to master
|
|
|
- name: switch to master
|
|
|
domain_modify:
|
|
|
secretId: "{{ qcloud_key.SecretId }}"
|
|
|
secretKey: "{{ qcloud_key.SecretKey }}"
|
|
|
domain_name: "ldap.yoho.cn"
|
|
|
value: "58.213.75.179"
|
|
|
when: switch_to_where == 'master'
|
|
|
|
|
|
when: switch_domain == 'ldap' and switch_to_where == 'master' |
...
|
...
|
|