1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/public_html/tasks/main.yml
2020-12-26 20:21:44 +00:00

32 lines
1.2 KiB
YAML

---
- 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 '{{ public_domain }}' -d 'www.{{ public_domain }}' creates='/etc/letsencrypt/live/{{ public_domain }}/fullchain.pem'
- name: copy webroot files
copy: src=public_html dest=/srv owner=root group=root mode=0644 directory_mode=0755
- name: install public_html scripts
template: src=generate-public_html.j2 dest=/usr/local/bin/generate-public_html owner=root group=root mode=0755
- name: install public_html units
copy: src={{ item }} dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644
with_items:
- generate-public_html.timer
- generate-public_html.service
- name: start and enable public_html units
service: name={{ item }} enabled=yes state=started
with_items:
- generate-public_html.timer
- generate-public_html.service
- name: make nginx log dir
file: path=/var/log/nginx/{{ public_domain }} state=directory owner=root group=root mode=0755
- name: set up nginx
template: src=nginx.d.conf.j2 dest=/etc/nginx/nginx.d/public_html.conf owner=root group=root mode=0644
notify:
- reload nginx
tags: ['nginx']