Commit Graph

58 Commits (950f0b408f8ed91a89473c72db198fa7c546db1e)

Author SHA1 Message Date
Stephen Fromm e4964f42e0 Update modules to use run_command in module_common.py
This updates apt, apt_repository, command, cron, easy_install, facter,
fireball, git, group, mount, ohai, pip, service, setup, subversion,
supervisorctl, svr4pkg, user, and yum to take advantage of run_command
in module_common.py.
12 years ago
Daniel Hokka Zakrisson f16ab9169c Python 2.4 fixes for modules 12 years ago
Jan-Piet Mens d184f72aa9 DOCUMENTATION strings 12 years ago
Michael DeHaan 6f6559670f chmod -x for all module files in source checkout 12 years ago
Romeo Theriault 75be1835a5 minor linux user module fixups 12 years ago
Michael DeHaan 3067bd6b78 Merge pull request #1590 from romeotheriault/minor-freebsd-user-module-fixes
minor freebsd user fixes
12 years ago
Romeo Theriault a4192bb4f4 minor freebsd user fixes 12 years ago
Romeo Theriault 6ab4fbc196 Add solaris support to user module 12 years ago
Stephen Fromm f49d2bc557 Fix to user module to use self when calling group_exists 12 years ago
Nigel Metheringham fc3b04e281 FreeBSD user mod only fires when there are changes
Also fix missing -G on groups change
12 years ago
Nigel Metheringham c6c7189e23 Take SHADOWFILE from existing user object rather than class 12 years ago
Nigel Metheringham ed5bf78485 Use the existing framework when running ssh_keygen 12 years ago
Nigel Metheringham eecf6cf94f Ensure user owns their ssh key directory on creation
Lost section from commit 8049777
12 years ago
Michael DeHaan ade071eb29 Fix user example 12 years ago
Michael DeHaan 61a4674413 Merge branch 'nigelm_freebsd' of git://github.com/nigelm/ansible into merge-service
Make things more reusable, correct some errors along the SSH key path

Conflicts:
	library/user
12 years ago
Nigel Metheringham 871d3afdf4 Added some documentation to the classes 12 years ago
Stephen Fromm f0d2a1260b Make sure ownership is set correctly for user's new ssh keys 12 years ago
Nigel Metheringham 0fc939d33f Turn off some of the additional debug syslogging 12 years ago
Nigel Metheringham 346f8ffe0e Rework of user module to support portability
Split module into a main calling function, and a generic
(Linux useradd/usermod/userdel) User class.
Added a __new__ function that selects most appropriate superclass
Added a FreeBSD User class
Tested against FreeBSD 9.0
12 years ago
Michael DeHaan d55e7f35cd Merge pull request #1455 from bleader/devel
user module: fix typo in documentation
12 years ago
Michael DeHaan 24637fa9b0 Merge pull request #1448 from jpmens/user_user1
User is alias for name in 'user' module
12 years ago
bleader fd650d783a user module: fix typo in documentation
tyep -> type

Signed-off-by: bleader <bleader@ratonland.org>
12 years ago
Jan-Piet Mens 9484f55581 User is alias for name in 'user' module 12 years ago
Stephen Fromm d7b5cbb6ac Skip check of primary group when checking other group membership 12 years ago
Jan-Piet Mens ecbb1eb63b fix DOCUMENTATION for user 12 years ago
Stephen Fromm ccb4f41b73 Document ssh_key options are in version 0.9 12 years ago
Jan-Piet Mens d069c57974 Reformat code: examples consistently
- added terse syntax to modules.rst
 - added description of special variables to template module
12 years ago
Stephen Fromm fb87376b1b Use os.path.join where appropriate 12 years ago
Stephen Fromm 213b2306be Add ability to create SSH key for user in user module
This allows one to create a SSH key for user.  You may define:
ssh_key_type, ssh_key_bits, ssh_key_file, ssh_key_comment,
and ssh_key_passphrase.  If no passphrase is provided, the
key will be passphrase-less.  This will not overwrite an existing key.
In the JSON returned, it will provide the ssh_fingerprint and
ssh_key_file.
12 years ago
Luke Antins 980b1c4b74 Add examples to user module documentation. 12 years ago
Michael DeHaan 6f4c3deb11 user module should be using module.BOOLEANS for choices 12 years ago
Jan-Piet Mens c78a0a4a49 Jumbo DOCUMENTATION patch 12 years ago
Stephen Fromm f5d39b8677 Add module documentation for git, group, service, and user 12 years ago
Stephen Fromm 1222cf8de9 Add option required=(True|False) to get_bin_path and update modules
Added required as optional argument to get_bin_path(). It defaults to
false.  Updated following modules to use required=True when calling
get_bin_path():  apt_repository, easy_install, group, pip,
supervisorctl, and user.
Also removed _find_supervisorctl() from supervisorctl module and updated
_is_running() to not need it.
12 years ago
Stephen Fromm f0da6b191a Migrate remaining modules to use get_bin_path in module_common.py
* Migraed easy_install, pip, service, setup, and user.
* Updated fail_json message in apt_repository
* Fixed easy_install to not hardcode location of virtualenv in
  /usr/local/bin/.
* Made handling of virtualenv more consistent between easy_install and
  pip.
12 years ago
Michael DeHaan 3c2eba57fd Make pep8 tests run against the library directory as well, and associated tweaks (mostly to indentation) in the library
directory.
12 years ago
Stephen Fromm 62a4a68658 Abstract how to look up user password to be more flexible
This adds user_password() to abstract how the user's password is looked
up.  If spwd is not available, this will read the shadow file for the
user's shadow entry.  This will then facilitate idempotent password
changes on hosts without spwd.
12 years ago
Michael DeHaan baacde6c74 Add encoding lines to python modules such that they can take unicode options if they are fed them, since the
AnsibleModule stuff no longer base64 encodes for simplicity and speed reasons.
12 years ago
Michael DeHaan 4782bc1949 Port the file module over to the new common code infrastructure + cleanup some redundant imports since the module code already imports those things. 12 years ago
Mark Theunissen b7b44fbf93 Undefined variable error 12 years ago
Stephen Fromm 47cd5de2cc Update user module to use new shared module code 12 years ago
Michael DeHaan 3d4efc0504 Change the way we do with_items to make them happen next to each other in runner, which eliminates the problem of with_items and vars_files sometimes not playing nice with each other.
(Also a fix for the user module error handling when the user
is not present at the time of the return.  This can only really be caused by multiple ansible executions).
12 years ago
Jeremy Smitherman 53459e5609 Added yes/no to user options instead of False comparison for force and remove options for user module 12 years ago
Stephen Fromm 50039260e2 Minor fix to user module to further streamline setting 'changed' flag 12 years ago
Michael DeHaan a1f93baa68 Merge pull request #568 from sfromm/user
User modules fixes
12 years ago
Stephen Fromm 5adbe2453c Fixes to user module for better error handling
The user module now returns the output, both stdout and stderr, from
useradd, usermod, and userdel.  This should help debug cases why one of
those commands fail.  In addition, the user module will now call
fail_json() when the attempted command failed so as to properly
communicate a failure in a playbook.
12 years ago
Seth Vidal bbd42fcf36 modify user module so that password is NEVER logged before the command runs 12 years ago
Brad Olson 637e0d0df3 Remove call to undefined debug() in module 'user'.
I think when we stopped using stderr for debugging modules because
paramiko didn't like it, many modules used the idiom of defining
a debug function that used standard error. The def's and calls were
removed.

This looks like a stray debug() that didn't get removed and didn't
show up unless you alter a user's groups. If it's hit, 'user' fails
with a global undefined function error.
13 years ago
Stephen Fromm 67ee30f135 Apply logging of arguments to modules (issue #122)
The ohai and facter modules use /usr/bin/logger to log the fact that
they have been invoked.  I added 'import os' to the ping module
so that it could have the same syslog statements as the other modules.
I separated the condensed:
    shlex.split(open(argfile, 'r').read())
into two separate statements similar to the other modules.
13 years ago
Stephen Fromm 7d52ace295 Move import of spwd under a try block
Resolves issue #333.  If spwd is not available, the password will
be set regardless.
13 years ago