Authored by chunhua.zhang

switch java

# ask ip nginx server
# to make ssh login without key
---
- hosts: localhost
vars_files:
- extra_vars/all.yml
tasks:
- name: query config
uri:
url: "http://{{item}}/queryCloud"
headers:
Host: 'dnsresolver.yohoops.org'
with items: {{ask_nginx}}
---
# switch ufo entrance
# switch java
- hosts: localhost
vars_prompt:
- name: "confirmation"
prompt: "Start to change . Please Enter YES to continue."
prompt: "Start to change . Please Enter YES to continue"
private: no
- name: "switch_to_where"
prompt: "switch to qcloud, please enter [qq], switch to aws, enter [aws]"
prompt: "Please choose java endpoint: [qq|aws]"
default: qq
private: no
vars_files:
... ... @@ -23,6 +24,7 @@
msg: "user do not type YES"
when: confirmation != 'YES'
## switch to qq
- name: domain switch to qq
domain_modify:
secretId: "{{ qcloud_key.SecretId }}"
... ... @@ -31,18 +33,28 @@
value: "140.143.217.201"
when: switch_to_where == 'qq'
- name: ask dsa switch to qq
- name: configure ask ip nginx's cloudType = 1
uri:
secretId: "{{ qcloud_key.SecretId }}"
secretKey: "{{ qcloud_key.SecretKey }}"
domain_name: "api.yoho.cn,service.yoho.cn,union.yoho.cn,webunion.yohobuy.com"
value: "140.143.217.201"
url: "http://{{item}}/switchCloud?cloudType=1"
headers:
Host: 'dnsresolver.yohoops.org'
with_items: "{{ask_nginx}}"
when: switch_to_where == 'qq'
# switch to aws
- name: switch to aws
domain_modify:
secretId: "{{ qcloud_key.SecretId }}"
secretKey: "{{ qcloud_key.SecretKey }}"
domain_name: "2.yohobuy.com"
domain_name: "api.yoho.cn,service.yoho.cn,union.yoho.cn,webunion.yohobuy.com"
value: "java-public-lb-862332839.cn-north-1.elb.amazonaws.com.cn"
when: switch_to_where == 'aws'
- name: configure ask ip nginx's cloudType = 2
uri:
url: "http://{{item}}/switchCloud?cloudType=2"
headers:
Host: 'dnsresolver.yohoops.org'
with_items: "{{ask_nginx}}"
when: switch_to_where == 'aws'
\ No newline at end of file
... ...