{"id":18783603,"url":"https://github.com/cimon-io/ansible-role-users","last_synced_at":"2026-04-16T00:32:13.297Z","repository":{"id":66296920,"uuid":"109794954","full_name":"cimon-io/ansible-role-users","owner":"cimon-io","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-10T08:27:44.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-10-27T12:40:03.486Z","etag":null,"topics":["ansible","ansible-role","users"],"latest_commit_sha":null,"homepage":null,"language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cimon-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-07T06:18:41.000Z","updated_at":"2021-12-10T08:27:47.000Z","dependencies_parsed_at":"2023-03-23T09:07:42.099Z","dependency_job_id":null,"html_url":"https://github.com/cimon-io/ansible-role-users","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cimon-io/ansible-role-users","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cimon-io%2Fansible-role-users","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cimon-io%2Fansible-role-users/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cimon-io%2Fansible-role-users/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cimon-io%2Fansible-role-users/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cimon-io","download_url":"https://codeload.github.com/cimon-io/ansible-role-users/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cimon-io%2Fansible-role-users/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31866307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-role","users"],"created_at":"2024-11-07T20:39:52.318Z","updated_at":"2026-04-16T00:32:13.146Z","avatar_url":"https://github.com/cimon-io.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible users role\n\nAn ansible role for managing user and group accounts. The role includes the following tasks:\n\n1. Create groups specified by `users_groups`.\n2. Set sudo rights for groups where necessary.\n3. Create users from the `users_accounts` array with specified parameters.\n4. Add users to groups.\n5. Authorize users to login via SSH.\n6. Clone `dotfiles` repository (if `dotfiles_repo` is defined) to `$HOME/.dotfiles` for each user and link dotfiles to `$HOME` directory.\n\nThis role can be run under all versions of Ubuntu and Debian.\n\n## Requirements\n\nNone\n\n## Role Variables\n\nAvailable variables are listed below, along with default values (see `defaults/main.yml`):\n\n```yaml\nusers_accounts: []    # An array of user accounts\nusers_groups: []      # An array of user groups\n```\n\n### User accounts\n\nEach user account can include some of the following parameters. The only required parameter is `name`:\n\n```yaml\nusers_accounts:\n  - name: \"\"                # A user name\n```\n\nTo specify a primary group for an account use a `group` parameter. To put a user to a list of groups, use `groups` value as a string of group names separated with a comma. For ansible 2.2 version and below this is the only allowed format for several groups. Now it is also possible to use YAML lists. When the parameter is set to an empty string (`groups=`), the user is removed from all groups except the primary group.\n\n```yaml\n    group: (omit)           # A name of the primary group to which the user belongs\n    groups: (omit)          # A string of the user group names separated with a comma\n    append: yes             # If 'yes', will only add groups, not set them to just the list in 'groups'\n```\n\nYou are able to set if a home directory should be created for the user when the account is created or if the home directory does not exist with a parameter `createhome`:\n\n```yaml\n    createhome: yes         # Set `no` if a home directory should not be created\n    home: (omit)            # The user's home directory\n```\n\nTo add an SSH authorized key and a password set corresponding parameters. The possible values of `update_password` are `always` and `on_create`. 'Always' will update passwords if they differ; 'on_create' will only set the password for created users.\n\n```yaml\n    key: (omit)             # The SSH public key as a string or (since 1.9) url\n    generate_ssh_key: no    # Whether to generate a SSH key for the user (will not overwrite an existing SSH key)\n    password: (omit)        # The user's password\n    update_password: (omit)\n```\n\nThe `state` parameter allows to manage a user account depending on whether it exists or not. If it's `present`, a new user will be created. If the value is `absent`, the user will be removed. The action is taken only when the current account state is different from what is set:\n\n```yaml\n    state: present          # Create the account if it is absent\n```\n\nTo upload user's dotfiles repository of a specified version use the following parameters:\n\n```yaml\n    dotfiles_repo:            # Path to a dotfiles repository\n    dotfiles_version: (omit)  # Required version\n```\n\nConfigure some other optional parameters if necessary:\n\n```yaml\n    shell: /bin/bash        # The user's shell\n    comment: \"\"             # A description of the user account\n    expires: (omit)         # An expiry time for the user\n    system: no              # Create the user account as system (cannot be changed for existing users)\n```\n\n### User groups\n\nUser groups should be specified by parameters:\n\n```yaml\nusers_groups:\n  - name: admin                       # A group name\n    state: present                    # Create a group if it is absent\n    sudo: \"ALL=(ALL) NOPASSWD:ALL\"    # Set rights to the group\n```\n\n## Dependencies\n\nNone\n\n## Example Playbook\n\n```yaml\n- hosts: all\n  roles:\n    - role: users\n  vars_files:\n    - vars/users.yml\n```\n\nInside `vars/users.yml`:\n\n```yaml\n# Specify some groups:\nusers_groups:\n  - name: admin\n    sudo: \"ALL=(ALL) NOPASSWD:ALL\"\n  - name: deploy\n  - name: developer\n    sudo: \"ALL=(ALL) NOPASSWD:/bin/ls, /bin/cat, /bin/more, /bin/grep, /usr/bin/head, /usr/bin/tail, /usr/bin/less\"\n```\n\n```yaml\n# Specify user accounts:\nusers_accounts:\n  - name: deploy\n    group: deploy\n    comment: Deploy user\n\n  - name: alex\n    groups: 'deploy,admin'\n    comment: alexey@gmail.com\n    key: \"{{ lookup('file', 'files/public_keys/alex.pub') }}\"\n\n  - name: jack\n    groups: 'deploy,admin'\n    comment: jackson@mail.com\n    key: \"{{ lookup('file', 'files/public_keys/jack.pub') }}\"\n\n  - name: pavel\n    groups: 'deploy,developer'\n    comment: pavel@example.com\n    key: \"{{ lookup('file', 'files/public_keys/pavel.pub') }}\"\n```\n\nwhere `files/public_keys/alex.pub` is a user public key.\n\n## License\n\nLicensed under the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcimon-io%2Fansible-role-users","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcimon-io%2Fansible-role-users","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcimon-io%2Fansible-role-users/lists"}