Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Freifunk Luebeck
gateway-config
Commits
2ace4981
Commit
2ace4981
authored
May 16, 2022
by
Paul
Browse files
use handlers for nginx
parent
4a82ef68
Pipeline
#5426
passed with stage
in 2 minutes and 19 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
roles/services/handlers/main.yml
View file @
2ace4981
---
-
name
:
check nginx config
command
:
cmd
:
nginx -t
-
name
:
restart nginx
systemd
:
state
:
restarted
...
...
roles/services/tasks/nginx.yml
View file @
2ace4981
...
...
@@ -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
services.yml
View file @
2ace4981
...
...
@@ -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
]
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment