Showing
1 changed file
with
12 additions
and
1 deletions
1 | --- | 1 | --- |
2 | # tasks file for openresty | 2 | # tasks file for openresty |
3 | 3 | ||
4 | +# make sure path exist | ||
4 | - stat: | 5 | - stat: |
5 | path: "{{ path }}" | 6 | path: "{{ path }}" |
6 | register: stat_result | 7 | register: stat_result |
@@ -9,9 +10,19 @@ | @@ -9,9 +10,19 @@ | ||
9 | when: stat_result.stat.exists == False | 10 | when: stat_result.stat.exists == False |
10 | 11 | ||
11 | 12 | ||
13 | +# make sure vaviable exist | ||
14 | +- name: make sure varivable exists | ||
15 | + fail: | ||
16 | + msg: "{{ item }} not exits!" | ||
17 | + when: {{item}} == '' | ||
18 | + with_items: | ||
19 | + - nameservers | ||
20 | + | ||
21 | + | ||
22 | +# make sure group exists | ||
12 | - name: make sure groups exist in inventory file | 23 | - name: make sure groups exist in inventory file |
13 | fail: | 24 | fail: |
14 | - msg: "group {{ g }} not exist!" | 25 | + msg: "group {{ item }} not exist!" |
15 | when: item not in groups | 26 | when: item not in groups |
16 | with_items: | 27 | with_items: |
17 | - java-nginx | 28 | - java-nginx |
-
Please register or login to post a comment