Authored by chunhua.zhang

confirm

1 - hosts: java-nginx 1 - hosts: java-nginx
  2 + vars_prompt:
  3 + - name: "confirmation"
  4 + prompt: "please confirm to sync and refresh java-nginx configuration. Type [YES] to continue"
2 remote_user: root 5 remote_user: root
3 roles: 6 roles:
4 - openresty 7 - openresty
@@ -7,3 +7,5 @@ path: "/Data/local/openresty-1.9.15.1" @@ -7,3 +7,5 @@ path: "/Data/local/openresty-1.9.15.1"
7 7
8 # nameserver config for nginx 8 # nameserver config for nginx
9 nameservers: '' 9 nameservers: ''
  10 +
  11 +confirmation: ''
1 --- 1 ---
2 # tasks file for openresty 2 # tasks file for openresty
3 3
  4 +
  5 +# make sure user type YES
  6 +- name: "make sure user type YES to confirm"
  7 + fail:
  8 + msg: "user do not type YES"
  9 + when: confirmation != 'YES'
  10 +
4 # make sure path exist 11 # make sure path exist
5 - stat: 12 - stat:
6 path: "{{ path }}" 13 path: "{{ path }}"