From 7723d92a284f971e3e33cff0ace3a1979db330dc Mon Sep 17 00:00:00 2001 From: Adrien Luxey Date: Mon, 27 Apr 2020 12:23:53 +0200 Subject: [PATCH] moved wordpress build templates in subdir (tested in dummy project, should work) --- ansible/roles/build/files/Dockerfile | 10 ---------- ansible/roles/build/tasks/wordpress.yml | 6 +++--- ansible/roles/build/templates/msmtprc.j2 | 7 ------- .../build/templates/{ => wordpress}/Dockerfile.j2 | 2 +- .../templates/{ => wordpress}/docker-compose.yml.j2 | 0 .../{nginx-wordpress.j2 => wordpress/nginx.j2} | 0 6 files changed, 4 insertions(+), 21 deletions(-) delete mode 100644 ansible/roles/build/files/Dockerfile delete mode 100644 ansible/roles/build/templates/msmtprc.j2 rename ansible/roles/build/templates/{ => wordpress}/Dockerfile.j2 (90%) rename ansible/roles/build/templates/{ => wordpress}/docker-compose.yml.j2 (100%) rename ansible/roles/build/templates/{nginx-wordpress.j2 => wordpress/nginx.j2} (100%) diff --git a/ansible/roles/build/files/Dockerfile b/ansible/roles/build/files/Dockerfile deleted file mode 100644 index 061ebd0..0000000 --- a/ansible/roles/build/files/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM wordpress:apache - -RUN apt-get update; \ - apt-get install -y --no-install-recommends msmtp; \ - rm -rf /var/lib/apt/lists/* - -RUN echo "sendmail_path = /usr/sbin/msmtp -t " > /usr/local/etc/php/conf.d/sendmail.ini - -COPY ./msmtprc /etc/msmtprc - diff --git a/ansible/roles/build/tasks/wordpress.yml b/ansible/roles/build/tasks/wordpress.yml index 5566d64..be9fafa 100644 --- a/ansible/roles/build/tasks/wordpress.yml +++ b/ansible/roles/build/tasks/wordpress.yml @@ -6,17 +6,17 @@ - name: Render sexy Dockerfile template: - src: Dockerfile.j2 + src: wordpress/Dockerfile.j2 dest: "{{ sites_path }}/{{ item.slug }}/Dockerfile" - name: Render marvelous docker-compose.yml template: - src: docker-compose.yml.j2 + src: wordpress/docker-compose.yml.j2 dest: "{{ sites_path }}/{{ item.slug }}/docker-compose.yml" - name: Render swell nginx site config template: - src: nginx-wordpress.j2 + src: wordpress/nginx.j2 dest: "/etc/nginx/sites-available/{{ item.url }}" become: yes diff --git a/ansible/roles/build/templates/msmtprc.j2 b/ansible/roles/build/templates/msmtprc.j2 deleted file mode 100644 index d930c1b..0000000 --- a/ansible/roles/build/templates/msmtprc.j2 +++ /dev/null @@ -1,7 +0,0 @@ -defaults - -account default -host {{ host_ip }} -post 25 - - diff --git a/ansible/roles/build/templates/Dockerfile.j2 b/ansible/roles/build/templates/wordpress/Dockerfile.j2 similarity index 90% rename from ansible/roles/build/templates/Dockerfile.j2 rename to ansible/roles/build/templates/wordpress/Dockerfile.j2 index ce10755..4ecbbf3 100644 --- a/ansible/roles/build/templates/Dockerfile.j2 +++ b/ansible/roles/build/templates/wordpress/Dockerfile.j2 @@ -16,4 +16,4 @@ RUN echo "\ account default\n\ host {{ item.subnet_gateway_ip }}\n\ port 25\n\ -from php@{{ item.url }}" > /etc/msmtprc \ No newline at end of file +from php@{{ item.url }}\n" > /etc/msmtprc \ No newline at end of file diff --git a/ansible/roles/build/templates/docker-compose.yml.j2 b/ansible/roles/build/templates/wordpress/docker-compose.yml.j2 similarity index 100% rename from ansible/roles/build/templates/docker-compose.yml.j2 rename to ansible/roles/build/templates/wordpress/docker-compose.yml.j2 diff --git a/ansible/roles/build/templates/nginx-wordpress.j2 b/ansible/roles/build/templates/wordpress/nginx.j2 similarity index 100% rename from ansible/roles/build/templates/nginx-wordpress.j2 rename to ansible/roles/build/templates/wordpress/nginx.j2