galaxyproject / ansible-postgresql

An Ansible role for managing a PostgreSQL server
https://galaxy.ansible.com/galaxyproject/postgresql
122 stars 58 forks source link

yum or pgdg option? #34

Closed MichaelDBA closed 2 months ago

MichaelDBA commented 2 years ago

Right now it seems the flexible apt and pgdg options are available for debian apt-based systems, but not for redhat based ones. Any plan to fix this? Or is this related to the mirror problem,

redhat.yml file contents snippet:

# Not supported (and no good workaround) until there is a solution for https://github.com/ansible/ansible/issues/41178
# - name: Ensure that only the desired PostgreSQL version's repo is enabled
#   yum_repository:
#     name: item.repoid
#     enabled: "{{ (item.repoid == 'pgdg' ~ __postgresql_version_dotless) if item.repoid.startswith('pgdg') else item.state == 'enabled' }}"
#   # "{{ __postgresql_yum_repolist_result.results | selectattr('repoid', 'startswith', 'pgdg') | list }}" would be nice
#   # here but alas there is no `startswith` test
#   loop: "{{ __postgresql_yum_repolist_result.results }}"
MichaelDBA commented 2 years ago

Is this repo being maintained?

hlovdal commented 2 months ago

Well, the repo file is just a text file in ini format, so I do not see anything preventing to use ansible.builtin.lineinfile or community.general.ini_file to modify the line with enabled=... instead.