jfrog / JFrog-Cloud-Installers

Template to deploy Artifactory Enterprise cluster.
Apache License 2.0
78 stars 140 forks source link

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

Closed EmptyByte closed 4 hours ago

EmptyByte commented 1 month ago

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 commented 1 week ago

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