Add defaults to nginx role

This commit is contained in:
Shaun Reed 2019-08-29 06:19:26 +00:00
parent 9923228e7f
commit 4e9d6e0f0f
3 changed files with 11 additions and 6 deletions

View File

@ -1,2 +1,7 @@
---
# defaults file for /etc/ansible/roles/nginx
# defaults file for /etc/ansible/roles/nginx
#
domain_name: "localhost"
nginx_root_dir: "/var/www/html/"
index_files: "index.html index.htm"

View File

@ -11,11 +11,11 @@ http {
server {
listen 80;
server_tokens off;
server_name localhost;
server_name {{ domain_name }};
location / {
root /var/www/html;
index index.html index.htm;
root {{ nginx_root_dir }};
index {{ index_files }};
}
# Uncomment to pass for SSL

View File

@ -1,7 +1,7 @@
---
- name: Copy nginx configuration file
copy: src=files/nginx.conf dest=/etc/nginx/nginx.conf
template: src=files/nginx.conf dest=/etc/nginx/nginx.conf
- name: Copy index.html file
copy: src=files/index.html dest=/var/www/html
template: src=files/index.html dest=/var/www/html
notify:
- restart nginx