parent
a01479e9cb
commit
64d2994388
5 changed files with 75 additions and 67 deletions
@ -1,28 +1,24 @@ |
|||||||
--- |
--- |
||||||
|
|
||||||
# Default name of WP containers and unique ID for this instance |
# Default Docker configuration |
||||||
wp_docker_name: wp_wordpress |
wpdocker_name: wordpress |
||||||
|
wpdocker_email: technique@iptek.fr |
||||||
# Root dir of Docker |
wpdocker_root_dir: /opt/docker |
||||||
wp_docker_root_dir: /opt/docker |
wpdocker_restart: unless-stopped |
||||||
|
|
||||||
# Default Wordpress image used from Docker HUB |
# Default Wordpress configuration |
||||||
wp_docker_wp_image: wordpress-fpm:latest |
wpdocker_wp_image: wordpress-fpm:latest |
||||||
|
wpdocker_wp_port: 8080 |
||||||
# Default PHPMyAdmin image used from Docker HUB |
wpdocker_url: wp.iptek.fr |
||||||
wp_docker_pma_image: phpmyadmin:latest |
wpdocker_admin: iptek |
||||||
|
wpdocker_pass: "S3cr3t." |
||||||
# Containers will automaticly restart Website at boot |
|
||||||
wp_docker_restart: unless-stopped |
|
||||||
|
|
||||||
# Default port of Wordpress containers |
|
||||||
wp_docker_wp_port: 8080 |
|
||||||
|
|
||||||
# Default port of PHPMyAdmin containers |
|
||||||
wp_docker_pma_port: 8180 |
|
||||||
|
|
||||||
# Default DB config |
# Default DB config |
||||||
wp_docker_db_host: localhost |
wpdocker_db_host: localhost |
||||||
wp_docker_db_user: wp_wordpress |
wpdocker_db_user: wordpress |
||||||
wp_docker_db_pass: wp_wordpress |
wpdocker_db_pass: "S3cr3t." |
||||||
wp_docker_db_name: wp_wordpress |
wpdocker_db_name: wordpress |
||||||
|
|
||||||
|
# Default PHPMyAdmin configuration |
||||||
|
wpdocker_pma_image: phpmyadmin:latest |
||||||
|
wpdocker_pma_port: 8180 |
||||||
|
@ -1,29 +1,35 @@ |
|||||||
--- |
--- |
||||||
|
|
||||||
|
- name: Create main folder for configuration files |
||||||
|
file: |
||||||
|
path: "{{ wpdocker_root_dir }}/conf" |
||||||
|
state: directory |
||||||
|
owner: bin |
||||||
|
group: wheel |
||||||
|
mode: '0644' |
||||||
|
|
||||||
- name: Create folders for each containers |
- name: Create folders for each containers |
||||||
with_items: "{{ wp_docker }}" |
with_items: "{{ wpdocker }}" |
||||||
file: |
file: |
||||||
path: "{{ wp_docker_root_dir }}/{{ item.wp_docker_name }}" |
path: "{{ wpdocker_root_dir }}/conf/{{ item.wpdocker_name }}" |
||||||
state: directory |
state: directory |
||||||
owner: bin |
owner: bin |
||||||
group: wheel |
group: wheel |
||||||
mode: '0644' |
mode: '0644' |
||||||
|
|
||||||
- name: Deploy docker-compose YML file |
- name: Deploy docker-compose YML file |
||||||
with_items: "{{ wp_docker }}" |
with_items: "{{ wpdocker }}" |
||||||
template: |
template: |
||||||
src: docker-compose.yml.j2 |
src: docker-compose.j2 |
||||||
dest: "{{ wp_docker_root_dir }}/{{ item.wp_docker_name }}/docker-compose.yml" |
dest: "{{ wpdocker_root_dir }}/conf/{{ item.wpdocker_name }}/docker-compose.yml" |
||||||
owner: bin |
owner: bin |
||||||
group: wheel |
group: wheel |
||||||
mode: '0644' |
mode: '0644' |
||||||
|
|
||||||
# - name: Launch PhpMyAdmin containers |
- name: Launch containers |
||||||
# with_items: "{{ wp_docker }}" |
with_items: "{{ wpdocker }}" |
||||||
# command: "docker-compose up -d -f {{ wp_docker_root_dir }}/pma_{{ item.wp_docker_name }}/docker-compose.yml" |
command: "echo 'docker-compose -f {{ wpdocker_root_dir }}/conf/{{ item.wpdocker_name }}/docker-compose.yml up -d'" |
||||||
|
# command: "docker-compose -f {{ wpdocker_root_dir }}/conf/{{ item.wpdocker_name }}/docker-compose.yml" up -d |
||||||
# - name: Launch Wordpress containers |
|
||||||
# with_items: "{{ wp_docker }}" |
|
||||||
# command: "docker-compose up -d -f {{ wp_docker_root_dir }}/{{ item.wp_docker_name }}/docker-compose.yml" |
|
||||||
|
|
||||||
# - name: Send an welcome email message |
# - name: Send an welcome email message |
||||||
# TODO |
# TODO |
||||||
|
@ -0,0 +1,31 @@ |
|||||||
|
version: '3.1' |
||||||
|
services: |
||||||
|
wordpress-fpm: |
||||||
|
image: "{{ item.wpdocker_wp_image }}" |
||||||
|
restart: "{{ item.wpdocker_restart }}" |
||||||
|
container_name: "wp_{{ item.wpdocker_name }}" |
||||||
|
ports: |
||||||
|
- "{{ item.wpdocker_wp_port}}" |
||||||
|
environment: |
||||||
|
WORDPRESS_DB_HOST: "{{ item.wpdocker_db_host }}" |
||||||
|
WORDPRESS_DB_USER: "{{ item.wpdocker_db_user }}" |
||||||
|
WORDPRESS_DB_PASSWORD: "{{ item.wpdocker_db_pass }}" |
||||||
|
WORDPRESS_DB_NAME: "{{ item.wpdocker_db_name }}" |
||||||
|
volumes: |
||||||
|
- /opt/wp/{{ item.wpdocker_name }}/html:/var/www/html |
||||||
|
# - TODO : conf PHP |
||||||
|
# - TODO : Backups |
||||||
|
# - TODO : cron |
||||||
|
# - TODO : email |
||||||
|
phpmyadmin: |
||||||
|
image: "{{ item.wpdocker_pma_image }}" |
||||||
|
restart: "{{ item.wpdocker_restart }}" |
||||||
|
container_name: "pma_{{ item.wpdocker_name }}" |
||||||
|
ports: |
||||||
|
- "{{ item.wpdocker_pma_port}}" |
||||||
|
environment: |
||||||
|
PMA_ARBITRARY: 0 |
||||||
|
PMA_HOST: "{{ item.wpdocker_db_host }}" |
||||||
|
PMA_ABSOLUTE_URI: "db.{{ item.wpdocker_url }}" |
||||||
|
# volumes: |
||||||
|
# - TODO : conf PMA |
@ -1,31 +0,0 @@ |
|||||||
version: '3.1' |
|
||||||
|
|
||||||
services: |
|
||||||
wordpress-fpm: |
|
||||||
image: "{{ item.wp_docker_wp_image }}" |
|
||||||
restart: "{{ item.wp_docker_restart }}" |
|
||||||
container_name: "{{ item.wp_docker_name }}" |
|
||||||
ports: "{{ item.wp_docker_wp_port}}" |
|
||||||
environment: |
|
||||||
WORDPRESS_DB_HOST: "{{ item.wp_docker_db_host }}" |
|
||||||
WORDPRESS_DB_USER: "{{ item.wp_docker_db_user }}" |
|
||||||
WORDPRESS_DB_PASSWORD: "{{ item.wp_docker_db_pass }}" |
|
||||||
WORDPRESS_DB_NAME: "{{ item.wp_docker_db_name }}" |
|
||||||
volumes: |
|
||||||
- /opt/wp/"{{ item.wp_docker_name }}"/html:/var/www/html |
|
||||||
# - conf PHP |
|
||||||
# - Backups |
|
||||||
# - cron |
|
||||||
# - email |
|
||||||
|
|
||||||
phpmyadmin: |
|
||||||
image: "{{ item.wp_docker_pma_image }}" |
|
||||||
restart: "{{ item.wp_docker_restart }}" |
|
||||||
container_name: pma_"{{ item.wp_docker_name }}" |
|
||||||
ports: "{{ item.wp_docker_pma_port}}" |
|
||||||
environment: |
|
||||||
- PMA_ARBITRARY=0 |
|
||||||
- PMA_HOST: "{{ item.wp_docker_db_host }}" |
|
||||||
- PMA_ABSOLUTE_URI: db."{{ item.wp_docker_url }}" |
|
||||||
volumes: |
|
||||||
# - |
|
@ -0,0 +1,6 @@ |
|||||||
|
--- |
||||||
|
|
||||||
|
mysql_server_packages: |
||||||
|
- "{{ (mysql_engine == 'mysql') | ternary('mysql-server','mariadb-server') }}" |
||||||
|
- "{{ (mysql_engine == 'mysql') | ternary('mysql','mariadb') }}" |
||||||
|
- python3-mysql |
Loading…
Reference in new issue