voxpupuli / puppet-puppetboard

Puppet module to install and manage puppetboard
https://forge.puppet.com/puppet/puppetboard
Apache License 2.0
53 stars 165 forks source link

Support wsgi on python 3.8 and 3.9 on rhel8 #372

Open teluq-pbrideau opened 2 years ago

teluq-pbrideau commented 2 years ago

Pull Request (PR) description

As inspired by issue mentioned, this fix the install of wsgi for python 3.8 and 3.9 on rhel. There is no need to set to specific mod_path as the packages provides the file in httpd/modules

yum provides /usr/lib64/httpd/modules/mod_wsgi_python3.so
python3-mod_wsgi-4.6.4-4.el8.x86_64 : A WSGI interface for Python web applications in Apache
Repo        : appstream
Matched from:
Filename    : /usr/lib64/httpd/modules/mod_wsgi_python3.so

python38-mod_wsgi-4.6.8-3.module+el8.4.0+570+c2eaf144.x86_64 : A WSGI interface for Python web applications in Apache
Repo        : appstream
Matched from:
Filename    : /usr/lib64/httpd/modules/mod_wsgi_python3.so

python39-mod_wsgi-4.7.1-4.module+el8.4.0+574+843c4898.x86_64 : A WSGI interface for Python web applications in Apache
Repo        : appstream
Matched from:
Filename    : /usr/lib64/httpd/modules/mod_wsgi_python3.so

I’m not a very confident test writer, but I did my best to test the changes I made. Please suggest what could be done better if you think it is required.

This Pull Request (PR) fixes the following issues

Fixes #369

gdubicki commented 2 years ago

Hi @teluq-pbrideau, thanks for your contribution! I wanted to help as I have some experience with a similar thing from #370. Initially I pushed some changes directly to your branch - sorry for that! 😓 - but I reverted them now. I am doing my further experiments on it's copy, here https://github.com/voxpupuli/puppet-puppetboard/pull/373.

teluq-pbrideau commented 2 years ago

@gdubicki Thanks for what you tried, no problems. I did install my infrastructure with different profiles for puppetdb and postgersql on my side, so i did not notice these bugs on the puppetboard class. Maybe we should try to fix #364 and merge before merging my PR?

teluq-pbrideau commented 2 years ago

It seems to be a problem about upstream configuration about puppetdb itself. On my side, i’ve configured my infrastructure with

  package { 'postgresql-module':
    ensure      => '13',
    name        => 'postgresql',
    enable_only => true,
    provider    => 'dnfmodule',
  }
  class { 'puppetdb::database::postgresql' :
    listen_addresses    => '0.0.0.0',
    postgres_version    => '10',
    manage_package_repo => false,
    manage_server       => false,
    database_password   => $db_password.unwrap,
  }

as a weird hack that gets around installing correctly postgres

Is the upstream puppetdb module run the acceptance test on centos successfully?

gdubicki commented 2 years ago

(Yes, sorry @teluq-pbrideau, I moved your comment here.)

gdubicki commented 2 years ago

Is the upstream puppetdb module run the acceptance test on centos successfully?

No, but it's hard to tell why as the logs are gone, see https://github.com/puppetlabs/puppetlabs-puppetdb/actions/runs/2064063268 ....

But it seems that the default installed Postgres version is 11 (https://github.com/puppetlabs/puppetlabs-puppetdb/blob/main/manifests/params.pp#L29), while this package does not seem to exist for Centos / Redhat 8 as both our Ci logs say:

Error: /Stage[main]/Postgresql::Server::Install/Package[postgresql-server]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/dnf -d 0 -e 1 -y install postgresql11-server' returned 1: Error: Unable to find a match: postgresql11-server

~...as well as the Postgres docs: https://www.postgresql.org/download/linux/redhat/~ No, sorry I misunderstood this. There is Postgres 11 for RHEL/Centos 8, it's just not included in the distro.

teluq-pbrideau commented 12 months ago

~~Would it be possible to merge this PR now that the test pass successfully? At lest start again the process to review this? Thanks~~

Nevermind, just rebase from master, and test fail, I’ll work on them

kenyon commented 12 months ago

Only Ubuntu 18.04 is failing right now, which is an EOL OS, so you may remove support for that OS.

teluq-pbrideau commented 12 months ago

@kenyon I’m not sure if it is the only place, I've found references on ubuntu 18.04 in metadata.json and .sync.yml, should I change something else?

kenyon commented 12 months ago

@teluq-pbrideau you can also remove https://github.com/voxpupuli/puppet-puppetboard/blob/master/data/os/Ubuntu.16.04.yaml and https://github.com/voxpupuli/puppet-puppetboard/blob/master/data/os/Ubuntu.18.04.yaml

teluq-pbrideau commented 12 months ago

Also, I see there is no acceptance test on RHEL (only on Debian and Ubuntu) and my PR is only related to RHEL.

Would it be simple to include acceptance on Rocky also? I’ve never done these kind of tests, so not sure if I really want to go down this rabbit hole, but if it is simple to add Rocky to the mix, would you be willing to help me helping this community?

gdubicki commented 12 months ago

(...) would you be willing to help me helping this community?

I would like to but apparently I don't know how as I failed to fix the tests the last time I tried.

@kenyon ?

teluq-pbrideau commented 10 months ago

I would rather have my changes merged than to wait another year for RHEL test to be included… Could we move forward please?