-
-
Notifications
You must be signed in to change notification settings - Fork 498
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
CLI Environment Fixes #876
CLI Environment Fixes #876
Conversation
merging master
CHANGELOG.md
Outdated
|
||
- Updated the environment to unclude LANG and LC_ALL vairables to fix issues with trying to run with the incorrect encoding | ||
- Fixed issues with when managing repos the Erlang repo was not managed and the required version was not available in EPEL | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn’t be edited in a PR - it would be generated with a release (same with metadata)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah i didn't realize. I reverted the changes!
manifests/repo/rhel.pp
Outdated
@@ -14,6 +15,17 @@ | |||
gpgcheck => 1, | |||
} | |||
|
|||
# This is required because when using the latest version of rabbitmq because the latest version in EPEL | |||
# for Erlang is 22.0.7 which is not compatible: https://www.rabbitmq.com/which-erlang.html | |||
yumrepo { 'erlang': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Historically, the module is setup in such a way that Erlang configuration is out of the module’s scope. There have been some proposals to fix puppet-erlang, but I think any fix along these lines would have to be made in that module and then update that dependency here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally I would agree except this is a version of Erlang packaged and maintained by RabbitMQ https://www.rabbitmq.com/which-erlang.html#erlang-repositories so i think that it makes sense to have it in here only when managing the repos and downloading from their package cloud.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue would be if users also need a competing (but compatible) erlang version on the same machine. Also, adding this here only would be inconsistent with how the module works on other OSes / distros. However, if https://github.com/voxpupuli/puppet-erlang gets released finally, it could be made a dependency or a recommended install, and the issue could be solved that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the current behavior, the module is also not (by default) using the official rabbitmq packages either, tho there have been some proposals to switch that to being the default.
most of them have gotten stuck on similar issues around the Erlang dependency issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add the same code for the other OS's to make it consistent, that definitely makes sense. We could also add second variable to manage this repo if you think that may be a better option?
When using RHEL 8 with out this addition made the module unusable. So I definitely think having this in here even if it is optional would be a good add. Especially since https://github.com/voxpupuli/puppet-erlang isn't released yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's pretty much always been the case with this module that the user has to satisfy the Erlang dependency themself, I think. It could potentially be documented better, but IMO, it's better if that's done through a separate module vs. a parameter in this one.
Keep in mind that the module doesn't list support for RHEL 8 yet. #842 was @nmaludy's WIP working on adding support for it, which has some good discussion about these points.
I think if we
a) make the module default to using the rabbitmq package vs. OS vendor's default as the default again (as a breaking / major change; essentially toggling the value for repos_ensure
)
b) get @nmaludy's puppet-erlang actually building and released and use it in the integration tests + recommend that users use it to manage erlang installation
that can work.
That said, so far, haven't seen anyone follow through with getting all this done in a way that works, passes tests, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, could there be issues with the newer erlang if older versions of rabbitmq were chosen?
lib/puppet/provider/rabbitmq_cli.rb
Outdated
@@ -25,7 +25,7 @@ def self.append_to_path(dir) | |||
|
|||
def self.home_tmp_command(name, path) | |||
has_command name, path do | |||
environment HOME: '/tmp' | |||
environment HOME: '/tmp', LANG: 'en_US.UTF-8', LC_ALL: 'en_US.UTF-8' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, this should already be set for most use cases via
puppet-rabbitmq/data/common.yaml
Lines 82 to 83 in dfd7607
rabbitmq::environment_variables: | |
'LC_ALL': 'en_US.UTF-8' |
I'm not 100% sure that that applies to commands run in the provider, but I think it should; I know there have been some previous fixes around this error.
Since environment_variables
is a parameter already, maybe the right fix here is to somehow either add HOME
to defaults or merge the defaults with the environment for the CLI here?
Either way, I think the environment fix here should probably be a separate PR, as it's a narrower fix that we should be able to merge quickly, and likely affects other OSes besides RHEL.
Did you confirm that both LANG
and LC_ALL
were necessary? LC_ALL
has worked in the past and is the somewhat narrower fix.
I made the requested changes to the variables and the erlang repo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the PR title / commit message to clarify that it's an environment fix vs. a RHEL fix?
metadata.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "puppet-rabbitmq", | |||
"version": "11.0.1-rc0", | |||
"version": "11.0.2-rc0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldn't be adjusted in here. it will get bumped with a release.
Removed metadata tag and fix the title and message. |
Fixes issue where the local encoding is not correct by adding the correct LC_ALL values to the environment.
- Add support for oom_score_adj (voxpupuli#877) - CLI Environment Fixes (voxpupuli#876) - make sure the rabbitmq_version method actually returns the version (voxpupuli#874) - Use mocked facts in tests (voxpupuli#873)
- Add support for oom_score_adj (voxpupuli#877) - CLI Environment Fixes (voxpupuli#876) - make sure the rabbitmq_version method actually returns the version (voxpupuli#874) - Use mocked facts in tests (voxpupuli#873) - Enable Puppet 7 support (voxpupuli#881)
- Add support for oom_score_adj (voxpupuli#877) - CLI Environment Fixes (voxpupuli#876) - make sure the rabbitmq_version method actually returns the version (voxpupuli#874) - Use mocked facts in tests (voxpupuli#873) - Enable Puppet 7 support (voxpupuli#881) - Add auto cluster configuration support (voxpupuli#883)
- Add support for oom_score_adj (voxpupuli#877) - CLI Environment Fixes (voxpupuli#876) - make sure the rabbitmq_version method actually returns the version (voxpupuli#874) - Use mocked facts in tests (voxpupuli#873) - Enable Puppet 7 support (voxpupuli#881) - Add auto cluster configuration support (voxpupuli#883)
- Add support for oom_score_adj (voxpupuli#877) - CLI Environment Fixes (voxpupuli#876) - make sure the rabbitmq_version method actually returns the version (voxpupuli#874) - Use mocked facts in tests (voxpupuli#873) - Enable Puppet 7 support (voxpupuli#881) - Add auto cluster configuration support (voxpupuli#883) - Compatibility with camptocamp/systemd 3.x (voxpupuli#886)
- Add support for oom_score_adj (voxpupuli#877) - CLI Environment Fixes (voxpupuli#876) - make sure the rabbitmq_version method actually returns the version (voxpupuli#874) - Use mocked facts in tests (voxpupuli#873) - Enable Puppet 7 support (voxpupuli#881) - Add auto cluster configuration support (voxpupuli#883) - Compatibility with camptocamp/systemd 3.x (voxpupuli#886) - puppetlabs/apt: Allow 8.x (voxpupuli#884) - puppet/archive: Allow 5.x (voxpupuli#884) - puppetlabs/stdlib: allow 7.x (voxpupuli#884)
Fixes issue where the local encoding is not correct by adding the correct LC_ALL values to the environment.
Error: