From 572ee125ec0269f4b7e2b4fa65a77667c5e9366e Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 11 Aug 2022 10:00:06 +0200 Subject: [PATCH] Update to 2022-08-11 10:00 --- roles/docker_wordpress/tasks/main.yml | 75 ++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 33 deletions(-) diff --git a/roles/docker_wordpress/tasks/main.yml b/roles/docker_wordpress/tasks/main.yml index 9d05863..6950ed1 100644 --- a/roles/docker_wordpress/tasks/main.yml +++ b/roles/docker_wordpress/tasks/main.yml @@ -1,32 +1,41 @@ --- - - name: Create main folder for configuration files - file: - path: "{{ wh_docker_root_dir }}/conf" - state: directory - owner: bin - group: wheel - mode: '0644' - - - name: Create folders for each containers - with_items: "{{ wh_docker }}" - file: - path: "{{ wh_docker_root_dir }}/conf/{{ item.wh_docker_name }}" - state: directory - owner: bin - group: wheel - mode: '0644' - - - name: Deploy docker-compose YML file - with_items: "{{ wh_docker }}" - template: - src: docker-compose.j2 - dest: "{{ wh_docker_root_dir }}/conf/{{ item.wh_docker_name }}/docker-compose.yml" - owner: bin - group: wheel - mode: '0644' - - - name: Create custom PHP config file for each containers +- name: Create main folder for configuration files + file: + path: "{{ wh_docker_root_dir }}/conf" + state: directory + owner: bin + group: wheel + mode: '0644' + +- name: Create folders for each containers + with_items: "{{ wh_docker }}" + file: + path: "{{ wh_docker_root_dir }}/conf/{{ item.wh_docker_name }}" + state: directory + owner: bin + group: wheel + mode: '0644' + +- name: Deploy docker-compose YML file + with_items: "{{ wh_docker }}" + template: + src: docker-compose.j2 + dest: "{{ wh_docker_root_dir }}/conf/{{ item.wh_docker_name }}/docker-compose.yml" + owner: bin + group: wheel + mode: '0644' + + +- name: Create main folder for Wordpress files + file: + path: "{{ wh_docker_root_dir }}/wordpress" + state: directory + owner: bin + group: wheel + mode: '0644' + +- 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" @@ -35,7 +44,7 @@ group: wheel mode: '0644' - - name: Create custom CRON config file for each containers +- 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" @@ -44,12 +53,12 @@ group: wheel mode: '0644' - - name: Restart Docker - service: name=docker state=restarted +- name: Restart Docker + service: name=docker state=restarted - - name: Launch containers - with_items: "{{ wh_docker }}" - command: "docker-compose -f {{ wh_docker_root_dir }}/conf/{{ item.wh_docker_name }}/docker-compose.yml up -d" +- name: Launch containers + with_items: "{{ wh_docker }}" + command: "docker-compose -f {{ wh_docker_root_dir }}/conf/{{ item.wh_docker_name }}/docker-compose.yml up -d" # - name: Send an welcome email message # TODO