aboutsummaryrefslogtreecommitdiffstats
path: root/roles/nginx/tasks/nginx.yml
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2016-04-09 23:16:19 -0400
committerbnewbold <bnewbold@robocracy.org>2016-04-09 23:16:19 -0400
commita2463bf3e8feb50a8b4d9450ec0745fa9d6b4e5e (patch)
treee057e3b252d78fa0af35eaf63a6f0875bf88bd0b /roles/nginx/tasks/nginx.yml
parent68f2a39b1494c4959d37d54f1733d169183bab38 (diff)
downloadinfra-a2463bf3e8feb50a8b4d9450ec0745fa9d6b4e5e.tar.gz
infra-a2463bf3e8feb50a8b4d9450ec0745fa9d6b4e5e.zip
nginx: first pass of live, workable nginx role
Diffstat (limited to 'roles/nginx/tasks/nginx.yml')
-rw-r--r--roles/nginx/tasks/nginx.yml39
1 files changed, 39 insertions, 0 deletions
diff --git a/roles/nginx/tasks/nginx.yml b/roles/nginx/tasks/nginx.yml
new file mode 100644
index 0000000..fdc91c8
--- /dev/null
+++ b/roles/nginx/tasks/nginx.yml
@@ -0,0 +1,39 @@
+---
+
+- name: Ensure Apache HTTP is Not Installed
+ apt: name=apache2 state=absent
+
+- name: Install nginx
+ apt: name=nginx state=present
+
+- name: Create default nginx content directory
+ file: path=/srv/http/default/www
+ state=directory
+ owner=www-data
+ group=www-data
+ mode=0775
+ recurse=yes
+
+- name: Setup default nginx pages
+ copy:
+ src: "{{item.src}}"
+ dest: "/srv/http/default/www/{{item.dest}}"
+ owner: www-data
+ group: www-data
+ force: no
+ with_items:
+ - {src: "{{ nginx_default_404 }}", dest: "404.html"}
+ - {src: "{{ nginx_default_50x }}", dest: "50x.html"}
+ - {src: "{{ nginx_default_favicon }}", dest: "favicon.png"}
+ - {src: "{{ nginx_default_index }}", dest: "index.html"}
+
+- name: Copy generic (default) nginx site configuration
+ template: src=etc_nginx_sites-available_default.j2
+ dest=/etc/nginx/sites-available/default
+
+- name: Create nginx symlink for default
+ file: state=link
+ src=/etc/nginx/sites-available/default
+ dest=/etc/nginx/sites-enabled/default
+ notify: nginx restart # reload not sufficient?
+