Authored by chunhua.zhang

修改nginx的nameserver地址,从inventory文件中获取

... ... @@ -5,7 +5,4 @@ dc : "yoho-qcloud"
path: "/Data/local/openresty-1.9.15.1"
# nameserver config for nginx
nameservers: ''
confirmation: ''
... ...
... ... @@ -18,12 +18,6 @@
when: stat_result.stat.exists == False
# make sure vaviable [nameserver] exist
- name: "make sure variable [nameservers] exists"
fail:
msg: "variable [nameservers] not exist "
when: nameservers == ''
# make sure group exists
- name: make sure groups exist in inventory file
... ... @@ -31,6 +25,7 @@
msg: "group {{ item }} not exist!"
when: item not in groups
with_items:
- nameservers
- java-nginx
- java-gateway
- java-brower
... ...
... ... @@ -30,7 +30,7 @@ http
'$http_user_agent|$upstream_addr';
# resolver: local dns servers
resolver {% for i in nameservers %} {{ i }} {% endfor %};
resolver {% for i in group['nameservers'] %} {{ i }} {% endfor %};
#General Options
... ...