fnichol/chef-user

"users" key inside my node/my.site.com.json file

Closed this issue · 2 comments

How do I suppose to add a user inside my node/my.site.json file? I've already tried:

{
  "users": [
    {
      "username": "juliobetta",
      "password": "mypass",
      "groups": ["admin", "www-data"]
    }
  ],
  "run_list" : [
    "recipe[user]", "recipe[user::data_bag]"
  ]
}

And then when I try to knife solo cook root@my.site.com it says that:

ERROR: Undefined node attribute or method `gsub' on `node'

Did you manage to use a users attribute inside the node json file? I have the same error.

@juliobetta Sorry for the delay in responding. I was just added as a collaborator of this project and I'm trying to go through the issues.

The users attribute needs to be a list of usernames. The ::data_bag cookbook loops over the names in the list and tries to load a data bag for that username. The JSON would look like this:

{
  "users": [
    "admin", "user", "person"
  ],
  "run_list" : [
    "recipe[user]", "recipe[user::data_bag]"
  ]
}

This ticket has been open for awhile without an update, so I'm going to close it. If you are still having issues please raise a new issue and we'll hopefully be more responsive! :)