summaryrefslogtreecommitdiff
path: root/roles/nginx/base/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/nginx/base/tasks/main.yml')
-rw-r--r--roles/nginx/base/tasks/main.yml31
1 files changed, 31 insertions, 0 deletions
diff --git a/roles/nginx/base/tasks/main.yml b/roles/nginx/base/tasks/main.yml
new file mode 100644
index 00000000..a975ce52
--- /dev/null
+++ b/roles/nginx/base/tasks/main.yml
@@ -0,0 +1,31 @@
+---
+- name: install nginx
+ apt:
+ name: "{{ nginx_pkg_variant }}"
+ state: present
+
+- name: remove nginx default config
+ file:
+ name: /etc/nginx/sites-enabled/default
+ state: absent
+ notify: restart nginx
+
+- name: install nginx config.d files
+ loop: "{{ nginx_conf_d_files }}"
+ copy:
+ src: "conf.d/{{ item }}.conf"
+ dest: /etc/nginx/conf.d/
+ notify: restart nginx
+
+- name: install nginx config snippets
+ loop: "{{ nginx_snippets }}"
+ copy:
+ src: "snippets/{{ item }}.conf"
+ dest: /etc/nginx/snippets/
+ notify: restart nginx
+
+- name: generate Diffie-Hellman parameters
+ openssl_dhparam:
+ path: /etc/ssl/dhparams.pem
+ size: 2048
+ notify: restart nginx