From 7d3e6ba0880c0889ecc9de5fe48910dcd8f3a8c5 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 10 Aug 2022 18:00:16 +0200 Subject: [PATCH] Update to 2022-08-10 18:00 --- roles/docker_wordpress/defaults/main.yml | 4 ++-- roles/docker_wordpress/tasks/main.yml | 20 +++++++++++++++++++- roles/docker_wordpress/templates/docker-compose.j2 | 14 ++++++-------- .../templates/{welcome.txt.j2 => welcome.j2} | 0 4 files changed, 27 insertions(+), 11 deletions(-) rename roles/docker_wordpress/templates/{welcome.txt.j2 => welcome.j2} (100%) diff --git a/roles/docker_wordpress/defaults/main.yml b/roles/docker_wordpress/defaults/main.yml index 192793b..4b68869 100644 --- a/roles/docker_wordpress/defaults/main.yml +++ b/roles/docker_wordpress/defaults/main.yml @@ -8,8 +8,8 @@ wh_docker_root_dir: /opt/docker # Default Wordpress configuration wh_docker_wp_image: wordpress:6.0.1-php8.1-fpm wh_docker_wp_port: 8080 -wh_docker_url: wp.iptek.fr -wh_docker_admin: iptek +wh_docker_url: wordpress.org +wh_docker_admin: admin wh_docker_pass: "S3cr3t." # Default DB config diff --git a/roles/docker_wordpress/tasks/main.yml b/roles/docker_wordpress/tasks/main.yml index 4024f55..80573ca 100644 --- a/roles/docker_wordpress/tasks/main.yml +++ b/roles/docker_wordpress/tasks/main.yml @@ -26,7 +26,25 @@ group: wheel mode: '0644' - - name: Restart Docker # Unfortunately, this is necessary, we need to improve the functioning of iptable before + - name: Create custom PHP config file for each containers + with_items: "{{ wh_docker }}" + file: + path: "{{ wh_docker_root_dir }}/wordpress/{{ item.wh_docker_name }}/custom.ini" + state: touch + owner: bin + group: wheel + mode: '0644' + + - name: Create custom CRON config file for each containers + with_items: "{{ wh_docker }}" + file: + path: "{{ wh_docker_root_dir }}/wordpress/{{ item.wh_docker_name }}/custom_cron" + state: touch + owner: bin + group: wheel + mode: '0644' + + - name: Restart Docker service: name=docker state=restarted - name: Launch containers diff --git a/roles/docker_wordpress/templates/docker-compose.j2 b/roles/docker_wordpress/templates/docker-compose.j2 index 4468bcd..d6cf1df 100644 --- a/roles/docker_wordpress/templates/docker-compose.j2 +++ b/roles/docker_wordpress/templates/docker-compose.j2 @@ -5,28 +5,26 @@ services: restart: unless-stopped container_name: "wp_{{ item.wh_docker_name }}" ports: - - "{{ item.wh_docker_wp_port}}" + - "{{ item.wh_docker_wp_port}}":80 environment: WORDPRESS_DB_HOST: "{{ item.wh_docker_db_host }}" WORDPRESS_DB_USER: "{{ item.wh_docker_db_user }}" WORDPRESS_DB_PASSWORD: "{{ item.wh_docker_db_pass }}" WORDPRESS_DB_NAME: "{{ item.wh_docker_db_name }}" volumes: - - /opt/wp/{{ item.wh_docker_name }}/html:/var/www/html -# - TODO : conf PHP -# - TODO : Backups -# - TODO : cron + - /opt/wordpress/{{ item.wh_docker_name }}/html:/var/www/html # Wordpress + - /opt/wordpress/{{ item.wh_docker_name }}/custom.ini:/usr/local/etc/php/conf.d/custom.ini # Custom PHP configuration + - /opt/wordpress/{{ item.wh_docker_name }}/custom_cron:/usr/local/etc/php/conf.d/custom_cron # Custom CRON configuration # - TODO : email +# - TODO : Backups phpmyadmin: image: "{{ item.wh_docker_pma_image }}" restart: unless-stopped container_name: "pma_{{ item.wh_docker_name }}" ports: - - "{{ item.wh_docker_pma_port}}" + - "{{ item.wh_docker_pma_port}}":80 environment: PMA_ARBITRARY: 0 PMA_HOST: "{{ item.wh_docker_db_host }}" PMA_ABSOLUTE_URI: "db.{{ item.wh_docker_url }}" -# volumes: -# - TODO : conf PMA diff --git a/roles/docker_wordpress/templates/welcome.txt.j2 b/roles/docker_wordpress/templates/welcome.j2 similarity index 100% rename from roles/docker_wordpress/templates/welcome.txt.j2 rename to roles/docker_wordpress/templates/welcome.j2