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

Centos Nginx installation from repository error (module_hotfixes option) #263

Closed
heronimus opened this issue Jun 13, 2020 · 3 comments
Closed
Labels
enhancement Enhance/improve an existing feature
Milestone

Comments

@heronimus
Copy link
Contributor

heronimus commented Jun 13, 2020

Describe the bug
Nginx default installation from Nginx Repository (yum) on Centos 8 getting an error with current default repo files configuration. Already manual check with list available nginx\* command, and only show Nginx version 1.14.x from AppStream (centos default repo).

To reproduce
Steps to reproduce the behavior:

  1. Deploy NGINX role using playbook.yml
  2. Get below error
    TASK [ansible-role-nginx : (Install: CentOS/RedHat) Install NGINX] ****************************************************************************** fatal: [xx.xx.xx.xx]: FAILED! => {"changed": false, "failures": ["No package nginx-1.17.10-1.el8.ngx available."], "msg": "Failed to install some of the specified packages", "rc": 1, "results": []}

Expected behavior
Installed successfully

Your environment:

  • Version of the NGINX Role : 13 June 2020 / 8ef1171
  • Version of Ansible : 2.9.9
  • Target deployment platform : CentOS Linux release 8.1.1911 (Core)

Additional context

Here's the result from yum list available nginx\* command, the Nginx repo only show module package only:

NGINX Repository                                                           3.6 kB/s | 2.9 kB     00:00
Available Packages
nginx.x86_64                                       1:1.14.1-9.module_el8.0.0+184+e34fea82         AppStream
nginx-all-modules.noarch                           1:1.14.1-9.module_el8.0.0+184+e34fea82         AppStream
nginx-filesystem.noarch                            1:1.14.1-9.module_el8.0.0+184+e34fea82         AppStream
nginx-mod-http-image-filter.x86_64                 1:1.14.1-9.module_el8.0.0+184+e34fea82         AppStream
nginx-mod-http-perl.x86_64                         1:1.14.1-9.module_el8.0.0+184+e34fea82         AppStream
nginx-mod-http-xslt-filter.x86_64                  1:1.14.1-9.module_el8.0.0+184+e34fea82         AppStream
nginx-mod-mail.x86_64                              1:1.14.1-9.module_el8.0.0+184+e34fea82         AppStream
nginx-mod-stream.x86_64                            1:1.14.1-9.module_el8.0.0+184+e34fea82         AppStream
nginx-module-image-filter.x86_64                   1:1.19.0-1.el8.ngx                             nginx
nginx-module-image-filter-debuginfo.x86_64         1:1.19.0-1.el8.ngx                             nginx
nginx-module-njs.x86_64                            1:1.19.0.0.4.1-1.el8.ngx                       nginx
nginx-module-njs-debuginfo.x86_64                  1:1.19.0.0.4.1-1.el8.ngx                       nginx
nginx-module-perl.x86_64                           1:1.19.0-1.el8.ngx                             nginx
nginx-module-perl-debuginfo.x86_64                 1:1.19.0-1.el8.ngx                             nginx
nginx-module-xslt.x86_64                           1:1.19.0-1.el8.ngx                             nginx
nginx-module-xslt-debuginfo.x86_64                 1:1.19.0-1.el8.ngx      
@heronimus heronimus changed the title Centos repository error without yum module_hotfixes option Centos Nginx installation from repository error Jun 13, 2020
@heronimus
Copy link
Contributor Author

heronimus commented Jun 13, 2020

UPDATE:

I found out from http://nginx.org/en/linux_packages.html#RHEL-CentOS, that adding module_hotfixes = True option to repo files will fix the issue.

here's the new repo files:

[nginx]
baseurl = https://nginx.org/packages/mainline/centos/8/$basearch/
enabled = 1
gpgcheck = 1
name = NGINX Repository
module_hotfixes = true

Current list of available package with module_hotfixes = True now show the expected package :

NGINX Repository                                                           4.0 kB/s | 2.9 kB     00:00
Available Packages
nginx.x86_64                                       1:1.19.0-1.el8.ngx                             nginx
nginx-all-modules.noarch                           1:1.14.1-9.module_el8.0.0+184+e34fea82         AppStream
nginx-debuginfo.x86_64                             1:1.19.0-1.el8.ngx                             nginx
nginx-filesystem.noarch                            1:1.14.1-9.module_el8.0.0+184+e34fea82         AppStream
nginx-mod-http-image-filter.x86_64                 1:1.14.1-9.module_el8.0.0+184+e34fea82         AppStream
nginx-mod-http-perl.x86_64                         1:1.14.1-9.module_el8.0.0+184+e34fea82         AppStream
nginx-mod-http-xslt-filter.x86_64                  1:1.14.1-9.module_el8.0.0+184+e34fea82         AppStream
nginx-mod-mail.x86_64                              1:1.14.1-9.module_el8.0.0+184+e34fea82         AppStream
nginx-mod-stream.x86_64                            1:1.14.1-9.module_el8.0.0+184+e34fea82         AppStream
nginx-module-image-filter.x86_64                   1:1.19.0-1.el8.ngx                             nginx
nginx-module-image-filter-debuginfo.x86_64         1:1.19.0-1.el8.ngx                             nginx
nginx-module-njs.x86_64                            1:1.19.0.0.4.1-1.el8.ngx                       nginx
nginx-module-njs-debuginfo.x86_64                  1:1.19.0.0.4.1-1.el8.ngx                       nginx
nginx-module-perl.x86_64                           1:1.19.0-1.el8.ngx                             nginx
nginx-module-perl-debuginfo.x86_64                 1:1.19.0-1.el8.ngx                             nginx
nginx-module-xslt.x86_64                           1:1.19.0-1.el8.ngx                             nginx
nginx-module-xslt-debuginfo.x86_64                 1:1.19.0-1.el8.ngx                             nginx

I see that the current yum_repository module on ansible doesn't yet support module_hotfixes option, the changes still not yet merged from this PR ansible/ansible#67027. Maybe we need to add a temporary workaround by adding module_hotfixes option manually to the yum repo files?

@heronimus heronimus changed the title Centos Nginx installation from repository error Centos Nginx installation from repository error (module_hotfixes option) Jun 13, 2020
@alessfg
Copy link
Collaborator

alessfg commented Jun 15, 2020

Hm that's interesting. The molecule tests are passing and when I run dnf list available --disablerepo=* --enablerepo=nginx nginx\* on centos 8 I get

Last metadata expiration check: 0:04:18 ago on Mon 15 Jun 2020 07:10:11 PM UTC.
Available Packages
nginx.x86_64                                                            1:1.19.0-1.el8.ngx                                    nginx
nginx-debuginfo.x86_64                                                  1:1.19.0-1.el8.ngx                                    nginx
nginx-module-image-filter.x86_64                                        1:1.19.0-1.el8.ngx                                    nginx
nginx-module-image-filter-debuginfo.x86_64                              1:1.19.0-1.el8.ngx                                    nginx
nginx-module-njs.x86_64                                                 1:1.19.0.0.4.1-1.el8.ngx                              nginx
nginx-module-njs-debuginfo.x86_64                                       1:1.19.0.0.4.1-1.el8.ngx                              nginx
nginx-module-perl.x86_64                                                1:1.19.0-1.el8.ngx                                    nginx
nginx-module-perl-debuginfo.x86_64                                      1:1.19.0-1.el8.ngx                                    nginx
nginx-module-xslt.x86_64                                                1:1.19.0-1.el8.ngx                                    nginx
nginx-module-xslt-debuginfo.x86_64                                      1:1.19.0-1.el8.ngx                                    nginx

which indicates that the repo is working correctly. Could the issue have something to do with your CentOS installation? (Did you install nginx from the CentOS repository before using the role perhaps?)

That being said, I see no reason for not adding the module_hotfixes parameter to the repo configuration file. A simple lineinfile task should do the trick (PRs are always welcome 😄) until the PR you mention is merged and released (looks like it might be merged in time for Ansible 2.10).

@alessfg alessfg added the enhancement Enhance/improve an existing feature label Jun 15, 2020
@alessfg alessfg added this to the 0.15.0 milestone Jun 15, 2020
@heronimus
Copy link
Contributor Author

Yup, you're correct @alessfg. I do install Nginx from CentOS-AppStream repository on my machine before, although I already completely remove it, I found out that it makes CentOS AppStream repository marked as active streams for Nginx package, that's why Nginx package from Nginx repository are filtered out from my machine. I also already tested with a new server instance, everything was okay with fresh CentOS 8 installation.

This doc says that module_hotfixes=true is exactly to protects the repository from package filtering.

I already create PR with simple lineinfile task for this please review #264 . Thanks @alessfg !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhance/improve an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants