Coder Social home page Coder Social logo

rickkwa / ansible-user-management Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 39 KB

Ansible user management role.

License: MIT License

Python 100.00%
ansible ansible-role user-management user-manager linux linux-administration linux-users ansible-galaxy

ansible-user-management's Introduction

Ansible User Management Role

Build Status Ansible Role license

Manages user accounts, groups, and sudoers using a centralized user/group inventory.

The role takes on a centralized and flat approach. It contains all user and group information in one place, instead of overriding the user/group inventory on a per host/group basis. Using host_vars/group_vars to give users different access to different systems can lead to uncertainty if a host belongs to multiple host groups with conflicting user/group inventories. When that happens, it's up to Ansible to choose which group has priority. With the flat and centralized approach that this role uses, you can define which host groups the user/group should or should not be in.

Requirements

  • Ansible 2.5+

User and Group Inventory Variables

User

The user inventory is a list containing the details of each user. This list is stored in vars/users.yml and each item of the list is a dict that has the following fields:

Field Required Type Default Description
name yes string undefined User's login name.
rel_uid yes int undefined Relative UID in this inventory list. The group's UID would be rel_uid + um_uid_base.
present no list[str] ['all'] List of ansible defined host groups containing the hosts that the user should be on.
absent no list[str] [] List of host groups containing the hosts that the user should not be on. This setting takes precedence over present.
passwd yes string undefined Hashed password for account. See this ansible doc on how you should generate the hashed password.
authorized_keys no string/list[str] omit A single pubkey or list of pubkeys to include in the user's authorized_keys file.
groups no list[str] omit A list of groups that the user should belong in.

Group

The group inventory is a list containing the details of each group. This list is stored in vars/groups.yml and each item of the list is a dict that has the following fields:

Field Required Type Default Description
name yes string undefined Group name.
rel_gid yes int undefined Relative GID in this inventory list. The group's GID would be rel_gid + um_gid_base.
present no list[str] ['all'] List of ansible defined host groups containing the hosts that the group should be on.
absent no list[str] [] List of host groups containing the hosts that the group should not be on. This setting takes precedence over present.
sudoer no string omit File content for the sudoer file associated with this group.

License

MIT. See LICENSE for more information.

ansible-user-management's People

Contributors

heidiw8 avatar rickkwa avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

heidiw8

ansible-user-management's Issues

Parallelize tests based on test case

So matrix based on test case file. That way, we can increase parallelism and reduce speed of tests. Otherwise, every time we add a new test case file, the tests will take longer.

Test cases for other distributions

Want to be able to have the following supported and listed in meta/main.yml:

  • ubuntu
  • debian
  • freebsd

Fix any errors that occur for anything of these

Cache docker builds to save on build time

Regarding the CI, try saving the resultant docker images between builds, and loading them (if they exist) at job runtime. Compare job run times and see if it improves speed. If it doesn't, then close this issue.

More detailed README

  • Consistent UID/GID
  • Sudoer privilege strategy
  • Examples
    • present/absent
  • Which distros does this support

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.