Skip to content

Commit

Permalink
[COOK-3744] Allow users to specify the action to take on a user via t…
Browse files Browse the repository at this point in the history
…he data_bag

Signed-off-by: Seth Vargo <sethvargo@gmail.com>
  • Loading branch information
martinisoft authored and sethvargo committed Oct 8, 2013
1 parent 6e79768 commit 29b1b9a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Expand Up @@ -73,6 +73,26 @@ Note: The ssh_keys attribute below can be either a String or an Array. However,
}
```

You can pass any action listed in the [user](http://docs.opscode.com/chef/resources.html#id237) resource for Chef via the "action" option. For Example:

Lock a user, johndoe1.

```bash
$ knife data bag users johndoe1
```

And then change the action to "lock":

```javascript
{
"id": "johndoe1",
"groups": ["sysadmin", "dba", "devops"],
"uid": 2002,
"action": "lock", // <--
"comment": "User violated access policy"
}
```

Remove a user, johndoe1.

```bash
Expand Down
1 change: 1 addition & 0 deletions providers/manage.rb
Expand Up @@ -96,6 +96,7 @@ def chef_solo_search_installed?
supports :manage_home => true
end
home home_dir
action u['action'] if u['action']
end

if home_dir != "/dev/null"
Expand Down

0 comments on commit 29b1b9a

Please sign in to comment.