From 4616ae691d7d377c37f7b4c1e150b94858f83931 Mon Sep 17 00:00:00 2001 From: Tobias Manske Date: Fri, 26 May 2023 19:41:40 +0200 Subject: [PATCH] Add disable_template parameter --- defaults/main.yml | 1 + tasks/present.yml | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 3ddd13e..ee732d1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,3 +4,4 @@ service: dummy compose_dir: /home/core/compose state: present # or running, build, absent execute: smart # or always or never +disable_template: false diff --git a/tasks/present.yml b/tasks/present.yml index 3f6ff6c..c207213 100644 --- a/tasks/present.yml +++ b/tasks/present.yml @@ -27,7 +27,18 @@ with_filetree: "{{ service_base }}/{{ service | mandatory }}" loop_control: label: '{{ item.path }}' - when: item.state == 'file' + when: item.state == 'file' and not disable_template + - name: Copy Service Files + ansible.builtin.copy: + src: "{{ item.src }}" + dest: "{{ temp_file.path }}/{{ item.path }}" + mode: "{{ item.mode }}" + force: true + changed_when: false + with_filetree: "{{ service_base }}/{{ service | mandatory }}" + loop_control: + label: '{{ item.path }}' + when: item.state == 'file' and disable_template delegate_to: localhost check_mode: no