8cf1815867
At its most basic, this is nothing more than an array or hash lookup, but when used in conjunction with map, it is very useful. For example, while constructing an "ssh-keyscan …" command to update known_hosts on all hosts in a group, one can get a list of IP addresses with: groups['x']|map('extract', hostvars, 'ec2_ip_address')|list This returns hostvars[a].ec2_ip_address, hostvars[b].ec2_ip_address, and so on. You can even specify an array of keys for a recursive lookup, and mix string and integer keys depending on what you're looking up: ['localhost']|map('extract', hostvars, ['vars','group_names',0])|first == hostvars['localhost']['vars']['group_names'][0] == 'ungrouped' Includes documentation and tests. |
||
---|---|---|
.. | ||
code-smell | ||
integration | ||
units | ||
README.md |
Ansible Test System
Folders
unit
Unit tests that test small pieces of code not suited for the integration test layer, usually very API based, and should leverage mock interfaces rather than producing side effects.
Playbook engine code is better suited for integration tests.
Requirements: sudo pip install paramiko PyYAML jinja2 httplib2 passlib nose mock
integration
Integration test layer, constructed using playbooks.
Some tests may require cloud credentials, others will not, and destructive tests are separated from non-destructive so a subset can be run on development machines.
learn more
hop into a subdirectory and see the associated README.md for more info.