Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ansible-roles
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jocelyn Delalande
ansible-roles
Commits
5a142454
Commit
5a142454
authored
Jul 02, 2016
by
Jocelyn Delalande
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nginx: add a "nick" option to vhosts
To allow domains with a regex in the name.
parent
18a884a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
nginx/tasks/main.yml
nginx/tasks/main.yml
+3
-3
nginx/templates/vhost.j2
nginx/templates/vhost.j2
+2
-2
No files found.
nginx/tasks/main.yml
View file @
5a142454
...
...
@@ -16,14 +16,14 @@
-
name
:
Install vhosts settings
template
:
src
:
vhost.j2
dest
:
"
/etc/nginx/sites-available/{{
item.
domain
}}-{{
item.type
}}"
dest
:
"
/etc/nginx/sites-available/{{
item.
nick|default(item.domain)
}}-{{
item.type
}}"
with_items
:
'
{{
nginx_vhosts
}}'
notify
:
Restart nginx
-
name
:
Enable vhosts
file
:
src
:
"
/etc/nginx/sites-available/{{
item.
domain
}}-{{
item.type
}}"
dest
:
"
/etc/nginx/sites-enabled/{{
item.
domain
}}-{{
item.type
}}"
src
:
"
/etc/nginx/sites-available/{{
item.
nick|default(item.domain)
}}-{{
item.type
}}"
dest
:
"
/etc/nginx/sites-enabled/{{
item.
nick|default(item.domain)
}}-{{
item.type
}}"
state
:
link
with_items
:
'
{{
nginx_vhosts
}}'
notify
:
Restart nginx
...
...
nginx/templates/vhost.j2
View file @
5a142454
...
...
@@ -14,9 +14,9 @@ server {
ssl_certificate_key /etc/letsencrypt/live/{{ item.domain }}/privkey.pem;
{% endif %}
access_log /var/log/
{{ item.domain
}}-{{ item.type }}.access.log;
access_log /var/log/
nginx/{{ item.nick|default(item.domain)
}}-{{ item.type }}.access.log;
{% if ansible_lsb.codename != "wheezy" %}
error_log /var/log/
{{ item.domain
}}-{{ item.type }}.error.log;
error_log /var/log/
nginx/{{ item.nick|default(item.domain)
}}-{{ item.type }}.error.log;
{% endif %}
{% if item.features is defined %}
...
...
Write
Preview
Markdown
is supported
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