--- - name: Install prometheus-apache-exporter ansible.builtin.apt: update_cache: true name: prometheus-apache-exporter register: apt_result retries: 3 until: apt_result is succeeded - name: Make prometheus-apache-exporter listen on adm only ansible.builtin.lineinfile: path: /etc/default/prometheus-apache-exporter regexp: ^ARGS= line: | ARGS="-telemetry.address={{ adm_ipv4 }}:9117" notify: Restart prometheus-apache-exporter