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

Feature request: add multiple groups to users #45

Open
juanluisbaptiste opened this issue Aug 21, 2020 · 2 comments
Open

Feature request: add multiple groups to users #45

juanluisbaptiste opened this issue Aug 21, 2020 · 2 comments

Comments

@juanluisbaptiste
Copy link

Hi,

What do you think about adding multiple additional groups to the users instead of a single one with sftp_group_name ? in my case, the users being added with this role must have write access to different existing directories owned by different groups. Making this role add multiple groups would be better than modifying the added users after the role is run to add the extra groups, like this:

  tasks:
    - name: Modify users and add them to additional groups
      user: name={{ item }}
            groups=www-data,systemd-journal,systemd-network
            append=yes
      with_items:
        - sftp_users

A task similar to that one could be used, and maybe renaming sftp_group_name to sftp_group_names, WDYT ?

@johanmeiring
Copy link
Owner

@juanluisbaptiste I'm not opposed to the idea, but I am a little concerned about the backwards compatibility implications of renaming sftp_group_name, mostly because it's used to define the block in sshd config that controls how this whole thing works. I'd prefer a new variable (perhaps sftp_additional_groups?) on user-dict-level, with a new task that will conditionally add the groups to each respective user if they've actually been set.

Will that help?

@juanluisbaptiste
Copy link
Author

@johanmeiring ,I didn't thought on the backwards compatibility, you are right, another variable name should be used, sftp_additional_groups can work.

Thanks !!

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

No branches or pull requests

2 participants