--- - name: Ensuring templates config directory exists file: path: "{{ node_templates_directory }}/{{ service_name }}" state: "directory" recurse: yes - name: Ensuring config directory exists file: path: "{{ node_config_directory }}/{{ service_name }}" state: "directory" - name: Copying over config(s) template: src: "{{ item.0 }}" dest: "{{ item.1 }}" with_together: - config_source - config_template_dest - name: Merging the config files and saving to the final destination merge_configs: sources: "{{ config_template_dest }}" dest: "{{ config_dest }}"