Commit graph

45 commits

Author SHA1 Message Date
Brian Coca
3d4b5d165c avoid chmod in check mode 2016-02-09 21:49:07 -05:00
Brian Coca
4e49df7b88 revamped checkmode support in user module
- defaulted to commands not executing in checkmode
- added force run for info gathering (for setting changed)
- added debug for what would have been run in check mode
- added check mode for spots that made changes using system calls instead of command
- removed now redundant checkmode checks

better failure now, if i missed anything, it will misreport changed value
instead of old default of actually making the change in checkmode
2016-02-09 10:45:42 -05:00
James Cammarata
b175b11a63 Merge pull request #2954 from mattclay/user-check-mode-aix
Make modify_user_usermod honor check mode on AIX.
2016-02-09 08:04:55 -05:00
Matt Clay
151f981ce5 Make modify_user honor check mode on OS X. 2016-02-04 01:29:56 -08:00
Matt Clay
2645113eda Make modify_user_usermod honor check mode on AIX. 2016-02-03 23:19:17 -08:00
Matt Clay
8bb538aeb1 Make modify_user honor check mode on FreeBSD. 2016-02-03 02:24:12 -08:00
Brian Coca
f3ed819241 added missing version_added 2015-12-12 17:29:27 -05:00
Brian Coca
76b926a9e8 Merge pull request #1941 from badpass/devel
Add support for selinux user when adding a new user
2015-12-12 17:25:15 -05:00
nitzmahone
f2b72e62c0 fixed disappearing groups on OSX user module
Ensure that we don't try to modify the groups collection if groups are not specified
2015-12-08 16:17:21 -05:00
Dominique Barton
6128845b69 bugfix for issue #2537 2015-12-08 16:17:21 -05:00
Toshio Kuratomi
dc51e1ae41 Mark a few parameters as no_log 2015-10-20 15:35:17 -07:00
Brian Coca
ccbcff8c8e better handling of checkmode for solaris
fixes #2296
2015-10-19 20:09:21 -04:00
Brian Coca
f6bbd2ac5b removed syslog in favor of common module logging functions 2015-10-01 00:13:58 -04:00
Mike Boone
539c996ede Updated link to the FAQ. 2015-09-20 22:45:51 -04:00
tobbe
75fed6e6d8 Merge remote-tracking branch 'upstream/devel' into devel 2015-09-05 22:50:55 +02:00
tobbe
30576ad0c7 add text to the description, more user friendly 2015-09-05 14:39:52 +02:00
Marius Gedminas
4ae4331a6b user: don't generate SSH keys in check mode
Fixes https://github.com/ansible/ansible/issues/11768

Test plan:

- (in a Vagrant VM) created a user 'bob' with no ssh key
- ran the following playbook in check mode:

    ---
    - hosts: trusty
      tasks:
        - user: name=bob state=present generate_ssh_key=yes

- saw that ansible-playbook reported "changes=1"
- saw that /home/bob/.ssh was still absent
- ran the playbook for real
- saw that /home/bob/.ssh was created
- ran the playbook in check mode again
- saw that ansible-playbook reported no changes
- tried a variation with a different username for a user that didn't
  exist: ansible-playbook --check worked correctly (no errors, reported
  "changed")
2015-08-26 08:51:52 +03:00
tobbe
8fa1e9515b Add suport for selinux user when adding a new user on selinux enabled
systems
2015-08-20 22:34:32 +02:00
Brian Coca
072c4f38ea Merge pull request #62 from 0x46616c6b/user-add-skeleton-support
Add support for skeleton directory (useradd -k) in user module
2015-08-12 09:17:35 -04:00
Sébastien Gross
349195e689 [user] Allow '*' as empty password.
If `password` is defined as `*` `useradd` or `usermod` returns an error:

    msg: usermod: Invalid password: `*'

This works very well on Linux host to not define any password for a
user (mainly useful if your setup is only based on SSH keys for
auth). On OpenBSD this does not work, so we have to ignore the encrypted
password parameter if it defined as `*`.
2015-07-24 10:48:36 +02:00
Brian Coca
718fd1f891 prevent usless assignment of home 2015-07-18 23:28:41 -04:00
Mischa ter Smitten
0ca732baaf The tilde expansion doesn't work with user.home 2015-07-15 12:00:23 +02:00
Greg DeKoenigsberg
2a5f0bde87 Proper author info for all remaining modules 2015-06-15 15:53:30 -04:00
Brian Coca
150b71f11a removed executable bit 2015-05-21 07:01:08 -04:00
macbeth76
bb2fc14865 Update user.py
M in date format is minutes. m is for months.
2015-05-07 16:55:28 -04:00
Keith Johnson
7dc1e77263 Make link clickable 2015-04-09 15:44:00 -04:00
James Cammarata
4558cb71f4 Merge branch 'osx_user_fix' of https://github.com/bambou42/ansible-modules-core into bambou42-osx_user_fix
Includes commits for:
* Don't return change if the password is not set
* Set the group to nogroup if none is specified
* Set an uid if none is specified
* Test if SHADOWFILE is set (for Darwin)
* remove unused uid
2015-04-06 13:05:11 -05:00
Carlo Mandelli
0029c960e4 Added HP-UX subclass 2015-02-27 18:32:36 +01:00
Oleg A. Mamontov
fa19753707 On FreeBSD apply 'login_class' only if there is real change. 2015-02-27 14:41:35 +03:00
Stefan J. Betz
dc470cc91f Create SSH Keys always after creating $HOME 2015-02-21 12:00:47 +01:00
Sébastien Gross
1555cfeea2 Add basic support for OS X (Darwin) user management. 2015-02-13 10:14:37 +01:00
Paul Geraghty
b42b0f49b9 Correct grammar of comment relating to example 2015-02-11 02:18:16 +00:00
Brian Coca
543c45a15f implemented account expiration as flag and not state, removed from unsupported platforms 2015-01-28 09:22:32 -05:00
Brian Coca
fc1045a1ee Merge pull request #41 from billwanjohi/add_expired_state
user: add expired state
2015-01-27 18:29:45 -05:00
Brian Coca
d80e7438a6 Merge pull request #37 from mscherer/fix_old_7420
Add hostname to generated user SSH key comment
2015-01-21 18:16:05 -05:00
Michael Scherer
826d313aad Do not use echo shell builtin for password
Using \t in a password may result in a different password
being set :

    $ echo 'a\ta'
    a   a

Problem report originally found by Pilou-
( https://github.com/ansible/ansible-modules-extras/pull/198 )
2015-01-12 19:30:07 +01:00
Toshio Kuratomi
2973bac72f Clarify documented behaviour of user module's ssh_key_file parameter
Fixes #9873
2015-01-07 08:46:42 -08:00
Peter Oliver
18c429d016 Fix appending to a user's group on Solaris
Without this change, you get:
    AttributeError: 'set' object has no attribute 'extend'

Tested on a Solaris 11.2 client with the included Python 2.6.8.
2014-12-21 20:05:17 +00:00
zitterbacke
2e88582165 re-enable AIX password setting
the AIX class uses a unsafe shell for setting the user password (containing a pipe in the command). This patch adopts to the new behavior of module_utils/basic.py (since somewhere around 1.7).

besides it changes the qoutes for the echo command from double to single, because password-hashes contain $-signs and one would not have this variables expanded.
2014-12-16 15:10:00 +01:00
Toshio Kuratomi
e1f90635af Don't traceback if a gid is specified instead of a group name
Fixes https://github.com/ansible/ansible/issues/9796
2014-12-12 12:08:03 -08:00
Jonathan Mainguy
8b8008569f fixes user module for rhel5 by using -n instead of -N, all other distros will still use -N 2014-11-17 13:26:08 -05:00
louis
45f41f4b05 added skeleton support in user module 2014-09-30 08:16:19 +02:00
billwanjohi
ff36edbb11 user: add expired state
ported from
https://github.com/ansible/ansible/pull/6303

It's very useful and routine to disable a *nix user.
I implemented expired instead of locked because this prevents any use of
the account, safer than just preventing password-based authentication.

I have tests [1], but since none of the suite came along with the core
modules, I'm unsure how to submit them.

[1] https://github.com/billwanjohi/ansible/blob/add_locked_state/test/integration/roles/test_user/tasks/main.yml
2014-09-29 22:42:28 +00:00
Michael Scherer
37d9903169 Add hostname to generated user SSH key comment
The default is not very useful to sort between different
keys and user. Adding the hostname in the comment permit to later
sort them if you start to reuse the key and set them in different
servers. See https://github.com/ansible/ansible/pull/7420
for the rational.
2014-09-29 18:07:41 -04:00
Michael DeHaan
c8e1a2077e file extensions! 2014-09-26 10:37:56 -04:00
Renamed from system/user (Browse further)