- hosts: hash tasks: - become: yes name: mkdir /etc/docker-service/prometheus file: path: /etc/docker-service/prometheus state: directory - become: yes name: cp /etc/docker-service/prometheus/prometheus.yml register: config copy: src: prometheus.yml dest: /etc/docker-service/prometheus/prometheus.yml - shell: docker kill --signal HUP prometheus when: config.changed