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

Support EL 8 #44

Merged
merged 1 commit into from
Jan 13, 2020
Merged

Support EL 8 #44

merged 1 commit into from
Jan 13, 2020

Conversation

anders-larsson
Copy link
Contributor

@anders-larsson anders-larsson commented Nov 12, 2019

Add support for EL 8-based distributions. Acceptance test currently failing.

Latest git revision of beaker-docker used for EL 8 support. Fails otherwise with:
{"errorDetail":{"code":1,"message":"The command '/bin/sh -c yum install -y sudo openssh-server openssh-clients curl ntpdate' returned a non-zero code: 1"},"error":"The command '/bin/sh -c yum install -y sudo openssh-server openssh-clients curl ntpdate' returned a non-zero code: 1"}

With this change it's still failing because it tried to use service which no longer exists. Logic appears to be outside the module?

Beaker::Host::CommandFailure:
  Host 'centos-8' exited with 127 running:
   /sbin/service sshd restart
  Last 10 lines of output were:
  	bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
  	/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
  	/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
  	/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
  	bash: /sbin/service: No such file or directory

I've never used beaker before. Any suggestions are welcome. Thanks!

@anders-larsson
Copy link
Contributor Author

For reference: voxpupuli/puppet-prometheus@f3c2c68#diff-f620401c6bdf661e1275316a6e01b62f

It's working with their configuration. It appears to be map operating system + operatingsystemrelease combination in spec/spec_helper_methods.rb to different service providers.

Gemfile Outdated
@@ -30,7 +30,7 @@ gem "puppet-module-win-dev-r#{minor_version}", require: false, platform
# https://github.com/puppetlabs/pdk-templates/issues/211
gem "rake"
gem "beaker", require: false
gem "beaker-docker", require: false
gem "beaker-docker", require: false, git: 'https://github.com/puppetlabs/beaker-docker.git', branch: 'master'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not pull from master. If you need an unreleased feature, we should pull from that specific git sha and have a comment here explaining why and what is the current release so that at the next release this can be removed.

@ghoneycutt
Copy link
Owner

Those errors seem related to the package names. Perhaps they changed in EL8 and need to be patched in one of the upstream gems.

@anders-larsson
Copy link
Contributor Author

IMHO looking at the error it attempts to use service instead of systemctl.

@anders-larsson
Copy link
Contributor Author

It appears we're lucky. beaker-docker version 0.6.0 was released 8 hours ago and it now supports centos 8. I've removed the change.

Do you have any suggestions on how to ensure it uses systemctl instead of service? Thanks.

@ghoneycutt
Copy link
Owner

Hi @anders-larsson Check out that prometheus link. It mentions systemd (systemctl).

@anders-larsson anders-larsson force-pushed the support_el8 branch 2 times, most recently from c84d94c to 8f2bfbc Compare November 27, 2019 08:00
@anders-larsson
Copy link
Contributor Author

Sorry for late update.

Found the workaround for the initial issue and that initscripts is installed on the centos:8 image1. Next problem now however is that it uses chkconfig to verify the rpcbind service is enabled which fails. It does use systemctl to check whether it is running and succeeds.

This does not appear to happen in the spec tests for voxpupuli/puppet-prometheus2 where it uses systemctl is-enabled. There is nothing defining this logic in the module itself and I suspect it's logic defined elsewhere?

@ghoneycutt
Copy link
Owner

serverspec is running chkconfig which is not the right thing. If you can't find a fix for that, suggest doing a conditional such that if the platform is el8, that instead of using service in the acceptance test, you use command and run the systemctl command you would expect.

@anders-larsson anders-larsson changed the title WIP:Support EL 8 Support EL 8 Dec 9, 2019
@anders-larsson
Copy link
Contributor Author

Hi,

Sorry for yet another slow response. I couldn't sadly figure out how to fix it in any other way than adding a command as suggested. It appears to work correctly.

@anders-larsson
Copy link
Contributor Author

Hi,

@ghoneycutt would you mind having another look at this? Thanks!

@ghoneycutt
Copy link
Owner

Awesome work @anders-larsson

@ghoneycutt ghoneycutt merged commit a8aea57 into ghoneycutt:master Jan 13, 2020
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

Successfully merging this pull request may close these issues.

2 participants