--- - name: Install prometheus repository ansible.builtin.yum_repository: name: "{{ item.name }}" description: "{{ item.description }}" file: "{{ item.file }}" baseurl: "{{ item.baseurl }}" gpgcheck: "{{ item.gpgcheck | default('no') }}" enabled: "{{ item.enabled | default('yes') }}" repo_gpgcheck: "{{ item.repo_gpgcheck | default('no') }}" gpgkey: "{{ item.gpgkey | default('omit') }}" loop: "{{ postgres_exporter_rpm_repository }}" - name: Ensure {{ postgres_exporter_package }} version {{ postgres_exporter_version }} installed dnf: name: "{{ postgres_exporter_package }}" state: present - name: Enable and start {{ postgres_exporter_unit_name }} systemd: name: "{{ postgres_exporter_unit_name }}" state: started enabled: yes masked: no daemon_reload: yes