Commit Graph

40 Commits (f2465e057136374729982a5e7a742fdd0481265a)

Author SHA1 Message Date
Michael DeHaan f2465e0571 Add support for specifying sudo passwords to both ansible & playbook. Nopasswd sudo is no longer required. 2012-04-13 19:06:11 -04:00
Michael DeHaan 6b50078881 Add defaults to command help to avoid a certain class of user questions. 2012-04-12 21:30:49 -04:00
Michael DeHaan 6129574290 Include default value for connection in help. 2012-04-12 21:20:37 -04:00
Stephen Fromm 0675f2511b Merge branch 'master' into localconnection
Merge the SortedOptParser bits and debug attribute commits into
localconnection.

Conflicts:
	bin/ansible
	lib/ansible/playbook.py
	lib/ansible/runner.py
	lib/ansible/utils.py
2012-04-12 11:18:35 -07:00
Stephen Fromm 1391481523 Add support for -c, --connection argument to specify connection type
Adds support to specify connection type to use.  The option -c,
--connection is added when connect_opts is set to True.  connect_opts is
added to make_parser() and base_parser_options().
2012-04-10 16:13:18 -07:00
Seth Vidal 8ae71cc7b1 go back to using a normal optparser to add options instead of the dict
interface.

add very small subclass of OptionParser to sort the options so mdehaan is happy
2012-04-10 13:51:58 -04:00
Michael DeHaan 7b9856bc0e Modification on top of skvidal's common options patch to keep options to command line tools sorted. 2012-04-06 10:59:15 -04:00
Seth Vidal 7e50d170a8 move the bulk of the opt parsing out of ansible/ansible-playbook and into utils
for other scripts to use.
2012-04-05 17:06:23 -04:00
Michael DeHaan 9569be8bdb Need for quoting/unquoting problems go away once module_args are all treated as strings throughout. 2012-03-30 22:52:38 -04:00
Michael DeHaan f11de2f5c9 --extra-vars option for ansible-playbook
Conflicts:

	lib/ansible/playbook.py

Removed unneccessary shlex and replaced with basic split, some repurcussions in runner
that can be eliminated once we consistently pass args as a string (soon).
2012-03-30 22:29:06 -04:00
Michael DeHaan 6db87a5018 Minor style fix, update test to match quote fix patch 2012-03-30 21:57:34 -04:00
Matthew Williams ec6f488d1f shell quoting fixes
(edited author's original commit comment -- MPD)
2012-03-30 21:57:33 -04:00
Michael DeHaan f9da7cb180 remove functions that are no longer used 2012-03-26 21:56:18 -04:00
Michael DeHaan 45a455a805 Make /usr/bin/ansible output realtime and also delete some code! 2012-03-26 21:17:11 -04:00
Michael DeHaan a8c921cbcc Allow groups to be passed to runner API to make parse_hosts optional, misc fixes as a result of refactoring in Runner.
Cleanup in Playbooks module is next.
2012-03-22 00:30:05 -04:00
Michael DeHaan 6a7aac38c5 misc cleanup in the runner module, splitting some things out into utils, breaking up functions into smaller functions. 2012-03-21 23:39:09 -04:00
Michael DeHaan a5f4ca50b8 Ratchet up logging a few notches prior to controlling w/ verbosity settings 2012-03-20 22:29:21 -04:00
Michael DeHaan b5c62ec068 Enhance logging, way to gate verbosity levels pending. 2012-03-20 21:44:01 -04:00
Michael DeHaan 4de7bbb169 Allow conditional imports, see examples/playbook3.yml comments for a full explanation. Extensive
refactoring of playbooks now warranted, which we'll do before we move on.   This variable assignment
system makes nearly all possible magic possible, for we can use these variables however we like,
even as module names!
2012-03-19 22:42:31 -04:00
Michael DeHaan 5ed2b894d9 Add an additional way to dereference a variable in a playbook, $foo
(Using varReplace function originally from yum, thanks Seth)
2012-03-19 19:32:38 -04:00
Michael DeHaan af9596307d Move templating into a utils function. Reuse is our friend. 2012-03-19 19:23:14 -04:00
Michael DeHaan 9c5ec886a6 Import cleanup, plus have /bin/ansible remind you if no hosts were matched by a pattern (for instance, assume
there was a typo in the pattern)
2012-03-18 17:53:58 -04:00
Michael DeHaan c861e0de55 Fix "import *" and resultant new things detectable from "make pyflakes" 2012-03-18 17:16:12 -04:00
Michael DeHaan 63818000b4 auto call the file module after copy/template module usage in runner
note some changed=True/False detection bits in file module still need tweaking
2012-03-15 22:32:14 -04:00
Michael DeHaan be55145a1e Initial crack at the file module 2012-03-15 21:53:14 -04:00
Michael DeHaan 1a0672fd1e Fix exception type 2012-03-14 12:51:26 -04:00
Michael DeHaan 4bde4926c3 Modules don't have to return JSON, key=value pairs is ok. 2012-03-14 21:16:15 -04:00
Michael DeHaan 40fd778e2c 'shell' is a magic module that executes the command module with shell=True 2012-03-14 20:40:06 -04:00
Michael DeHaan 4ae98ed92d Upgrades to error handling, now general try/catch available. 2012-03-13 20:59:05 -04:00
Michael DeHaan db7ba87111 Add polling logic in runner such that all actions get kicked off everywhere then polling
happens only on needed hosts, allowing some hosts to fail and drop out of the running.
2012-03-11 20:54:54 -04:00
Michael DeHaan 49a636d8a0 Fixed up async and polling logic. 2012-03-11 19:27:43 -04:00
Michael DeHaan 5be1a612d3 Add async polling logic to runner. Will add to playbook shortly, have to diagnose why paramiko
is not letting async_wrapper daemonize itself when it does work fine when directly executed.
2012-03-11 18:40:35 -04:00
Michael DeHaan 4c9dd972b4 Fixes for output formatting 2012-03-10 13:40:08 -05:00
Michael DeHaan bb5e4fad48 Abstracted out transport from implementation so it can be pluggable. Also fixes for output format. 2012-03-10 13:35:46 -05:00
Michael DeHaan ab408b0000 Ability to import task lists and handler lists from a top level playbook file. It is possible
to use multiple import statements to implement 'class' like behavior, and also to share
a common list of handlers between multiple patterns.
2012-03-03 10:53:15 -05:00
Michael DeHaan 6541f338df add pyflakes target & associated fixes. Also decided to save JSON to --tree file so it can
be better used programatically.  May have to come up with another system of tree logging for
playbook if playbook decides to have tree logging.  Presumably not the highest priority.
2012-03-02 22:10:51 -05:00
Michael DeHaan 3ad9db4966 Some minor from 'pep8', and silencing the PEP8 messages I don't care about.
Also make pep8 show all messages rather than just 1 per code.
2012-03-02 22:03:03 -05:00
Michael DeHaan 0d7a84d591 Some minor refactoring of playbook code, more to go. 2012-03-02 21:43:46 -05:00
Michael DeHaan 34cbbfbfe1 Added pydoc for utils.py 2012-03-02 21:16:29 -05:00
Michael DeHaan e9a24cdad4 Extensive refactoring of bin/ansible, moving most output functions into lib/ansible/utils to
encourage readability and make things more maintainable.
2012-03-02 21:08:48 -05:00