From 3b5e27be2fb8521ece2d49b23bd821afd55dda19 Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Tue, 13 Jun 2023 22:49:27 +0200 Subject: [PATCH] Improve reuse of tasks --- _ansible/roles/acme-dns/tasks/main.yml | 6 +++--- _ansible/roles/umami/tasks/main.yml | 5 +---- _ansible/tasks/deploy-common-service.yml | 4 ++++ _ansible/tasks/{ => steps}/create-service-directory.yml | 0 _ansible/tasks/{ => steps}/template-docker-compose.yml | 0 _ansible/tasks/{ => steps}/template-service-env.yml | 0 _ansible/tasks/{ => steps}/template-site-config.yml | 0 7 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 _ansible/tasks/deploy-common-service.yml rename _ansible/tasks/{ => steps}/create-service-directory.yml (100%) rename _ansible/tasks/{ => steps}/template-docker-compose.yml (100%) rename _ansible/tasks/{ => steps}/template-service-env.yml (100%) rename _ansible/tasks/{ => steps}/template-site-config.yml (100%) diff --git a/_ansible/roles/acme-dns/tasks/main.yml b/_ansible/roles/acme-dns/tasks/main.yml index 20ff8a0..fb0f2c7 100644 --- a/_ansible/roles/acme-dns/tasks/main.yml +++ b/_ansible/roles/acme-dns/tasks/main.yml @@ -2,8 +2,8 @@ - name: Deploy acme-dns tags: acme-dns block: - - import_tasks: create-service-directory.yml - - import_tasks: template-docker-compose.yml + - import_tasks: steps/create-service-directory.yml + - import_tasks: steps/template-docker-compose.yml - name: Setting the service config path ansible.builtin.set_fact: @@ -21,4 +21,4 @@ dest: "{{ (config_path, 'config.cfg') | path_join }}" mode: "0600" - - import_tasks: template-site-config.yml + - import_tasks: steps/template-site-config.yml diff --git a/_ansible/roles/umami/tasks/main.yml b/_ansible/roles/umami/tasks/main.yml index 6964ac8..3eb5229 100644 --- a/_ansible/roles/umami/tasks/main.yml +++ b/_ansible/roles/umami/tasks/main.yml @@ -4,7 +4,4 @@ - analytics - umami block: - - import_tasks: create-service-directory.yml - - import_tasks: template-docker-compose.yml - - import_tasks: template-service-env.yml - - import_tasks: template-site-config.yml + - import_tasks: deploy-common-service.yml diff --git a/_ansible/tasks/deploy-common-service.yml b/_ansible/tasks/deploy-common-service.yml new file mode 100644 index 0000000..e02647f --- /dev/null +++ b/_ansible/tasks/deploy-common-service.yml @@ -0,0 +1,4 @@ +- import_tasks: steps/create-service-directory.yml +- import_tasks: steps/template-docker-compose.yml +- import_tasks: steps/template-service-env.yml +- import_tasks: steps/template-site-config.yml diff --git a/_ansible/tasks/create-service-directory.yml b/_ansible/tasks/steps/create-service-directory.yml similarity index 100% rename from _ansible/tasks/create-service-directory.yml rename to _ansible/tasks/steps/create-service-directory.yml diff --git a/_ansible/tasks/template-docker-compose.yml b/_ansible/tasks/steps/template-docker-compose.yml similarity index 100% rename from _ansible/tasks/template-docker-compose.yml rename to _ansible/tasks/steps/template-docker-compose.yml diff --git a/_ansible/tasks/template-service-env.yml b/_ansible/tasks/steps/template-service-env.yml similarity index 100% rename from _ansible/tasks/template-service-env.yml rename to _ansible/tasks/steps/template-service-env.yml diff --git a/_ansible/tasks/template-site-config.yml b/_ansible/tasks/steps/template-site-config.yml similarity index 100% rename from _ansible/tasks/template-site-config.yml rename to _ansible/tasks/steps/template-site-config.yml