java-nginx.yml 923 Bytes
# Last updated at 2019/01/07 14:30 by tiexin.yang@yoho.cn

# Sync and apply java nginx config file
# How to Run:
#       Use the default settings:
#               ansible-playbook -i inventories/$REGION/hosts  playbooks/java.nginx.yml
#       Apply the specified java_gateway ip addresses:
#               ansible-playbook -i inventories/aws/hosts playbooks/java-nginx.yml -e '{"java_gateway_ips":["IP_BLOCK1","IP_BLOCK2"]}'


- hosts: java-nginx
  pre_tasks:
    - shell: cat /proc/cpuinfo | grep processor | wc -l
      register: cpu_count_ret
    - set_fact:
        processor_count: "{{ cpu_count_ret.stdout }}"
  vars_prompt:
    - name: "confirmation"
      prompt: "Sync and reload java nginx. Please Enter YES to continue."
      private: no
    - name: "upstream_az"
      prompt: "Choose which az's upstream: [local|az1|aws] "
      default: 'local'
      private: no
  remote_user: root
  roles:
    - openresty