1

A fresh run of kitchen converge runs fine. However, the second run halts at preparing client.rb

...enter image description here

Has anyone ever encountered this issue? How should I debug this problem?

denniss
  • 17,229
  • 26
  • 92
  • 141

3 Answers3

3

I was doing this with vagrant (1.8.1) and kitchen (1.5.0). denniss in his answer above, was mucking around with the 'sudo' group in his answer above and so was I. To fix that, I added the default "vagrant" user to the sudo group in my user recipe as follows replacing the old members() line with the new one which adds "vagrant" to the group (even though this recipe is not managing the "vagrant" user).

#  . . . /myapp/recipes/users_recipe.rb
#
include_recipe "users"
group 'sudo'

user 'jgodse' do
  action :lock
  group 'sudo'
  system true
  shell '/bin/bash'
  home '/home/jgodse'
  manage_home true
  password '$1$xyz$35Ph9JlxB.1tGXqrCgX5y0' 
end
group 'sudo' do
  action :modify
  ###  members ["jgodse","sysadministrator"]    ###old code
  members ["jgodse","sysadministrator", "vagrant"]  #new code
  append true
end
Community
  • 1
  • 1
Jay Godse
  • 15,163
  • 16
  • 84
  • 131
  • +1 to help to identify my issue. But I don't think it's the cleaner fix. The configuration about vagrant user should be kept in .kitchen.yml configuration (provisioner.attributes.authorization...) to not pollute the main recipe. – mcoolive Mar 21 '17 at 10:00
2

I was messing around with /etc/sudoers and revoked sudo access to root user. I decided to just add the user to gid "sudo" instead.

denniss
  • 17,229
  • 26
  • 92
  • 141
0

I was having the same issue. The best way is solving that using kitchen. In my case add to my .kitchen.yml file these attributes:

attributes:
  authorization:
    sudo:
      passwordless: true
      include_sudoers_d: true

If you don't want to affect all the users you can choose specific users using members. I recommend to use this option because it keeps your recipes agnostic.

Juan Urrego
  • 343
  • 2
  • 10