YanChii / ansible-role-postgres-ha

Create postgresql HA auto-failover cluster using pcs, pacemaker and PAF
Apache License 2.0
33 stars 22 forks source link

Installation on RHEL 7.4 fails #13

Closed beevelop closed 6 years ago

beevelop commented 7 years ago

Executing the role on a RHEL 7.4 system leads to dependency conflicts – something like:

Requires dependency: centos-release

This is related to the first task of postgres-ha/tasks/postgresql_sync.yml. I had a look at the repository and found a related RHEL package, that can be installed more smoothly. Replacing pgdg-centos with pgdg-redhat did resolve the installation incompatibilities:

- name: 'import pg{{ postgres_ha_pg_version | replace(".", "") }} repo'
  yum:
    name: 'https://download.postgresql.org/pub/repos/yum/{{ postgres_ha_pg_version }}/redhat/rhel-7-x86_64/pgdg-redhat{{ postgres_ha_pg_version | replace(".", "") }}-{{ postgres_ha_pg_version }}-3.noarch.rpm'
    state: installed

Is there a simple way to make this kind of differentiation in this task?

YanChii commented 7 years ago

Hi @beevelop

Yes, it can be done by matching the ansible_distribution variable. I've made the PR with changes according to your hint. Can you please test it (#14)? You can just download this updated file and see if the role works correctly now.

BTW is this the only problem you've encountered when using the role on RHEL? I didn't test it much on RHEL yet so your feedback is valuable for me.

Thank you.

Jan

YanChii commented 7 years ago

Just to be sure I'm matching the correct OS string: what prints you the following command on RHEL system? (you can replace all by a host name)

ansible -m setup all -a "filter=ansible_distribution*"

Thanks. J.

YanChii commented 6 years ago

I've re-checked the ansible_distribution naming for RHEL and my previous asumptions were correct. If you experience any other issues on RHEL, please let me know. Cheers. Jan