automation/wordpress/ansible-playbook.yml
Adrien Luxey 34cf4db28d not much
2020-01-28 09:12:42 +01:00

45 lines
1.3 KiB
YAML

---
- hosts: localhost
# ask_pass: yes
gather_facts: no
vars:
# short site name to use as dir/file name
site_name: lexperimental
site_url: lexperimental.fr
docker_image: wordpress:apache
docker_volumes:
- "/var/www/lexperimental/wp-content/:/var/www/html/wp-content"
mysql_database: lexperimental
mysql_username: lexperimental
mysql_password: "azlhqsdh"
subnet_cidr_address: 172.100.0.0/24
subnet_gateway_ip: 172.100.0.1
subnet_site_ip: 172.100.0.2
tasks:
- name: "Create target directory {{ site_name }}"
file:
name: "{{ site_name }}"
state: directory
- name: Generate a docker-compose.yml file for our site
template:
src: templates/docker-compose.yml.j2
dest: "{{ site_name }}/docker-compose.yml"
- name: Generate a nginx config file for our site
template:
src: templates/nginx-site.conf.j2
dest: "{{ site_name }}/{{ site_url }}"
# - debug: "Do the MySQL users thingy"
#- name: Generate a new nginx server config file
#- template:
#- src: templates/nginx-site.conf.j2
#- dest: "/etc/nginx/sites-available/{{ site_url }}"
# become: yes
# - debug: "Now do `ln -s /etc/nginx/sites-available/{{ site_url }} /etc/nginx/sites-enabled/"