nickjj / ansible-user Goto Github PK
View Code? Open in Web Editor NEWCreate and configure a user for SSH key based logins and passwordless sudo.
License: MIT License
Create and configure a user for SSH key based logins and passwordless sudo.
License: MIT License
Hi,
Your ansible role fails in a particular scenario and fails to maintain state on the target server as per the value of "user_enable_passwordless_sudo".
Steps:
I have made change and tested on my local.
Would you accept PR for this issue?
--
Best Regards,
Ritesh
user_local_ssh_key_path: "~/.ssh/id_rsa.pub"
It would be helpful if we could specify multiple keys, or write the authorized_keys
inline.
Hi Nick,
ansible-galaxy has --roles-path so that I can put your cool roles right in my project's roles/ dir.
Better, a ./requirements.yml with:
---
- name: ansible-user
src: https://github.com/nickjj/ansible-user
Then ansible-galaxy install -r requirements.yml
With ./ansible.cfg having:
[defaults]
roles_path = roles.galaxy:roles
Works a treat!
Would this be a useful edit to README.md and PR?
Cheers,
Greg (gbellinoz)
Getting the error WARNING]: - . was NOT installed successfully: Content has no field named 'owner'
on using ansible-galaxy install nickjj.user .
Hello,
Would you consider adding a random password to the user creation 'cause otherwise the account is locked and passwordless keys will not work.
Try this role and then dev-sec.ssh-hardening
. You will not be able to login at all.
- name: Create user
user:
generate_ssh_key: "{{ user_generate_ssh_key }}"
groups: "{{ (user_groups | join(',')) }}"
append: True
name: "{{ user_name }}"
shell: "{{ user_shell }}"
# this generates a hashed and random uuid string
password: "{{ 9999999999999999999999 | random | string | to_uuid | password_hash('sha512', 65534 | random | string) }}"
update_password: on_create
Hi Nick,
Did you mean for the leading % here? Because that means "group named", but user_name is not a group name.
- name: Enable passwordless sudo
copy:
content: '%{{ user_name }} ALL=(ALL) NOPASSWD:ALL'
Usually works, except I accidentally nuked my user "app"'s ownership in the group named app and sudo suddenly started asking me for a password.
(I think ansible has a bug with their group module, but that's not your issue).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.