-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
Check user existence with Etc, not ohai node attributes #303
Conversation
node['etc']['passwd'] is only refreshed by Ohai at the start of each Chef run so if the user is created earlier in the same run or if the Ohai plugin is disabled then this check blows up.
|
||
not_if do | ||
begin | ||
Etc.getpwnam current['user'] |
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.
Probably want to add a true
on the next line out put the in !!()
so that you don't get a warning about the not_if
returning something other than a boolean (not_if block for XX returned XX, did you mean to run a command?
)
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 only does this if the return value is a string.
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.
oh i see, it returns an instance of Etc::Passwd
not a string
- Update 'bind' config comments ([#293](#293)) - Add disable_os_default recipe ([#224](#224)) - Use the config's ulimits if set and is > max_clients ([#234](#234)) - Add Travis config ([#299](#299)) - Fix test failures (FoodCritic and Rubocop) ([#298](#298)) - Fix TravisCI builds ([#300](#300)) - Add repl-backlog-size, repl-backlog-ttl, and aof-load-truncated options ([#278](#278)) - Add sentinel_bind to bind sentinel to different IPs ([#306](#306)) - Cleanup deprecation warnings ([#301](#301)) - Fix version detection with epoch version numbers from deb/ubuntu ([#294](#294)) - Restrict VM redis config to <= 2.4 ([#322](#322)) - Rename_commands should be checked for nil before empty ([#311](#311)) - Fixup foodcritic, rubocop, and kitchen testing ([#324](#324)) - Note: this drops support for Chef < 11 - Add min-slaves redis options ([#313](#313)) - Allow /etc/init start after sigterm from system or user ([#310](#310)) - Check user existence with Etc, not ohai node attributes ([#303](#303)) - Various systemd-related improvements ([#302](#302)) - Update serverspec testing with correct OS's for systemd ([#329](#329)) - Add kitchen-dokken testing to Travis ([#330](#330)) - Add fedora-25 to kitchen testing and clean up kitchen config ([#331](#331)) - Fix systemd paths for sentinel service ([#332](#332)) - Add redis-package and sentinel to Travis kitchen verify ([#334](#334)) - Add breadcrumb-file creation condition as attribute ([#268](#268)) - Fix cluster options in README ([#333](#333)) - Fix systemd loader to use descriptors instead of max_clients+32 ([#338](#338)) - Add SELinux support ([#305](#305)) - Make source of redis.conf template configurable ([#341](#341)) - Support sentinel notification-script and client-reconfig-script ([#342](#342))
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
node['etc']['passwd']
is only refreshed by Ohai at the start of each Chef run so if the user is created earlier in the same run or if the Ohai plugin is disabled then this check blows up.The check was going to be removed altogether according to #252 but I would not like this to happen. I would like to create a Redis instance under the same user that I have already set up for a different service. I imagine that's why the
not_if
was put there in the first place. This change deals with the main complaint of #252 (and also #296) but if you like, I could create an attribute such ascreate_user
for this instead.