File tree Expand file tree Collapse file tree 4 files changed +20
-20
lines changed
Expand file tree Collapse file tree 4 files changed +20
-20
lines changed Original file line number Diff line number Diff line change 11---
22nginx_etc : " /etc/nginx/"
3+ nginx_default_root : " /usr/share/nginx/html" # Will only work for ubuntu
34nginx_max_clients : 512
45nginx_install_repo : " ubuntu" # Options: ["nginx", "ubuntu"]
56nginx_apt_state : " present" # Options: ["latest", "present"]
@@ -13,19 +14,18 @@ nginx_http_params:
1314 error_log : " /var/log/nginx/error.log"
1415
1516nginx_site :
16- - file_name : " default "
17+ - file_name : " test "
1718 blocks :
1819 - type : " server"
19- root : " /usr/share/nginx/www"
2020 index : " index.html index.htm"
2121 server_name : localhost
2222 listen : 80
2323 # # Use josn
24- location1 : {
25- name : /,
24+ location1 : {
25+ name : /,
2626 type : location,
2727 try_files : " $uri $uri/ /index.html" ,
28- root : /usr/share/nginx/www
28+ root : " {{ nginx_default_root }} "
2929 }
3030 # # Use yaml
3131 location2 :
@@ -35,4 +35,4 @@ nginx_site :
3535 autoindex : " on"
3636 allow : " 127.0.0.1"
3737 deny : " all"
38-
38+
Original file line number Diff line number Diff line change 33- name : common | Create the directories for site specific configurations
44 file :
55 path="{{nginx_etc}}/{{item}}"
6- state=directory
7- owner=root
8- group=root
6+ state=directory
7+ owner=root
8+ group=root
99 mode=0755
1010 with_items :
1111 - " sites-available"
1414- name : common | Copy the nginx default configuration file
1515 template :
1616 src=default.j2
17- dest="{{nginx_etc}}/sites-available/default.conf"
17+ dest="{{ nginx_etc }}/sites-available/default.conf"
1818
1919- name : common |Copy the nginx default site configuration file
2020 template :
2424- name : common | Create the link for site enabled specific configurations
2525 file :
2626 path="{{nginx_etc}}/sites-enabled/default"
27- state=link
27+ state=link
2828 src="{{nginx_etc}}/sites-available/default"
2929
3030- name : common | Create the configuration files for nginx
31- template :
32- src=site.j2
31+ template :
32+ src=site.j2
3333 dest="{{nginx_etc}}/sites-available/{{item.file_name}}.conf"
3434 with_items : nginx_site
3535 when : nginx_site |lower != 'none'
3939# # TODO: Add conidition to disable/enable sites
4040- name : Create the link for site enabled specific configurations
4141 file :
42- path="{{nginx_etc}}/sites-enabled/{{item.file_name}}.conf"
43- state=link
44- src="{{nginx_etc}}/sites-available/{{item.file_name}}.conf"
42+ path="{{nginx_etc}}/sites-enabled/{{item.file_name}}.conf"
43+ state=link
44+ src="{{nginx_etc}}/sites-available/{{item.file_name}}.conf"
4545 with_items : nginx_site
4646 notify :
4747 - reload nginx
5656
5757- name : common | start the nginx service
5858 service :
59- name=nginx
60- state=started
59+ name=nginx
60+ state=started
6161 enabled=yes
Original file line number Diff line number Diff line change 1212
1313- name : nginx_redhat | Copy the epel packages
1414 copy :
15- src=epel.repo
15+ src=epel.repo
1616 dest=/etc/yum.repos.d/epel_ansible.repo
1717 when : epel_release_existed.rc != 0
1818
Original file line number Diff line number Diff line change 66
77- name : nginx_smartos | Install the nginx packages
88 pkgin :
9- name="{{item}}"
9+ name="{{item}}"
1010 state=present
1111 with_items : solaris_pkg
1212
You can’t perform that action at this time.
0 commit comments