computer-playbook/roles/server_docker-mailu/tasks/main.yml

54 lines
1.8 KiB
YAML

---
- name: recieve {{domain}} certificate
command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{domain}}
- name: configure {{domain}}.conf
vars:
client_max_body_size: "31M"
template: src=roles/server_native-docker-reverse-proxy/templates/domain.conf.j2 dest=/etc/nginx/conf.d/{{domain}}.conf
notify: restart nginx
- name: "create /home/administrator/server_docker-compose/mailu"
file:
path: "/home/administrator/server_docker-compose/mailu"
state: directory
mode: 0755
- name: "create /home/administrator/scripts/mailu"
file:
path: "/home/administrator/scripts/mailu"
state: directory
mode: 0755
- name: "create /etc/mailu/"
file:
path: "/etc/mailu"
state: directory
mode: 0755
- name: "create /etc/mailu/certs"
file:
path: "/etc/mailu/certs"
state: directory
mode: 0755
- name: add server_docker-compose.yml
template: src=server_docker-compose.yml.j2 dest=/home/administrator/server_docker-compose/mailu/server_docker-compose.yml
notify: recreate mailu
- name: add mailu.env
template: src=mailu.env.j2 dest=/home/administrator/server_docker-compose/mailu/mailu.env
notify: recreate mailu
- name: add deploy-letsencrypt-mailu.sh
template: src=deploy-letsencrypt-mailu.sh.j2 dest=/home/administrator/scripts/mailu/deploy-letsencrypt-mailu.sh
- name: configure deploy-letsencrypt-mailu.service
template: src=deploy-letsencrypt-mailu.service.j2 dest=/etc/systemd/system/deploy-letsencrypt-mailu.service
notify: restart deploy-letsencrypt-mailu.service
- name: configure deploy-letsencrypt-mailu.timer
template: src=deploy-letsencrypt-mailu.timer.j2 dest=/etc/systemd/system/deploy-letsencrypt-mailu.timer
notify: restart deploy-letsencrypt-mailu.timer