--- - name: prepare storage volume for /var/lib/prometheus when: prometheus_server_storage is defined vars: storage_volume: "{{ prometheus_server_storage | combine({'dest': '/var/lib/prometheus'}) }}" include_role: name: "storage/{{ prometheus_server_storage.type }}/volume" - name: install apt packages apt: name: prometheus state: present - name: listen on localhost only lineinfile: path: /etc/default/prometheus regexp: '^ARGS=' line: 'ARGS="--web.listen-address=127.0.0.1:9090 --storage.tsdb.retention={{ prometheus_server_retention }}"' notify: restart prometheus