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

Could not enable "PowerTools repository" on RHEL8 #298

Closed
SomeAverageDev opened this issue Apr 5, 2023 · 6 comments
Closed

Could not enable "PowerTools repository" on RHEL8 #298

SomeAverageDev opened this issue Apr 5, 2023 · 6 comments

Comments

@SomeAverageDev
Copy link

Hello,
First, thank you for this great playbook !

I have an issue while running the latest playbook version, on repositories tasks.

    # PowerTools repository (to install dependencies for postgresql<version>-devel package)
    - name: Enable PowerTools repository
      command: dnf config-manager --set-enabled "[Pp]ower[Tt]ools"
      when:
        - ansible_distribution_major_version is version('8', '==')
        - ansible_distribution != "OracleLinux"

The power tools repo is not declared on the RHEL8 server (we are using internal Satellite, it could come from that also, I will try to check with my colleagues)

Please find the task log below:

TASK [add-repository : Enable PowerTools repository] ***********************************************************************************************************************************************************************************************************************************************************
fatal: [x.x.x.]: FAILED! => {"changed": true, "cmd": ["dnf", "config-manager", "--set-enabled", "[Pp]ower[Tt]ools"], "delta": "0:00:00.787755", "end": "2023-04-05 17:46:40.373527", "msg": "non-zero return code", "rc": 1, "start": "2023-04-05 17:46:39.585772", "stderr": "Error: No matching repo to modify: [Pp]ower[Tt]ools.", "stderr_lines": ["Error: No matching repo to modify: [Pp]ower[Tt]ools."], "stdout": "Updating Subscription Management repositories.", "stdout_lines": ["Updating Subscription Management repositories."]}

This repo does not look necessary though in my installation context... don't really know if I need it.

@vitabaks
Copy link
Owner

vitabaks commented Apr 6, 2023

Hello @SomeAverageDev

This repo does not look necessary though in my installation context... don't really know if I need it.

This repository is required to install dependencies for the postgresql<version>-devel package

we are using internal Satellite, it could come from that also, I will try to check with my colleagues

In our case, maybe you just need to comment out this task.

I, in turn, will add variables to be able to choose (add repositories or not).

@SomeAverageDev
Copy link
Author

Hello,
thanks for you answer, I checked a little bit further, and the package "PowerTools" does not exist for RHEL, but it is named
codeready-builder-for-rhel-8-x86_64-rpms

RHEL recommandation is to enable the related repo:
sudo subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms

I don't think it is necessary at all on RHEL8 for this use case... I did not find any dependency in my "type A" installation
same thing for system "devel" packages, I don't think they are necessary until using sources packages.

@vitabaks
Copy link
Owner

vitabaks commented Apr 7, 2023

It is possible that all the necessary dependencies for the postgresql-devel package are already present in the main repository and indeed the rest of the repositories are no longer needed. There was an error earlier because there were no dependent packages.

Have you tried testing without installing these repositories? Unfortunately, I don't have an RHEL subscription to run the tests. Instead, I use CentOS/RockLinux for tests.

@vitabaks
Copy link
Owner

vitabaks commented Apr 7, 2023

For RHEL based distributions, the tests are successful (with PowerTools repository):

TASK [Include OS-specific variables] *******************************************
  ok: [10.172.0.20]
  ok: [10.172.0.21]
  ok: [10.172.0.22]
  
  TASK [add-repository : Remove epel-release package (if exists)] ****************
  changed: [10.172.0.21]
  changed: [10.172.0.20]
  changed: [10.172.0.22]
  
  TASK [add-repository : Get epel-release-latest rpm package] ********************
  changed: [10.172.0.20]
  changed: [10.172.0.21]
  changed: [10.172.0.22]
  
  TASK [add-repository : Install EPEL repository] ********************************
  changed: [10.172.0.20]
  changed: [10.172.0.22]
  changed: [10.172.0.21]
  
  TASK [add-repository : Enable PowerTools repository] ***************************
  changed: [10.172.0.20]
  changed: [10.172.0.22]
  changed: [10.172.0.21]
  
  TASK [add-repository : Get pgdg-redhat-repo-latest.noarch.rpm] *****************
  changed: [10.172.0.21]
  changed: [10.172.0.22]
  changed: [10.172.0.20]
  
  TASK [add-repository : Install PostgreSQL repository] **************************
  changed: [10.172.0.20]
  changed: [10.172.0.21]
  changed: [10.172.0.22]
  
  TASK [packages : Clean dnf cache] **********************************************
  changed: [10.172.0.20]
  changed: [10.172.0.21]
  changed: [10.172.0.22]

@Daisho2000
Copy link

Daisho2000 commented May 2, 2023

Hi,

Same problem here:

TASK [add-repository : Enable PowerTools repository] *******************************************************************************************************************************
fatal: [192.168.10.140]: FAILED! => {"changed": true, "cmd": ["dnf", "config-manager", "--set-enabled", "[Pp]ower[Tt]ools"], "delta": "0:00:02.711181", "end": "2023-05-02 09:35:45.864593", "msg": "non-zero return code", "rc": 1, "start": "2023-05-02 09:35:43.153412", "stderr": "Error: No matching repo to modify: [Pp]ower[Tt]ools.", "stderr_lines": ["Error: No matching repo to modify: [Pp]ower[Tt]ools."], "stdout": "Updating Subscription Management repositories.", "stdout_lines": ["Updating Subscription Management repositories."]}
fatal: [192.168.10.138]: FAILED! => {"changed": true, "cmd": ["dnf", "config-manager", "--set-enabled", "[Pp]ower[Tt]ools"], "delta": "0:00:02.788565", "end": "2023-05-02 09:35:45.914416", "msg": "non-zero return code", "rc": 1, "start": "2023-05-02 09:35:43.125851", "stderr": "Error: No matching repo to modify: [Pp]ower[Tt]ools.", "stderr_lines": ["Error: No matching repo to modify: [Pp]ower[Tt]ools."], "stdout": "Updating Subscription Management repositories.", "stdout_lines": ["Updating Subscription Management repositories."]}
fatal: [192.168.10.141]: FAILED! => {"changed": true, "cmd": ["dnf", "config-manager", "--set-enabled", "[Pp]ower[Tt]ools"], "delta": "0:00:02.766759", "end": "2023-05-02 09:35:45.979188", "msg": "non-zero return code", "rc": 1, "start": "2023-05-02 09:35:43.212429", "stderr": "Error: No matching repo to modify: [Pp]ower[Tt]ools.", "stderr_lines": ["Error: No matching repo to modify: [Pp]ower[Tt]ools."], "stdout": "Updating Subscription Management repositories.", "stdout_lines": ["Updating Subscription Management repositories."]}

And I have commented the postgres line in vars/RedHat.yml like this:

postgresql_packages:

  • postgresql{{ postgresql_version_terse }}
  • postgresql{{ postgresql_version_terse }}-server
  • postgresql{{ postgresql_version_terse }}-contrib
    (pound) - postgresql{{ postgresql_version_terse }}-devel
    (pound) - pg_repack{{ postgresql_version_terse }}

Would you be so kind to point me in the right direction?

Thank you very much! (And thx for the superb playbook: it rocks!)

P.S.

If I substitute the correspondent line with subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms - as SomeAverageDev suggested - all works fine.

@vitabaks
Copy link
Owner

Fix here #443

@vitabaks vitabaks removed the wontfix This will not be worked on label Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants