Skip to content

Commit 629874e

Browse files
committed
cleanup
1 parent e9597d0 commit 629874e

File tree

6 files changed

+45
-47
lines changed

6 files changed

+45
-47
lines changed

meta/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,4 @@ galaxy_info:
2222
- saucy
2323
categories:
2424
- web
25-
dependencies: []
26-
25+
dependencies: []

tasks/common.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
- name: common | Create the directories for site specific configurations
44
file:
5-
path="{{nginx_etc}}/{{item}}"
5+
path="{{ nginx_etc }}/{{ item }}"
66
state=directory
77
owner=root
88
group=root
@@ -13,49 +13,49 @@
1313

1414
- name: common | Copy the nginx default configuration file
1515
template:
16-
src=default.j2
17-
dest="{{ nginx_etc }}/sites-available/default.conf"
16+
src=default.j2
17+
dest="{{ nginx_etc }}/sites-available/default.conf"
1818

1919
- name: common |Copy the nginx default site configuration file
2020
template:
21-
src=default.j2
22-
dest="{{nginx_etc}}/sites-available/default"
21+
src=default.j2
22+
dest="{{ nginx_etc }}/sites-available/default"
2323

2424
- name: common | Create the link for site enabled specific configurations
2525
file:
26-
path="{{nginx_etc}}/sites-enabled/default"
27-
state=link
28-
src="{{nginx_etc}}/sites-available/default"
26+
path="{{ nginx_etc }}/sites-enabled/default"
27+
state=link
28+
src="{{ nginx_etc }}/sites-available/default"
2929

3030
- name: common | Create the configuration files for nginx
3131
template:
32-
src=site.j2
33-
dest="{{nginx_etc}}/sites-available/{{item.file_name}}.conf"
32+
src=site.j2
33+
dest="{{ nginx_etc }}/sites-available/{{ item.file_name }}.conf"
3434
with_items: nginx_site
35-
when: nginx_site |lower != 'none'
35+
when: nginx_site | lower != 'none'
3636
notify:
37-
- reload nginx
37+
- check reload nginx
3838

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"
42+
path="{{ nginx_etc }}/sites-enabled/{{ item.file_name }}.conf"
4343
state=link
44-
src="{{nginx_etc}}/sites-available/{{item.file_name}}.conf"
44+
src="{{ nginx_etc }}/sites-available/{{ item.file_name }}.conf"
4545
with_items: nginx_site
4646
notify:
47-
- reload nginx
47+
- check reload nginx
4848

4949
- name: common | Copy the nginx main configuration file
5050
template:
51-
src=nginx.conf.j2
52-
dest="{{nginx_etc}}/nginx.conf"
53-
validate='nginx -t -c %s'
51+
src=nginx.conf.j2
52+
dest="{{ nginx_etc }}/nginx.conf"
53+
validate='nginx -t -c %s'
5454
notify:
55-
- restart nginx
55+
- check restart nginx
5656

5757
- name: common | start the nginx service
5858
service:
59-
name=nginx
60-
state=started
61-
enabled=yes
59+
name=nginx
60+
state=started
61+
enabled=yes

tasks/nginx_smartos.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22

33
- name: nginx_smartos | Set etc nginx
4-
set_fact:
5-
nginx_etc : "/opt/local/etc/nginx"
4+
set_fact :
5+
nginx_etc : "/opt/local/etc/nginx"
66

77
- name: nginx_smartos | Install the nginx packages
88
pkgin:
9-
name="{{item}}"
10-
state=present
9+
name="{{ item }}"
10+
state=present
1111
with_items: solaris_pkg
1212

1313
- name: common | Create the conf.d
1414
file:
15-
path="{{nginx_etc}}/conf.d"
16-
state=directory
17-
owner=root
18-
group=root
15+
path="{{ nginx_etc }}/conf.d"
16+
state=directory
17+
owner=root
18+
group=root
1919
mode=0755

templates/nginx.conf.j2

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#{{ ansible_managed }}
22
{% if ansible_os_family == 'RedHat' %}
3-
user nginx;
3+
user nginx;
44
{% elif ansible_os_family == 'Debian' %}
5-
user www-data;
5+
user www-data;
66
{% elif ansible_os_family == 'Solaris' %}
7-
user www www;
7+
user www www;
88
{% endif %}
99

1010
worker_processes {{ ansible_processor_count }};
11-
pid /var/run/nginx.pid;
11+
pid /var/run/nginx.pid;
1212

1313
{% if nginx_extra_global_vars is defined %}
1414
# Extra global vars for Nginx
@@ -22,15 +22,15 @@ events {
2222
}
2323

2424
http {
25-
include {{nginx_etc}}/mime.types;
26-
default_type application/octet-stream;
25+
include {{ nginx_etc }}/mime.types;
26+
default_type application/octet-stream;
2727
{% for k,v in nginx_http_params.iteritems() %}
28-
{{ k }} {{ v }};
28+
{{ k }} {{ v }};
2929
{% endfor %}
30-
#sendfile on;
31-
gzip on;
32-
gzip_disable "msie6";
30+
#sendfile on;
31+
gzip on;
32+
gzip_disable "msie6";
3333

34-
include {{nginx_etc}}/conf.d/*.conf;
35-
include {{nginx_etc}}/sites-enabled/*;
34+
include {{ nginx_etc }}/conf.d/*.conf;
35+
include {{ nginx_etc }}/sites-enabled/*;
3636
}

templates/site.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
##{{ansible_managed}}
1+
##{{ ansible_managed }}
22
{% for block in item.blocks %}
33
{# First level block #}
44
{{block.type}} {{ block.name if block.name is defined else "" }} {

vars/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ env:
44
RUNLEVEL: 1
55

66
redhat_pkg:
7+
- python-selinux
78
- nginx
89

910
ubuntu_pkg:
10-
- python-selinux
1111
- nginx
1212

1313
solaris_pkg:
1414
- nginx
15-

0 commit comments

Comments
 (0)