diff --git a/packer/ansible/nginx_web_proxy.yml b/packer/ansible/nginx_web_proxy.yml index 21c0deae..9f65235d 100644 --- a/packer/ansible/nginx_web_proxy.yml +++ b/packer/ansible/nginx_web_proxy.yml @@ -1,5 +1,8 @@ - hosts: all gather_facts: False become: true + vars: + proxy_server_ip: "10.0.1.12" + proxy_server_port: "8000" roles: - - nginx_web_proxy \ No newline at end of file + - nginx_web_proxy diff --git a/packer/ansible/roles/nginx_web_proxy/tasks/main.yml b/packer/ansible/roles/nginx_web_proxy/tasks/main.yml index 8cc64293..16ec157f 100644 --- a/packer/ansible/roles/nginx_web_proxy/tasks/main.yml +++ b/packer/ansible/roles/nginx_web_proxy/tasks/main.yml @@ -7,7 +7,9 @@ - name: restart splunk become: true - command: "systemctl restart SplunkForwarder" + service: + name: SplunkForwarder + state: restarted - name: restart nginx again become: true diff --git a/packer/ansible/roles/nginx_web_proxy/templates/default.conf.j2 b/packer/ansible/roles/nginx_web_proxy/templates/default.conf.j2 index 0a4d38bf..4d6362b3 100644 --- a/packer/ansible/roles/nginx_web_proxy/templates/default.conf.j2 +++ b/packer/ansible/roles/nginx_web_proxy/templates/default.conf.j2 @@ -7,7 +7,7 @@ server { location / { # root /usr/share/nginx/html; # index index.html index.htm; - proxy_pass http://{{nginx_web_proxy_host}}:{{nginx_web_proxy_port}}; + proxy_pass http://{{proxy_server_ip}}:{{proxy_server_port}}; } #error_page 404 /404.html;