Commit Graph

22 Commits (47cd5de2ccddd2233d1882c2438504c003a3336e)

Author SHA1 Message Date
John Kleint 7933c3faed Service module outputting extra data.
The service module was printing stuff to stderr, returning two
JSON dicts, not using consistent 'failed' values, had dead code
and unused variables.  Added detection for the case when service
status returns 'xxx is dead and pid file exists' and made the
code a bit easier to read.
13 years ago
Jeremy Smitherman 290cc1c006 Added additional output to service status checker 13 years ago
Ingo Gottwald d63b3edd02 Enhanced the service state recognition in the service module:
- Added Upstart support
- Added an initial unknown state
- Prevented state changes when the current state is not recognized
- Changed the keyword recognition to a safer method
13 years ago
cocoy ff810ffee4 Add state=reloaded 13 years ago
Michael DeHaan e2e4c2d7ce Allow service 'enable' parameter be 'enabled', which is what I'd personally try to use. 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
Seth Vidal a94544d15c fix up service module to make it start processes that are listed to be
running and to report errors from starting them
13 years ago
Michel Blanc cebba29fb6 Fixes _find_binaries not using globals
_find_binaries now sets the right globals
Binaries are now properly populated (reverse path/binary for loops)
13 years ago
Michel Blanc ca8002d7c5 Adds support for Ubuntu style update-rc.d
Checks if update-rc.d (Ubuntu) or chkconfig (RHEL) should be used.
Adds basic bin path search for those binaries
Adds 'enable' and 'disable' options for 'enable' command since it's the
arguments that update-rc.d uses (this might be somewhat confusing to
have a command line with 'enable=enable', but probably mkes sense for
Ubuntu users).
Allows use of mixed case for 'list' and 'state' commands.
13 years ago
Seth Vidal 70f4956420 new service module handles enable=on/off for chkconfigging it on 13 years ago
Michael DeHaan 7c9c3b306a Fix handling of list=status such that it will actually work in absense of the state command, to
make it useful from /usr/bin/ansible and the API.  Also some minor style fixes.
13 years ago
John Kleint c8a542dda9 Get service module working with sudo, add list=status, better error messages.
When running the service module via sudo, `$PATH` didn't contain `/sbin`,
so the service binary couldn't be found.  This just runs `/sbin/service`
directly.  Output is spewed to stderr on error.

Added `list=status` to include the output of `service <cmd> status`.
13 years ago
jkleint 808cd1b4e9 Service module crashes if args has no "=". 13 years ago
Michael DeHaan 6f55ded1c3 Be more flexible about where the service binary lives for better cross platform support. 13 years ago
Michael DeHaan 2e060c537f Added preliminary support for --sudo to ansible, playbook support and further testing pending. 13 years ago
Christopher Johnston 4183a96495 add support for running and started - both will do the same thing 13 years ago
Michael DeHaan cace2e7239 Added the 'test-module' script, useful for testing modules without running them in Ansible. 13 years ago
Seth Vidal 903178cdd4 convert so they handle argsfiles rather than arguments 13 years ago
Michael DeHaan 1bd1552b43 Relicensing to GPLv3, all previous committers ok'd on mailing list. 13 years ago
Michael DeHaan 8f9320aa05 Rename 'ensure' to 'state' because I think it's a bit cleaner and doesn't imply
all modules take a common parameter name.  But more or less we still work idempotently
in modules.
13 years ago
Michael DeHaan 30bc528091 Have to return the return code on failure, it's a rule! 13 years ago
Michael DeHaan 93a0cf0be4 A basic service module with 'ensure' idempotence semantics. Playbook updated to use service
module vs command module for restarting.  May be some bugs and requires the service to implement 'status' -- and probably some better error handling (i.e. return JSON with "failed" element if failed).

Improvements welcome.
13 years ago