2020-03-31 16:32:13 +00:00
|
|
|
- name: "Create folder {{ sites_path }}/{{ item.slug }}"
|
|
|
|
file:
|
|
|
|
path: "{{ sites_path }}/{{ item.slug }}"
|
|
|
|
state: directory
|
|
|
|
mode: '750'
|
|
|
|
|
|
|
|
- name: Render sexy Dockerfile
|
|
|
|
template:
|
|
|
|
src: Dockerfile.j2
|
|
|
|
dest: "{{ sites_path }}/{{ item.slug }}/Dockerfile"
|
|
|
|
|
|
|
|
- name: Render marvelous docker-compose.yml
|
|
|
|
template:
|
|
|
|
src: docker-compose.yml.j2
|
2020-04-01 07:41:12 +00:00
|
|
|
dest: "{{ sites_path }}/{{ item.slug }}/docker-compose.yml"
|
|
|
|
|
|
|
|
- name: Render swell nginx site config
|
|
|
|
template:
|
|
|
|
src: nginx-wordpress.j2
|
|
|
|
dest: "/etc/nginx/sites-available/{{ item.url }}"
|
2020-04-01 07:42:30 +00:00
|
|
|
become: yes
|
|
|
|
|
|
|
|
# - 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 {{ item.url }}
|
|
|
|
|
|
|
|
|
|
|
|
- name: Add user to database
|