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

support for multiple permissions for cassandra_grant #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mysolo
Copy link

@mysolo mysolo commented Nov 6, 2019

simply loop for permissions list. and correct except python 3 compatibility.

@Dudesons
Copy link
Owner

Hi @mysolo

I'm not totally agree with your PR.

I'm ok this commit f0c40c5

But this is not in the ansible philosophy to implement loop in actions, you have to use the dsl to do your loop.

- name: grant perms to roles
  cassandra_grant:
    role: "{{ item.role_name }}"
    permission: "{{ item.permission }}" # permission available ["all", "alter", "drop", "select", "modify", "authorise", "describe", "execute"]
    keyspaces: "{{ item.keyspaces }}"
    all_keyspaces: false
  with_items: "{{ my_cassandra_permissions }}"

@mysolo
Copy link
Author

mysolo commented Nov 20, 2019

Hi @Dudesons .

A action is it one permission by one keyspace ? Or one permission by multiple keyspaces.
In cassandra:
grant_permission_statement ::= GRANT permissions ON resource TO role_name.
In cassandra is not possible a grant multiple permission or one permission on multiple keyspace with a one grant command.
For me , a action is GRANT or REVOKE for ONE role. after, I understand can be wrong.

@Dudesons
Copy link
Owner

Dudesons commented Dec 2, 2019

@mysolo with this module I create a custom role to manage my user and group (roles).
Also this role permit me to give a permission to multiple keyspace.

        - role_name: dba
          permission: all
          keyspaces:
            - foo
            - bar
        - role_name: account_writer_reader
          permission: select
          keyspaces:
            - foo
        - role_name: account_writer_reader
          permission: modify
          keyspaces:
            - foo

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

Successfully merging this pull request may close these issues.

2 participants