Commit Graph

87 Commits (264ebaa77c4243f2e9117e8d1168dc2f2eed7ee2)

Author SHA1 Message Date
Dag Wieërs 264ebaa77c Combine both yaml unit tests into one example file 13 years ago
Dag Wieërs f36c6c8c5b Added unit tests for host-groups patch
For the unit test I chose to keep the original yaml file in place as a reference.

This patch also includes a fix.
13 years ago
Michael DeHaan 81adae619a Remove the -D module debug flag, which no longer is functional due to sudo pty requirements, and replace with -v/--verbose.
This flag will show playbook output from non-failing commands.  -v is also added to /usr/bin/ansible, but not  yet used.

I also gutted some internals code dealing with 'invocations' which allowed the callback to know what module invoked
it.  This is not something 0.5 does or needed, so callbacks have been simplified.
13 years ago
Jeroen Hoekx b7cb00073b Correctly add ungrouped hosts to 'ungrouped' in YAML inventory. 13 years ago
Daniel Hokka Zakrisson 32422e9405 Update tests to reflect new API 13 years ago
Daniel Hokka Zakrisson 682e728ebf Add tests of iterative templating 13 years ago
Daniel Hokka Zakrisson e30d931062 Add tests of host exclusions 13 years ago
Michael DeHaan d95e8846f8 Merge pull request #459 from dhozac/with_items-variable
Allow a variable in with_items
13 years ago
Stephen Fromm 86d03713cb Add assemble module
This adds a module that concatenates (ie. assembles) a file from
fragments in a directory in alphabetical order.  It chains the file
module afterward to fix up ownership and permission.  This also adds
tests for the assemble module with fragments in assemble.d.
13 years ago
Daniel Hokka Zakrisson ba1e373034 Allow with_items to specify a variable 13 years ago
John Kleint 05f5734053 Properly template list of hosts in playbooks.
In playbooks, hosts can be a YAML list. We templated the list before
converting it to a semicolon-separated string, which actually templated its
repr. This converts to a string first. A basic unit test is included.
13 years ago
Matt Goodall 8babac4856 Allow "=" in k-v values. 13 years ago
Michael DeHaan d4cc8dc242 Fix hosts being in multiple groups, and duplicate host references in the same inventory file. 13 years ago
Jeroen Hoekx 3768095645 If /usr/share/dict/words does not exist, use cracklib-small to test large output. 13 years ago
Michael DeHaan 84995367a5 Do not run unit tests against the EVENTS code because it is subject to change and that does not mean anything is broken.
If we want to test playbooks, it's best to test the result of a playbook to make sure it does the correct thing.  Also
remove playbook2/3 yml which were not used.
13 years ago
Michael DeHaan 81b9240979 Merge pull request #363 from jhoekx/template-only-if
Fix correct variable expansion in includes only_if.
13 years ago
Jeroen Hoekx b1da61ae92 Fix correct variable expansion in includes only_if.
There's not need to run the complete include through the templating engine.
Several variables were not included before the conditional was evaluated.
13 years ago
Jeroen Hoekx b8573ab7d1 Support list indexing in varReplace. 13 years ago
Jeroen Hoekx c362a2e581 Fixup unicode varReplace templating.
The original patches should have conflicted?
53bde0bf51 vs efde61e537
13 years ago
Michael DeHaan abb391f3fd Merge pull request #362 from jhoekx/uppercase-vars
Allow camelCase variables in varReplace.
13 years ago
John Kleint 64673cc932 Add test for large output; fix indentation. 13 years ago
Jeroen Hoekx 0b5b44858e Allow camelCase variables in varreplace. 13 years ago
Jeroen Hoekx a7599954a3 Make no_engine the default templating action. 13 years ago
Jeroen Hoekx 53bde0bf51 Support nested variables in varReplace. 13 years ago
Jeroen Hoekx 1d28212f86 Inventory: undefined group -> ungrouped.
Also change test name collision.
13 years ago
Jeroen Hoekx 3b40158961 Inventory: support list of vars in host. 13 years ago
Michael DeHaan a7b9bf958d Add tests for new advanced inventory features (groups of groups, group variables) in the default INI format file. 13 years ago
Michael DeHaan 46c661b3e3 Further work on making the YAML inventory parser use the new inventory objects. 13 years ago
Michael DeHaan 3fb2d38514 Reinstate external inventory script support this time using the new more OO-ey inventory system.
Next up: YAML format.
13 years ago
Michael DeHaan 4011d15faa Refactored inventory to make it object oriented, need to make YAML format and executable script
format compatible with this still, and add some tests for INI-style groups of groups
and variables.
13 years ago
Jeroen Hoekx 03541baba7 Define 'inventory_hostname' variable for hosts. 13 years ago
Jeroen Hoekx 029fe1273c Modify /usr/bin/ansible and playbooks to use the new async API. 13 years ago
Jeroen Hoekx b87710a1df Introduce group_names in template variables.
This is a list of all the groups a host is in.
13 years ago
Michael DeHaan b9982fc17b Reinstate --extra-vars, which can do things in playbooks like:
ansible-playbook release-my-app.yml --extra-vars="version=123"

And make $version available in the playbook without re-editing the file
13 years ago
Jeroen Hoekx cc579a8aa2 Fix tests for facter and the ansible_facts API. 13 years ago
Jeroen Hoekx 2dc9a563ef Allow modules to return facts.
If the module result contains "ansible_facts", that will be added to the setup
cache.
13 years ago
Michael DeHaan c0c691089d Fix bug in src. Should not code this early :) 13 years ago
Jeroen Hoekx 903e4f6eae Support dicts in inventory vars. 13 years ago
Michael DeHaan 30d06dbcea Don't force down ansible facts back to setup, the setup module won't like parsing them on input and that
data is already there.
13 years ago
Michael DeHaan da0209dbc4 The fetch module really should preserve the whole directory structure being fetched to allow subsequent calls,
particularly in playbook, to recreate the host tree structure.  Making it thus.
13 years ago
Jeroen Hoekx 6f09b41eb5 Don't test modules that aren't present.
Also account for path difference in sleep in different distributions.
13 years ago
Michael DeHaan 3f26a1c7f6 verbose option is not being used, so remove it. debug variable still exists. 13 years ago
Michael DeHaan 9ce27be878 Remove extra_vars tests 13 years ago
Jeroen Hoekx 8c3206c99f Return a copy of the host variables. 13 years ago
Jeroen Hoekx 961ccdb2f4 List hosts in no group in the ungrouped group. 13 years ago
Jeroen Hoekx 3a24aa9a70 Add YAML inventory format.
See test/yaml_hosts for an example.

Hosts can be part of multiple groups.

Groups can also have variables, inherited by the hosts.
There is no variable scope, last variable seen wins.
13 years ago
Jeroen Hoekx 54f4526160 Export SSH port number as host variable. 13 years ago
Jeroen Hoekx f04041b37d Ignore port numbers in simple inventory format 13 years ago
Jeroen Hoekx 746f1b92ae Reimplement the class method on Runner. 13 years ago
Jeroen Hoekx 195e6d617b Add tests for Inventory class. 13 years ago