automation/deployer/roles/build/tasks/drupal.yml

65 lines
1.5 KiB
YAML
Raw Normal View History

---
- name: "Set site_data_path to {{ www_path }}/{{ site.slug }}"
set_fact: site_data_path="{{ www_path }}/{{ site.slug }}"
2020-05-05 09:08:24 +00:00
tags: always
####################
# Render templates #
####################
- name: "Create folder {{ sites_path }}/{{ site.slug }}"
2020-04-28 09:59:52 +00:00
file:
path: "{{ sites_path }}/{{ site.slug }}"
2020-04-28 09:59:52 +00:00
state: directory
mode: '750'
2020-05-01 13:40:16 +00:00
tags: [docker, nginx, mysql]
2020-04-28 09:59:52 +00:00
- name: Render sexy Dockerfile
template:
src: drupal/Dockerfile.j2
dest: "{{ sites_path }}/{{ site.slug }}/Dockerfile"
2020-04-29 15:15:49 +00:00
tags: docker
2020-04-28 09:59:52 +00:00
- name: Render marvelous docker-compose.yml
template:
src: drupal/docker-compose.yml.j2
dest: "{{ sites_path }}/{{ site.slug }}/docker-compose.yml"
2020-04-29 15:15:49 +00:00
tags: docker
2020-04-28 09:59:52 +00:00
- name: Render swell nginx site config
template:
src: drupal/nginx.j2
dest: "/etc/nginx/sites-available/{{ site.url }}"
2020-04-28 09:59:52 +00:00
become: yes
2020-04-29 15:15:49 +00:00
tags: nginx
2020-04-28 09:59:52 +00:00
2020-05-05 09:08:24 +00:00
#######################
# MySQL configuration #
#######################
2020-04-28 09:59:52 +00:00
- name: "Setup MySQL"
import_tasks: mysql.yml
2020-04-29 15:15:49 +00:00
tags: mysql
2020-05-05 09:08:24 +00:00
#################
# Setup backups #
#################
- name: "Setup backups"
import_tasks: backup.yml
tags: backup
###################
# SSL certificate #
###################
# - name: Create Let's Encrypt certificate
# This seems hard, see:
# https://docs.ansible.com/ansible/latest/modules/acme_certificate_module.html#acme-certificate-module
# https://www.digitalocean.com/community/tutorials/how-to-acquire-a-let-s-encrypt-certificate-using-ansible-on-ubuntu-18-04
# Maybe using shell directly? e.g.
# certbot certonly --webroot -w /var/www/letsencrypt -d <url>