Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Role assignments by name in rbac_user resource #22

Open
Raskil opened this issue Mar 30, 2020 · 1 comment
Open

Role assignments by name in rbac_user resource #22

Raskil opened this issue Mar 30, 2020 · 1 comment

Comments

@Raskil
Copy link

Raskil commented Mar 30, 2020

Use Case

I try to manage console setup configuration for a couple of different masters we use. For this I would like to be able to manage rbac_users and the roles they have assigned,

Describe the Solution You Would Like

I would like to be able to manage the membership attributes by name instead/additional to id. If I write puppet code that creates both, user and roles I don't know which id the role will get so I cannot assign it to the user properly.

@tuxmea
Copy link

tuxmea commented Apr 20, 2022

This is already working:

rbac_role { 'Test':
  ensure      => 'present',
  description => 'Test role for rbac module',
  name => 'Test',
  permissions => [
  {
    'object_type' => 'tasks',
    'action' => 'run',
    'instance' => '*'
  },
  {
    'object_type' => 'console_page',
    'action' => 'view',
    'instance' => '*'
  }],
}
rbac_user { 'martin':
  ensure       => 'present',
  display_name => 'Martin Alfke',
  remote       => false,
  roles        => ['Operators', 'Test'],
  superuser    => false,
}

Result from puppet run:

Notice: /Stage[main]/Profile::Rbac/Rbac_role[Test]/ensure: created (corrective)
Notice: /Stage[main]/Profile::Rbac/Rbac_user[martin]/roles: roles changed [] to [2, 8] (corrective)

Note: tested with github master branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants