Authored by chunhua.zhang

switch java

1 -# ask ip nginx server  
2 -# to make ssh login without key  
3 ----  
4 -- hosts: localhost  
5 - vars_files:  
6 - - extra_vars/all.yml  
7 - tasks:  
8 - - name: query config  
9 - uri:  
10 - url: "http://{{item}}/queryCloud"  
11 - headers:  
12 - Host: 'dnsresolver.yohoops.org'  
13 - with items: {{ask_nginx}}  
14 -  
15 -  
1 --- 1 ---
2 -# switch ufo entrance 2 +# switch java
3 3
4 - hosts: localhost 4 - hosts: localhost
5 5
6 vars_prompt: 6 vars_prompt:
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" 10 - name: "switch_to_where"
11 - prompt: "switch to qcloud, please enter [qq], switch to aws, enter [aws]" 11 + prompt: "Please choose java endpoint: [qq|aws]"
  12 + default: qq
12 private: no 13 private: no
13 14
14 vars_files: 15 vars_files:
@@ -23,6 +24,7 @@ @@ -23,6 +24,7 @@
23 msg: "user do not type YES" 24 msg: "user do not type YES"
24 when: confirmation != 'YES' 25 when: confirmation != 'YES'
25 26
  27 +## switch to qq
26 - name: domain switch to qq 28 - name: domain switch to qq
27 domain_modify: 29 domain_modify:
28 secretId: "{{ qcloud_key.SecretId }}" 30 secretId: "{{ qcloud_key.SecretId }}"
@@ -31,18 +33,28 @@ @@ -31,18 +33,28 @@
31 value: "140.143.217.201" 33 value: "140.143.217.201"
32 when: switch_to_where == 'qq' 34 when: switch_to_where == 'qq'
33 35
34 - - name: ask dsa switch to qq 36 + - name: configure ask ip nginx's cloudType = 1
35 uri: 37 uri:
36 - secretId: "{{ qcloud_key.SecretId }}"  
37 - secretKey: "{{ qcloud_key.SecretKey }}"  
38 - domain_name: "api.yoho.cn,service.yoho.cn,union.yoho.cn,webunion.yohobuy.com"  
39 - value: "140.143.217.201" 38 + url: "http://{{item}}/switchCloud?cloudType=1"
  39 + headers:
  40 + Host: 'dnsresolver.yohoops.org'
  41 + with_items: "{{ask_nginx}}"
40 when: switch_to_where == 'qq' 42 when: switch_to_where == 'qq'
  43 +
41 44
  45 +# switch to aws
42 - name: switch to aws 46 - name: switch to aws
43 domain_modify: 47 domain_modify:
44 secretId: "{{ qcloud_key.SecretId }}" 48 secretId: "{{ qcloud_key.SecretId }}"
45 secretKey: "{{ qcloud_key.SecretKey }}" 49 secretKey: "{{ qcloud_key.SecretKey }}"
46 - domain_name: "2.yohobuy.com" 50 + domain_name: "api.yoho.cn,service.yoho.cn,union.yoho.cn,webunion.yohobuy.com"
47 value: "java-public-lb-862332839.cn-north-1.elb.amazonaws.com.cn" 51 value: "java-public-lb-862332839.cn-north-1.elb.amazonaws.com.cn"
  52 + when: switch_to_where == 'aws'
  53 +
  54 + - name: configure ask ip nginx's cloudType = 2
  55 + uri:
  56 + url: "http://{{item}}/switchCloud?cloudType=2"
  57 + headers:
  58 + Host: 'dnsresolver.yohoops.org'
  59 + with_items: "{{ask_nginx}}"
48 when: switch_to_where == 'aws' 60 when: switch_to_where == 'aws'