Commit 2ace4981 authored by Paul's avatar Paul
Browse files

use handlers for nginx

parent 4a82ef68
Pipeline #5426 passed with stage
in 2 minutes and 19 seconds
---
- name: check nginx config
command:
cmd: nginx -t
- name: restart nginx
systemd:
state: restarted
......
......@@ -16,13 +16,17 @@
creates: /etc/nginx/dhparam.pem
- name: copy snippets
notify: restart nginx
notify:
- restart nginx
- check nginx config
copy:
src: nginx/snippets
dest: /etc/nginx/
- name: copy available sites
notify: restart nginx
notify:
- restart nginx
- check nginx config
copy:
src: "{{ item }}"
dest: /etc/nginx/sites-available/
......@@ -32,31 +36,22 @@
- name: enable sites
block:
- name: remove all enabled sites
changed_when: false
file:
state: absent
path: "/etc/nginx/sites-enabled/"
- name: create enabled-sites directory
notify: restart nginx
notify:
- restart nginx
- check nginx config
file:
state: directory
path: "/etc/nginx/sites-enabled"
- name: enable selected sites
changed_when: false
notify: restart nginx
file:
state: link
src: "../sites-available/{{ item | basename }}"
dest: "/etc/nginx/sites-enabled/{{ item | basename }}"
with_fileglob: 'nginx/sites/*'
- name: check nginx config
command:
cmd: nginx -t
- name: restart nginx
systemd:
enabled: true
state: restarted
name: "{{ item }}"
with_items:
- nginx
......@@ -2,6 +2,7 @@
become: true
roles:
- ffhl_access
- services
- role: services
tags: [services]
- role: dns_auth
tags: [nameserver, nsauth]
tags: [dns_auth, nameserver, nsauth]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment