Commit Graph

114 Commits (8914a1a0d737b07c5a0c378e8dc3ab9620b43b3d)

Author SHA1 Message Date
Michael DeHaan 1a0672fd1e Fix exception type 12 years ago
Michael DeHaan c909b66864 use iteritems vs items(), probably doesn't matter that much 12 years ago
Michael DeHaan 4bde4926c3 Modules don't have to return JSON, key=value pairs is ok. 12 years ago
Michael DeHaan 40fd778e2c 'shell' is a magic module that executes the command module with shell=True 12 years ago
Michael DeHaan e8751baaf3 Remove remote log function as it's only used in one place now 12 years ago
Michael DeHaan 696b67f935 Fix async to use the new argfiles method (wrapping brain around rock, really must write module development guide) 12 years ago
Michael DeHaan 3ea9174ed7 Split argsfile handling into subfunction, attempt to apply argsfile logic to setup 12 years ago
Seth Vidal a9948f97c6 convert runner to use an args file rather than just arguments passed
on the command line
12 years ago
Michael DeHaan e3b4981feb Various additions to make sure timed out and failed hosts are taken out of the playbook even if failed
during setup, async tasks, or poll operations.  This introduced some redundancy so I've made some
notes in the code where things need to be refactored to remove them.
12 years ago
Michael DeHaan 4ae98ed92d Upgrades to error handling, now general try/catch available. 12 years ago
Michael DeHaan 09a7119e74 Annotate more files, fix missing imports messing with playbooks. Hey Tim, please test your stuff :) 12 years ago
Tim Bielawa dfd2c6dce3 Implement friendlier error handling.
Generic AnsibleError exception + host inventory missing exception.
First shot at catching these in a generic way in bin/ansible*.
12 years ago
Michael DeHaan ce85222fa6 What we are running is actually a "play" (multiple plays per playbook) so rename the function to make it more clear 12 years ago
Michael DeHaan adf1492da2 Add external vars example 12 years ago
Michael DeHaan e582bd5ec5 Add fire and forget example 12 years ago
Michael DeHaan 86e19cd8c8 This adds async poll support to playbooks. See examples. Some more testing due + docs
but this is more or less a mirror of what /bin/ansible does.  It also has a 'fire and
forget' mode if the poll interval is left off or set to 0.
12 years ago
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.
12 years ago
Michael DeHaan 49a636d8a0 Fixed up async and polling logic. 12 years ago
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.
12 years ago
Michael DeHaan 60a13cf540 Ignore commented out lines in the ansible setup files. 12 years ago
Michael DeHaan 4c9dd972b4 Fixes for output formatting 12 years ago
Michael DeHaan bb5e4fad48 Abstracted out transport from implementation so it can be pluggable. Also fixes for output format. 12 years ago
Seth Vidal b576e389b1 runner buglet and yum module
runner: fix buglet causing logger output to include a u for the command
yum: add yum module:
   ensure=installed pkg=name/name.arch/name-ver-rel.arch
   ensure=removed pkg=name/name.arch/name-ver-rel.arch
   list=installed
   list=updates
   list=available
   list=pkgspec
   list=repos
12 years ago
Seth Vidal 19b784e480 if we've failed a connection to a host - we cannot set items to the
'conn' object since it is not an object on failure - it's a string.
12 years ago
Tim Bielawa 95502c3089 Adding version and author to ansible init. 12 years ago
Michael DeHaan 8e20ed3714 src= parameters for template and copy operations can be relative to the playbook (for /usr/bin/ansible-playbook) or current directory (for /usr/bin/ansible) 12 years ago
Michael DeHaan 7eedc3fb1a Breakout includes into seperate functions, allow vars to apply to handlers but handlers
still may not be parameterized because it does not make sense to import them more than
once since they are keyed by name.
12 years ago
Michael DeHaan 85e0de5bb2 Move print statements out of playbook.py and back into CLI so we can simplify playbook operations
independent of output, and can also see all the output nicely grouped together if we want
to reformat it or make summaries of statistics.
12 years ago
Michael DeHaan 0935506d6f Templating as non-root should not require passing in the metadata= parameter. 12 years ago
Michael DeHaan 4ee4ddcd7c Parameterized include statements can see top level variables and also be passed specific variables!
Code needs cleanup, but works
12 years ago
Michael DeHaan 8d57ceecf1 Factoids and push variables via setup are now available to be templated in command args
as well as template files.  PLUS, variables are now expressed in playbooks without having
to know about the setup task, which means playbooks are simpler to read now.
12 years ago
Tim Bielawa f2c2786a14 Update constants.py to pull module path and the hosts file from the
environment (ANSIBLE_{LIBRARY,HOSTS}) if defined.

Update manpages to represent this.

Also update the env-setup script to set ANSIBLE_{LIBRARY,HOSTS}.
12 years ago
Tim Bielawa b190ea4b62 Fix parse_hosts to not blow up on ungrouped hosts. 12 years ago
Michael DeHaan fae3a71899 WIP on async tests 12 years ago
Michael DeHaan 369b9cde1c Add test for template module and make 'dark' errors clearer if we get output back and the JSON
is not parseable
12 years ago
Michael DeHaan 8d06c074b1 * Added uptime.py as an example of somewhat minimal API usage & reporting
* Pattern in API now has a default
* Fixed bug in template module operation detected from running playbook (tests for that pending)
* Workaround for multiprocessing lib being harmlessly squeaky (feeder thread got sentinel)
12 years ago
Michael DeHaan db57933614 Allow ":" to be used to split patterns as well as ";" so if you are just using group names or fully explicit names you do not need to use shell quoting at all. Obviously if you use wildcards like "*" you wouldstill. 12 years ago
Michael DeHaan 45c40524ef Time limit needs to be passed to async_wrapper. 12 years ago
Michael DeHaan eaa7714ff8 Laying the groundwork for async mode, async status script still needs to be done, and async_wrapper
still needs to daemonize.  Then, once done, playbook can be taught how to poll async within the
timing window.
12 years ago
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.
12 years ago
Michael DeHaan cbfabcd0fb Add -i, -k, and -M to ansible-playbook CLI to match options in /usr/bin/ansible 12 years ago
Michael DeHaan e4304a0ac5 Make sure tempdirs are cleaned up after execution steps, fix notifiers, make sure
service module is installed by setup.py
12 years ago
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.
12 years ago
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.
12 years ago
Michael DeHaan 0d7a84d591 Some minor refactoring of playbook code, more to go. 12 years ago
Michael DeHaan c57df6220b Add pydoc to playbook binary, fix default types for playbook '.get()' call 12 years ago
Michael DeHaan 34cbbfbfe1 Added pydoc for utils.py 12 years ago
Michael DeHaan e9a24cdad4 Extensive refactoring of bin/ansible, moving most output functions into lib/ansible/utils to
encourage readability and make things more maintainable.
12 years ago
Michael DeHaan e6a1acf756 Let "all" be an alias for "*" in patterns, fix output bug on non-command execution, make clean now removes the build dir 12 years ago
Michael DeHaan 5040c01640 rename 'pattern' to 'hosts' in playbook format. 12 years ago