--- - block: - name: Disable default Postgres module copy: dest: /etc/dnf/modules.d/postgresql.module content: | [postgresql] name=postgresql stream= profiles= state=disabled mode: 0644 owner: root group: root - name: Install rh8 dependencies package: name: "{{ item }}" state: present loop: - python3-psycopg2 become: True become_user: root when: postgres_repository_enabled | bool