{"id":25074880,"url":"https://github.com/farisc0de/ansible-role-users","last_synced_at":"2026-02-25T09:35:44.009Z","repository":{"id":273355835,"uuid":"919429249","full_name":"farisc0de/ansible-role-users","owner":"farisc0de","description":"Ansible role to manage users creation","archived":false,"fork":false,"pushed_at":"2025-03-03T08:47:48.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T20:29:59.296Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/farisc0de.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-20T11:25:32.000Z","updated_at":"2025-04-25T11:29:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"8d177efa-2bad-455e-9393-54465d141588","html_url":"https://github.com/farisc0de/ansible-role-users","commit_stats":null,"previous_names":["farisc0de/ansible-role-users"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/farisc0de/ansible-role-users","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farisc0de%2Fansible-role-users","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farisc0de%2Fansible-role-users/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farisc0de%2Fansible-role-users/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farisc0de%2Fansible-role-users/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farisc0de","download_url":"https://codeload.github.com/farisc0de/ansible-role-users/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farisc0de%2Fansible-role-users/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29816169,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T05:36:42.804Z","status":"ssl_error","status_checked_at":"2026-02-25T05:36:31.934Z","response_time":61,"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":[],"created_at":"2025-02-07T00:19:30.768Z","updated_at":"2026-02-25T09:35:43.978Z","avatar_url":"https://github.com/farisc0de.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# User Management Role\n\nAn Ansible role for managing multiple user accounts, home directories, SSH configuration, and sudo privileges on Linux systems.\n\n## Requirements\n\n- Ansible version 2.9 or higher\n- Target systems running:\n  - Ubuntu (all versions)\n  - Debian (all versions)\n  - Enterprise Linux (all versions)\n\n## Role Variables\n\n### User Configuration\n\nThe role uses a list of users to manage multiple accounts. Each user can have individual settings:\n\n```yaml\nusers:\n  - username: example_user     # Required\n    state: present            # Optional: present/absent (default: present)\n    shell: /bin/bash         # Optional (default: /bin/bash)\n    home: /home/example_user # Optional (default: /home/username)\n    system: false            # Optional: create as system user (default: false)\n    append_groups: true      # Optional (default: true)\n    groups: []               # Optional: list of additional groups\n    home_mode: \"0750\"        # Optional (default: \"0750\")\n    public_html: false       # Optional (default: false)\n    public_html_mode: \"0755\" # Optional (default: \"0755\")\n    generate_ssh_key: false  # Optional: generate SSH key pair (default: false)\n    sudo:                    # Optional: sudo configuration\n      enabled: false         # Optional (default: false)\n      commands:             # Optional: list of allowed sudo commands\n        - \"/usr/bin/apt\"\n        - \"/usr/bin/systemctl restart service\"\n    ssh:                     # Optional: SSH configuration\n      enabled: true          # Optional (default: true)\n      dir_mode: \"0700\"       # Optional (default: \"0700\")\n      authorized_keys_mode: \"0600\"  # Optional (default: \"0600\")\n      authorized_keys:       # Optional: list of SSH keys\n        - key: \"{{ variable_name }}\"  # SSH key content from a variable\n        - src: \"{{ ssh_keys_path }}/user.pub\"  # Path to public key file\n      config:               # Optional: SSH client configuration\n        enabled: false      # Optional (default: false)\n        config_mode: \"0600\" # Optional (default: \"0600\")\n```\n\n### Security Features\n\nThe role implements several security best practices by default:\n\n- Home directories are created with `0750` permissions (owner can read/write/execute, group can read/execute)\n- SSH directories are created with `0700` permissions (only owner can access)\n- SSH keys and config files use `0600` permissions (only owner can read/write)\n- Public HTML directories are disabled by default\n- SSH key generation is disabled by default\n- Sudo access is disabled by default\n- System user creation is supported via the `system` parameter\n\n## Dependencies\n\nNone\n\n## Example Playbook\n\n```yaml\n- hosts: servers\n  vars:\n    john_ssh_key: \"ssh-rsa AAAAB3NzaC1...\"  # Define SSH key content\n    ssh_keys_path: \"/path/to/ssh/keys\"      # Define path to SSH keys\n  roles:\n    - role: farisc0de.users\n      vars:\n        users:\n          - username: john_doe\n            groups: ['developers']\n            sudo:\n              enabled: true\n              commands:\n                - \"/usr/bin/apt\"\n                - \"/usr/bin/dnf\"\n            ssh:\n              enabled: true\n              authorized_keys:\n                - key: \"{{ john_ssh_key }}\"\n                - src: \"{{ ssh_keys_path }}/john.pub\"\n          \n          - username: jane_doe\n            shell: /bin/zsh\n            groups: ['developers', 'docker']\n            public_html: true\n            ssh:\n              enabled: true\n              authorized_keys:\n                - src: \"{{ lookup('env', 'HOME') }}/.ssh/id_rsa.pub\"\n              config:\n                enabled: true\n            \n          - username: service_account\n            system: true\n            shell: /sbin/nologin\n            home: /opt/service\n            home_mode: \"0700\"\n            \n          - username: old_user\n            state: absent  # Remove this user\n```\n\n## License\n\nMIT\n\n## Author Information\n\nCreated by [farisc0de](https://github.com/farisc0de)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarisc0de%2Fansible-role-users","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarisc0de%2Fansible-role-users","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarisc0de%2Fansible-role-users/lists"}