singleplatform-eng / ansible-users Goto Github PK
View Code? Open in Web Editor NEWAnsible user creation role
Home Page: https://galaxy.ansible.com/singleplatform-eng/users/
License: MIT License
Ansible user creation role
Home Page: https://galaxy.ansible.com/singleplatform-eng/users/
License: MIT License
Having hosts in multiple groups leads to the problem, that only the users from one group_vars file are considered.
Some one else had the same problem before: https://groups.google.com/forum/#!msg/ansible-project/l7KIwiL5pIU/ox_DeA1y6BgJ
Would it be an option to put "users" into a hash instead of using a list, so it would be possible to define users in different group_vars (if "hash_behaviour = merge")?
Hi mivok,
just as a info with the newest ansible (2.0.1.0) version we get deprecation warnings.
example:
[DEPRECATION WARNING]: Using bare variables is deprecated. Update your playbooks so that the environment value uses the full variable syntax ('{{users}}'). This feature will be removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
The following did not set the gid correctly:
users:
I will do a pull request so the following is accepted and works correctly.
users:
I want to a cronjob which runs every week and checks if on all given host the users already exits. if not create them. if something changed reconfigure. Is there something like that ? If i run the task for users creation does it check if the user already exits or just simple appends to the file ?
Is there a way to have the uid as optional? I have an environment in which sadly the uid are not unified under a single list. I tried to changed the code to skip this, but it didn't work for me
uid: "{{item.uid if item.uid is defined else false| default(omit)}}"
I tried several times, no luck
I'd like to use it as galaxy modules, but not sure why user comment has to be same as name.
https://github.com/mivok/ansible-users/blob/master/tasks/main.yml#L20
Can you please add tags for new versions?
According to the README, update_password set to "always" will "update passwords if they differ," and is the default behaviour. The "user creation" task is always causing a change, however. Is this the intended behaviour? Should the line in the README be rephrased?
Hi,
Can we change password to be optional if blank, a different setting for locking the account and then of course the hash option. Some users I dont want to manage passwords and I dont want to lock them out.
This role currently enables users to be easily deleted but this action leaves behind the old user's home directory.
It would be good if there was an option to also remove home directories when deleting users.
Hello,
Did you consider adding a password field, where you could put an encrypted string in, and have the module set it? Would be nice to have (after all it can be done with the ansible 'user' module).
Hi!
im get
msg: |-
usermod: user root is currently used by process 1
my vars
can you solve this?
When running with a list of users, the SSH keys are displayed in plaintext in the Ansible output per item. Is there any nice way to hide this data? We keep it in a vault file normally, so it is not so nice if it leaks out in some shell history/log somewhere.
I'd like to administer a different version of bashrc for users than the standard one provided by my OS. It might be nice to just have a single stub file that admins can then modify as necessary. You could set the default for bashrc creation to false.
If a user has several ssh keys, removing one of them does not remove it from set on target machine.
When managing users with ansible, it make sense to manage the ssh private keys for a user.
Currently, it's only possible to manage the authorized_keys
for a user.
It might be great to define a private keys for the user.
E.g.
users:
- username: foo
ssh_key:
- <ssh public key content 1>
- <ssh public key content 2>
ssh_private_key: <ssh private key string>
I am getting the following error after upgrading ansible to 2.2.0.0
fatal: [xcp05.xxx.xxx.net]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'dict object' has no attribute 'uid'\n\nThe error appears to have been in '/etc/ansible/roles/mivok0.users/tasks/main.yml': line 7, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Per-user group creation\n ^ here\n"}
I cannot for the life of me work out what's going on here... any ideas?
The following page returns 404.
https://galaxy.ansible.com/mivok0/users/
Is this role no longer published in Ansible Galaxy?
You need to follow the same logic in creating the profile as you do when creating the user.
@mivok is no longer maintaining this repo.
There is a pile of PRs that never got merged, and he doesnt participate in the discussions.
I propose to move forward and use a fork mentioned here #26
Lets try to get together behind a single fork to get the benefits of the community :)
@bhardin, @choglundsp, @tony-caffe, @wzur , @akhon , @dphilpot, @trumant, @hahnicity, @lyletagawa, @gnarf, @olpia, @stucki, @rudibatt, @dphilpot
You guys submitted PRs that never got merged, please share your thoughts.
Shell scripting is not for the faint of heart. For example, .profile
tends to be ignored by many different shell contexts. A decent flowchart is available from Shreevatsa:
https://shreevatsa.wordpress.com/2008/03/30/zshbash-startup-files-loading-order-bashrc-zshrc-etc/
I am not of a solid default could exist for the bash configuration path. .bashrc
is better, though people often get confused about .bash_profile
, and then there is also /etc/profile
. And that's just for bash, it gets even crazier for other shells.
Additionally, inlining script contents is inadvisable as it makes it far more difficult to lint and syntax check shell scripts, compared to separate files... you probably want to run some basic ShellCheck commands for any /root
configurations, since these will be running at high privilege.
THere is a problem that even when there are no changes, role reports changed task for:
TASK [singleplatform-eng.users : User creation]
Also - is this project maintained? Last commit was like 1.5y ago, there are some not merged pull requests
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.