Skip to content

Commit

Permalink
Merge pull request #2 from singleplatform-eng/SPROD-4044_install_mana…
Browse files Browse the repository at this point in the history
…ge_blocks

install and manage blocks
  • Loading branch information
wwaltersp authored Mar 21, 2018
2 parents 3ee545c + e4f990d commit f0be63b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 23 deletions.
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ nginx_default_release: ""
# The name of the nginx apt/yum package to install.
nginx_package_name: "nginx"

#install and management controls
nginx_install: True
nginx_manage: True

nginx_user: nginx
nginx_pidfile: /var/run/nginx.pid
nginx_conf_path: /etc/nginx/conf.d
Expand Down
48 changes: 25 additions & 23 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
---
# Setup/install tasks.
- include: setup-RedHat.yml
when: ansible_os_family == 'RedHat'
when: ansible_os_family == 'RedHat' and nginx_install

- include: setup-Debian.yml
when: ansible_os_family == 'Debian'
when: ansible_os_family == 'Debian' and nginx_install

# SSL configuration
- include: ssl.yml
- block:
- name: Ensure nginx is enabled to start at boot.
service: name=nginx enabled=yes

# Vhost configuration.
- include: vhosts.yml
# SSL configuration
- include: ssl.yml

- name: Add group and other access to /etc/nginx
file:
path: /etc/nginx
mode: 'go+rx'
recurse: no
# Vhost configuration.
- include: vhosts.yml

# Nginx setup.
- name: Copy nginx configuration in place.
template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
owner: root
group: root
mode: 0644
notify:
- reload nginx
- name: Add group and other access to /etc/nginx
file:
path: /etc/nginx
mode: 'go+rx'
recurse: no

- name: Ensure nginx is started and enabled to start at boot.
service: name=nginx state=started enabled=yes
# Nginx setup.
- name: Copy nginx configuration in place.
template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
owner: root
group: root
mode: 0644
notify:
- reload nginx
when: nginx_manage

0 comments on commit f0be63b

Please sign in to comment.