Skip to content

No users/groups createdΒ #462

@carlwain74

Description

@carlwain74

πŸ—£οΈ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

πŸ‘» Brief Description

I am trying to create users from a databag, but nothing is getting created and the recipe seems to process successfully.

πŸ₯ž Cookbook version

8.0.0

πŸ‘©β€πŸ³ Chef-Infra Version

17.3.48

🎩 Platform details

AWS EC2: Amazon Linux 2 (latest)

Steps To Reproduce

Setup my recipe to include the example

Get the users from the data bag

users_from_databag = search('users', 'groups:users OR groups:op')

if node["authorization"]["groups"]
  node["authorization"]["groups"].each do |group|
    next unless group

    users_manage group do
      action [ :create ]
    end

    users_manage group do
      action [ :remove ]
    end
  end
end

users_manage 'sysadmin' do
  group_id 2300
  action [:create]
  users users_from_databag
end

πŸš“ Expected behavior

I would expect all users to get created.

βž• Additional context

The output of the search command returns an array of this type

data_bag_item["users", "atrbojevic", {"id"=>"atrbojevic", "shell"=>"/bin/bash", "ssh_keys"=>["<<PRIVATE_KEY_STRING>> *******@realnetworks.com"], "groups"=>["users"]}]

Attribute: default['authorization']['groups'] = [ 'users','ops' ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions