Help with users cookbook


#1

I’m still pretty new to chef, but this operation should be straight-forward.

I’m on centos6.3 and trying to use this cookbook:
http://community.opscode.com/cookbooks/users

Let’s start with the search not working. My data bag is clearly there:

[david@dev-1 chef-repo{master}]$ knife data bag show users
chris
david

[david@dev-1 chef-repo{master}]$ knife data bag show users david
comment: DAVID
email: david@website.com
groups:
admin
dev
id: david
shell: /bin/bash
ssh_keys: ssh-dss AAAAB3NzaC1kc33/OVhcn8N1WOk5tocKAw=
/Users/david/.ssh/id_dsa
uid: 500

but search returns 0 results for anything in the users data bag:

[david@dev-1 chef-repo{master}]$ knife search users
0 items found

[david@dev-1 chef-repo{master}]$ knife search users -q 'david
0 items found

Any ideas?


#2

You might want to try this syntax:

knife search users "*:*"
knife search users "id:david"
knife search users -q "id:david" # -q not really necessary for this query

-M

On Thu, Mar 21, 2013 at 11:16 PM, David Birdsong
david.birdsong@gmail.com wrote:

I’m still pretty new to chef, but this operation should be straight-forward.

I’m on centos6.3 and trying to use this cookbook:
http://community.opscode.com/cookbooks/users

Let’s start with the search not working. My data bag is clearly there:

[david@dev-1 chef-repo{master}]$ knife data bag show users
chris
david

[david@dev-1 chef-repo{master}]$ knife data bag show users david
comment: DAVID
email: david@website.com
groups:
admin
dev
id: david
shell: /bin/bash
ssh_keys: ssh-dss AAAAB3NzaC1kc33/OVhcn8N1WOk5tocKAw=
/Users/david/.ssh/id_dsa
uid: 500

but search returns 0 results for anything in the users data bag:

[david@dev-1 chef-repo{master}]$ knife search users
0 items found

[david@dev-1 chef-repo{master}]$ knife search users -q 'david
0 items found

Any ideas?


#3

On Thu, Mar 21, 2013 at 8:23 PM, Mike miketheman@gmail.com wrote:

You might want to try this syntax:

knife search users "*:*"
knife search users "id:david"
knife search users -q "id:david" # -q not really necessary for this query

-M

thanks for the help on the syntax, that returned results and also
called my attention to the mis-spelled group names in the data bag
that are probably to blame for missing user accounts.

On Thu, Mar 21, 2013 at 11:16 PM, David Birdsong
david.birdsong@gmail.com wrote:

I’m still pretty new to chef, but this operation should be straight-forward.

I’m on centos6.3 and trying to use this cookbook:
http://community.opscode.com/cookbooks/users

Let’s start with the search not working. My data bag is clearly there:

[david@dev-1 chef-repo{master}]$ knife data bag show users
chris
david

[david@dev-1 chef-repo{master}]$ knife data bag show users david
comment: DAVID
email: david@website.com
groups:
admin
dev
id: david
shell: /bin/bash
ssh_keys: ssh-dss AAAAB3NzaC1kc33/OVhcn8N1WOk5tocKAw=
/Users/david/.ssh/id_dsa
uid: 500

but search returns 0 results for anything in the users data bag:

[david@dev-1 chef-repo{master}]$ knife search users
0 items found

[david@dev-1 chef-repo{master}]$ knife search users -q 'david
0 items found

Any ideas?


#4

Glad to have helped.

On Thu, Mar 21, 2013 at 11:31 PM, David Birdsong
david.birdsong@gmail.com wrote:

On Thu, Mar 21, 2013 at 8:23 PM, Mike miketheman@gmail.com wrote:

You might want to try this syntax:

knife search users "*:*"
knife search users "id:david"
knife search users -q "id:david" # -q not really necessary for this query

-M

thanks for the help on the syntax, that returned results and also
called my attention to the mis-spelled group names in the data bag
that are probably to blame for missing user accounts.

On Thu, Mar 21, 2013 at 11:16 PM, David Birdsong
david.birdsong@gmail.com wrote:

I’m still pretty new to chef, but this operation should be straight-forward.

I’m on centos6.3 and trying to use this cookbook:
http://community.opscode.com/cookbooks/users

Let’s start with the search not working. My data bag is clearly there:

[david@dev-1 chef-repo{master}]$ knife data bag show users
chris
david

[david@dev-1 chef-repo{master}]$ knife data bag show users david
comment: DAVID
email: david@website.com
groups:
admin
dev
id: david
shell: /bin/bash
ssh_keys: ssh-dss AAAAB3NzaC1kc33/OVhcn8N1WOk5tocKAw=
/Users/david/.ssh/id_dsa
uid: 500

but search returns 0 results for anything in the users data bag:

[david@dev-1 chef-repo{master}]$ knife search users
0 items found

[david@dev-1 chef-repo{master}]$ knife search users -q 'david
0 items found

Any ideas?