{"id":29143891,"url":"https://github.com/nickjj/ansible-user","last_synced_at":"2025-06-30T20:39:43.729Z","repository":{"id":16702992,"uuid":"19459716","full_name":"nickjj/ansible-user","owner":"nickjj","description":"Create and configure a user for SSH key based logins and passwordless sudo.","archived":false,"fork":false,"pushed_at":"2020-11-26T14:31:24.000Z","size":24,"stargazers_count":48,"open_issues_count":3,"forks_count":25,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-22T01:47:50.105Z","etag":null,"topics":["ansible","ssh-keys","sudoers"],"latest_commit_sha":null,"homepage":"","language":null,"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/nickjj.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-05T15:00:04.000Z","updated_at":"2024-10-09T17:21:36.000Z","dependencies_parsed_at":"2022-08-25T13:21:41.040Z","dependency_job_id":null,"html_url":"https://github.com/nickjj/ansible-user","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/nickjj/ansible-user","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickjj%2Fansible-user","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickjj%2Fansible-user/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickjj%2Fansible-user/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickjj%2Fansible-user/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickjj","download_url":"https://codeload.github.com/nickjj/ansible-user/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickjj%2Fansible-user/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262847758,"owners_count":23374077,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","ssh-keys","sudoers"],"created_at":"2025-06-30T20:39:39.969Z","updated_at":"2025-06-30T20:39:43.704Z","avatar_url":"https://github.com/nickjj.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"## What is ansible-user? [![Build Status](https://secure.travis-ci.org/nickjj/ansible-user.png)](http://travis-ci.org/nickjj/ansible-user)\n\nIt is an [Ansible](http://www.ansible.com/home) role to:\n\n- Create user groups\n- Create a single user, add it to any groups you created and configure its shell\n- Set your public SSH key as an authorized key so you can login without a password\n- Enable passwordless sudo\n\n## Why would you want to use this role?\n\nWhen you spin up a new server, you'll often want to set up a non-root user that\nyou can login as and run your applications under. That's because running your\napplications as root is a questionable idea from a security point of view.\n\nThis role sets you up to do that, but it also includes a few other user related\ntasks, such as what's listed in the above bullets. Having all of these things\ntogether in 1 role means less work for you to do!\n\n## Supported platforms\n\n- Ubuntu 16.04 LTS (Xenial)\n- Ubuntu 18.04 LTS (Bionic)\n- Debian 8 (Jessie)\n- Debian 9 (Stretch)\n\n## Role variables\n\n```\n# Optionally create additional user groupss. If empty, the user you create will\n# automatically be a part of their user's group, ie. deploy:deploy.\nuser_groups: []\n\n# The user you want to create.\nuser_name: \"deploy\"\n\n# Which shell should you default to? Typically \"bash\" or \"sh\".\nuser_shell: \"/bin/bash\"\n\n# Do you want to create an SSH keypair for this user? You probably don't for a\n# regular user that you plan to login as which is why it's disabled by default.\nuser_generate_ssh_key: False\n\n# When set, this will copy your local SSH public key from this path to your\n# user's authorized keys on your server.\n#\n# If you don't want this behavior then use an empty string as the value but keep\n# in mind this role does not set a default password for the user you create, so\n# you will be locked out if you don't supply your public SSH key.\nuser_local_ssh_key_path: \"~/.ssh/id_rsa.pub\"\n\n# Do you want to enable running root commands without needing a password?\nuser_enable_passwordless_sudo: True\n```\n\n## Example usage\n\nFor the sake of this example let's assume you have a group called **app** and\nyou have a typical `site.yml` playbook.\n\nTo use this role edit your `site.yml` file to look something like this:\n\n```\n---\n\n- name: \"Configure app server(s)\"\n  hosts: \"app\"\n  become: True\n\n  roles:\n    - { role: \"nickjj.user\", tags: \"user\" }\n```\n\nLet's say you want to edit the user name, you can do this by opening or\ncreating `group_vars/app.yml` which is located relative to your `inventory`\ndirectory and then make it look something like this:\n\n```\n---\n\nuser_name: \"thor\"\n```\n\nNow you would run `ansible-playbook -i inventory/hosts site.yml -t user`.\n\n## Installation\n\n`$ ansible-galaxy install nickjj.user`\n\n### Ansible Galaxy\n\nYou can find it on the official\n[Ansible Galaxy](https://galaxy.ansible.com/nickjj/user) if you want to rate it.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickjj%2Fansible-user","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickjj%2Fansible-user","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickjj%2Fansible-user/lists"}