--- - name: Create container directories file: path: '{{ alertmanager_service_path }}/{{ item }}' state: 'directory' owner: 'dockremap' group: 'docker' recurse: true mode: 0750 with_items: - 'data' - 'conf/templates' - name: Create config files template: src: '{{ item }}.j2' dest: '{{ alertmanager_service_path }}/conf/{{ item }}' owner: 'dockremap' group: 'docker' mode: 0640 register: alertmanager_config with_items: - 'alertmanager.yml' - 'amtool.yml' - name: Create template file copy: src: 'custom.tmpl' dest: '{{ alertmanager_service_path }}/conf/templates/custom.tmpl' owner: 'dockremap' group: 'docker' mode: 0640