switch.askip.yml 770 Bytes
---
# modidy ask ip server's configuration
# anthor: chunhua.zhang
- hosts: localhost
  vars_prompt:
    - name: "confirmation"
      prompt: "Start to change . Please Enter YES to continue"
      private: no
    - name: "netType"
      prompt: "Please choose device enterpoint: 0 for Domain(api.yoho.cn) or 1 for DCDN(api-dc1-qq.yoho.cn). [0|1]"
      default: 1
      private: no
  tasks:
    - name: Query for current configuration
      uri:
       url: "http://{{item}}/queryCloud"
       return_content: yes
       status_code: 200
       body_format: json
       headers:
          Host: 'dnsresolver.yohoops.org'
      register: result
      with_items:  "{{ groups['askip-nginx'] }}"
    
    - name: print results
      debug:
      msg: result[0]