Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ansible/postgres] Disable PostgreSQL module not working on RHEL9 #419

Closed
EmptyByte opened this issue Oct 24, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@EmptyByte
Copy link

EmptyByte commented Oct 24, 2024

The following task works only on RHEL8, gets skipped on RHEL9

- name: Disable PostgreSQL module
  become: true
  ansible.builtin.copy:
    dest: /etc/dnf/modules.d/postgresql.module
    owner: root
    group: root
    mode: 0644
    content: |
      [postgresql]
      name=postgresql
      stream=
      profiles=
      state=disabled
  when:
    - ansible_os_family == 'RedHat'
    - ansible_distribution_major_version | int == 8

Should be:
Alternatively skip the major check and target only if pkg_mgr | lower == 'dnf' :

- name: Disable PostgreSQL module
  become: true
  ansible.builtin.copy:
    dest: /etc/dnf/modules.d/postgresql.module
    owner: root
    group: root
    mode: 0644
    content: |
      [postgresql]
      name=postgresql
      stream=
      profiles=
      state=disabled
  when: ansible_facts['distribution_major_version'] | int in [8, 9]
@chukka
Copy link
Collaborator

chukka commented Nov 18, 2024

@EmptyByte Thanks for raising this issue , Would you mind raising this as a Pull Request, Happy to take this in upcoming releases :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants