--- # Blackbox Exporter for service level monitoring - name: 'Copy the blackbox.yml config file to conf dir' template: src: 'blackbox.yml.j2' dest: '{{ monitoring_root_dir }}/blackbox.yml' mode: '0644' - name: 'Make sure the blackbox exporter container is created and running' docker_container: name: 'blackbox-exporter' image: 'prom/blackbox-exporter:v0.22.0' pull: true state: 'started' recreate: true command: '--config.file=/config/blackbox.yml' volumes: - "{{ monitoring_root_dir }}/blackbox.yml:/config/blackbox.yml" network_mode: 'host' restart_policy: unless-stopped