From d9d63e2e0c3c4abd5d0ed9ea69bb9569d7ba30e4 Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Thu, 19 Nov 2020 22:27:21 +0100 Subject: [PATCH] fix: preferably use module_role_path --- __tests__/test-tf-generation.yml | 2 +- tasks/deploy.yml | 2 +- tasks/load-config.yml | 2 +- tasks/main.yml | 2 +- tasks/setup.yml | 2 +- tasks/steps/generate-caddyfile-tf.yml | 2 +- tasks/steps/generate-serverconfig-tf.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/__tests__/test-tf-generation.yml b/__tests__/test-tf-generation.yml index 0093926..aaa5614 100644 --- a/__tests__/test-tf-generation.yml +++ b/__tests__/test-tf-generation.yml @@ -15,5 +15,5 @@ - name: Generate Caddyfile import_tasks: "../tasks/steps/generate-caddyfile-tf.yml" vars: - role_path: ".." + module_role_path: ".." caddy_root: "." diff --git a/tasks/deploy.yml b/tasks/deploy.yml index 3b7d606..b350202 100644 --- a/tasks/deploy.yml +++ b/tasks/deploy.yml @@ -11,5 +11,5 @@ with_items: "{{ app_config.domains }}" - name: Generate Caddy Terraform file - include_tasks: "{{ role_path }}/tasks/steps/generate-serverconfig-tf.yml" + include_tasks: "{{ module_role_path|default(role_path) }}/tasks/steps/generate-serverconfig-tf.yml" diff --git a/tasks/load-config.yml b/tasks/load-config.yml index 63da1c6..0645040 100644 --- a/tasks/load-config.yml +++ b/tasks/load-config.yml @@ -1,4 +1,4 @@ --- - include_vars: - file: "{{ role_path }}/stackhead-module.yml" + file: "{{ module_role_path|default(role_path) }}/stackhead-module.yml" name: "{{ include_varname }}" diff --git a/tasks/main.yml b/tasks/main.yml index 027468a..ee57368 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,2 +1,2 @@ --- -- include_tasks: "{{ role_path }}/tasks/{{ stackhead_action }}.yml" \ No newline at end of file +- include_tasks: "{{ module_role_path|default(role_path) }}/tasks/{{ stackhead_action }}.yml" diff --git a/tasks/setup.yml b/tasks/setup.yml index fd059ef..f4df3c2 100644 --- a/tasks/setup.yml +++ b/tasks/setup.yml @@ -12,7 +12,7 @@ vars: caddy_install_source: package - name: Overwrite Caddyfile - include_tasks: "{{ role_path }}/tasks/steps/generate-caddyfile-tf.yml" + include_tasks: "{{ module_role_path|default(role_path) }}/tasks/steps/generate-caddyfile-tf.yml" - name: Restart Caddy command: /bin/true notify: diff --git a/tasks/steps/generate-caddyfile-tf.yml b/tasks/steps/generate-caddyfile-tf.yml index 1a97fa2..ff0cdac 100644 --- a/tasks/steps/generate-caddyfile-tf.yml +++ b/tasks/steps/generate-caddyfile-tf.yml @@ -1,7 +1,7 @@ --- - block: - template: - src: "{{ role_path }}/templates/caddy/Caddyfile.j2" + src: "{{ module_role_path|default(role_path) }}/templates/caddy/Caddyfile.j2" dest: "{{ dest_file }}" - block: - slurp: src="{{ dest_file }}" diff --git a/tasks/steps/generate-serverconfig-tf.yml b/tasks/steps/generate-serverconfig-tf.yml index 0e2bbac..c2b2422 100644 --- a/tasks/steps/generate-serverconfig-tf.yml +++ b/tasks/steps/generate-serverconfig-tf.yml @@ -1,7 +1,7 @@ --- - block: - template: - src: "{{ role_path }}/templates/terraform/caddy_server.tf.j2" + src: "{{ module_role_path|default(role_path) }}/templates/terraform/caddy_server.tf.j2" dest: "{{ dest_file }}" force: true - block: