mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 23:08:06 +02:00
Refactored native-
This commit is contained in:
3
roles/homepage/meta/main.yml
Normal file
3
roles/homepage/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
dependencies:
|
||||
- https-server
|
||||
- git
|
19
roles/homepage/tasks/main.yml
Normal file
19
roles/homepage/tasks/main.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
- name: configure {{domain}}.conf
|
||||
template: src=homepage.nginx.conf.j2 dest=/etc/nginx/conf.d/{{domain}}.conf
|
||||
notify: restart nginx
|
||||
|
||||
- name: recieve {{domain}} certificate
|
||||
command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{domain}}
|
||||
|
||||
- name: homepage repo git
|
||||
git:
|
||||
repo: "{{homepage_repository_address}}"
|
||||
dest: "/usr/share/nginx/homepage"
|
||||
update: yes
|
||||
register: git_result
|
||||
ignore_errors: true
|
||||
|
||||
- name: Warn if repo is not reachable
|
||||
debug:
|
||||
msg: "Warning: Repository is not reachable."
|
||||
when: git_result.failed
|
15
roles/homepage/templates/homepage.nginx.conf.j2
Normal file
15
roles/homepage/templates/homepage.nginx.conf.j2
Normal file
@@ -0,0 +1,15 @@
|
||||
#default
|
||||
server
|
||||
{
|
||||
server_name {{domain}};
|
||||
|
||||
{% include 'roles/letsencrypt/templates/ssl_header.j2' %}
|
||||
|
||||
charset utf-8;
|
||||
|
||||
location /
|
||||
{
|
||||
root /usr/share/nginx/homepage;
|
||||
index index.html index.htm;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user