Skip to content

Always run Ohai Passwd plugin to support Chef >= 14.0.13 - #41

Open
trinitronx wants to merge 1 commit into
mkocher:masterfrom
trinitronx:fixes-for-ohai-chef-after-v14.0.13
Open

Always run Ohai Passwd plugin to support Chef >= 14.0.13#41
trinitronx wants to merge 1 commit into
mkocher:masterfrom
trinitronx:fixes-for-ohai-chef-after-v14.0.13

Conversation

@trinitronx

Copy link
Copy Markdown

Adds line to solo.rb config file:

 ohai.optional_plugins = [ :Passwd ] if ohai.respond_to?(:optional_plugins)

Many sprout* cookbooks use the sprout-base::home attribute, but newer versions of Chef Infra Client do not populate this Ohai attribute by default anymore!

Fix the issue by always running the Ohai :Passwd plugin to support Chef >= 14.0.13

Changes:

  • Force run of Ohai Passwd plugin to populate node['etc']['passwd'] for Chef/Ohai >= 14.0.13
  • Guard with ohai.respond_to?(optional_plugins) to support older Chef + Ohai versions

Build tested when merged against Pull Request #40 here. (Due to old .travis.yml RVM ruby versions that no longer worked)

References:

  - Force run of Ohai Passwd plugin to populate `node['etc']['passwd']` for Chef/Ohai >= 14.0.13
  - Guard with `ohai.respond_to?(optional_plugins)` to support older Chef + Ohai versions

References:

  - https://github.com/chef/ohai/blob/master/RELEASE_NOTES.md#optional-ohai-plugins
  - https://stackoverflow.com/a/57953198/64549
@trinitronx

Copy link
Copy Markdown
Author

Note: Travis builds are broken unless .travis.yml is updated (as in #40). Build check is safe to ignore!

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.

1 participant