roles/archwiki: Plug in the maintenance role

This commit is contained in:
Giancarlo Razzolini 2019-09-24 23:03:49 -03:00
parent 4e1e317587
commit ee7a0aa054
No known key found for this signature in database
GPG key ID: F22FB1D78A77AEAB
2 changed files with 12 additions and 1 deletions

View file

@ -1,6 +1,7 @@
---
archwiki_dir: '/srv/http/archwiki'
archwiki_domain: 'wiki.archlinux.org'
archwiki_nginx_conf: '/etc/nginx/nginx.d/archwiki.conf'
archwiki_user: 'archwiki'
archwiki_repository: 'https://github.com/archlinux/archwiki.git'
archwiki_version: 'b8e35046ae4bb5e7a7bddf7f0f0f2f79f327f162'

View file

@ -1,4 +1,13 @@
---
- name: run maintenance mode
include_role:
name: maintenance
vars:
service_name: "wiki"
service_domain: "{{ archwiki_domain }}"
service_alternate_domains: []
service_nginx_conf: "{{ archwiki_nginx_conf }}"
when: maintenance is defined
- name: create ssl cert
command: certbot certonly --email webmaster@archlinux.org --agree-tos --rsa-key-size 4096 --renew-by-default --webroot -w {{ letsencrypt_validation_dir }} -d '{{ archwiki_domain }}' creates='/etc/letsencrypt/live/{{ archwiki_domain }}/fullchain.pem'
@ -15,9 +24,10 @@
file: state=directory owner="{{ archwiki_user }}" group="{{ archwiki_user }}" path="{{ archwiki_dir }}"
- name: set up nginx
template: src=nginx.d.conf.j2 dest=/etc/nginx/nginx.d/archwiki.conf owner=root group=root mode=644
template: src=nginx.d.conf.j2 dest="{{ archwiki_nginx_conf }}" owner=root group=root mode=644
notify:
- reload nginx
when: maintenance is not defined
tags: ['nginx']
- name: configure robots.txt