You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#101 and #102 appears to have introduced a bug in the sudo resource. The intent was that if you were not using the sudo default recipe, you could just use the sudo resource to configure sudo users. So in adding the sudo package install to the sudo resource, it looks like a bug was introduced whereby the sudo package resource is happening during converge time and the sudo user configuration is occurring during compile phase:
package 'sudo' do
not_if 'which sudo'
end
unless ::File.exist?(target)
sudoers_dir = directory target
sudoers_dir.run_action(:create)
end
Steps to Reproduce:
Use the sudo resource in an environment where sudo is not installed and the resource fails.
Expected Result:
I would expect for sudo resource not to fail as a result of not having sudo installed in your environment as the resource would install sudo and then configure the sudo user.
Actual Result:
================================================================================
Error executing action `install` on resource 'sudo[made-up-user]'
================================================================================
Errno::ENOENT
-------------
No such file or directory - visudo
Cookbook Trace:
---------------
/opt/kitchen/cache/cookbooks/sudo/providers/default.rb:49:in `validate_fragment!'
/opt/kitchen/cache/cookbooks/sudo/providers/default.rb:104:in `render_sudoer'
/opt/kitchen/cache/cookbooks/sudo/providers/default.rb:126:in `block in class_from_file'
Resource Declaration:
---------------------
# In /opt/kitchen/cache/cookbooks/chassis-users/recipes/default.rb
23: sudo user do
24: user user
25: nopasswd true
26: end
27:
Compiled Resource:
------------------
# Declared in /opt/kitchen/cache/cookbooks/chassis-users/recipes/default.rb:23:in `block in from_file'
sudo("made-up-user") do
action :install
updated true
updated_by_last_action true
default_guard_interpreter :default
supports {:report=>true, :exception=>true}
declared_type :sudo
cookbook_name "chassis-users"
recipe_name "default"
user "made-up-user"
nopasswd true
end
System Info:
------------
chef_version=13.0.118
platform=ubuntu
platform_version=16.04
ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
program_name=chef-client worker: ppid=9;start=02:48:29;
executable=/opt/chef/embedded/bin/chef-client
The text was updated successfully, but these errors were encountered:
Cookbook version
3.5.0
Chef-client version
13.x
Platform Details
All
Scenario:
#101 and #102 appears to have introduced a bug in the
sudo
resource. The intent was that if you were not using the sudo default recipe, you could just use thesudo
resource to configure sudo users. So in adding the sudo package install to the sudo resource, it looks like a bug was introduced whereby the sudo package resource is happening during converge time and the sudo user configuration is occurring during compile phase:Steps to Reproduce:
Use the sudo resource in an environment where sudo is not installed and the resource fails.
Expected Result:
I would expect for sudo resource not to fail as a result of not having sudo installed in your environment as the resource would install sudo and then configure the sudo user.
Actual Result:
The text was updated successfully, but these errors were encountered: