community.general/lib/ansible
Abhijit Menon-Sen 8cf1815867 Add an 'extract' filter
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.
2015-12-02 18:16:38 +05:30
..
cli ignore password flags in become conflict check 2015-12-01 08:18:31 -08:00
compat Bundle a new version of python-six for compatibility along with some code to make it easy for distributions to override the bunndled copy if they have a new enough version. 2015-10-16 08:21:28 -07:00
config Making the switch to v2 2015-05-03 21:47:26 -05:00
errors Clean up a few more pyflakes warnings 2015-10-19 11:20:21 -07:00
executor Make sure run_once tasks properly set variables for all active hosts 2015-11-30 11:27:05 -05:00
galaxy Fix traceback because we're using display from another object that no 2015-11-11 12:19:00 -08:00
inventory fix for dynamic (add_host) hosts not available in hostvars 2015-11-16 10:53:10 -08:00
module_utils fixes a syntax issue with module_utils/eapi.py 2015-12-01 23:34:59 -05:00
modules Update submodule refs to go along with the StandardError change in ec2 moudles 2015-11-30 19:05:33 -08:00
new_inventory fix some warning of undefined name. 2015-10-09 12:43:42 +08:00
parsing Put in trap for args being None 2015-11-28 13:38:11 -05:00
playbook unconditionally set vars on init to avoid issues with var precedence 2015-12-01 21:24:46 -08:00
plugins Add an 'extract' filter 2015-12-02 18:16:38 +05:30
template Re-implement lookup wantlist 2015-11-29 23:45:54 -05:00
utils Finish up plugin porting to global display 2015-11-11 10:44:23 -08:00
vars Ensure port is (re)set for delegated-to hosts 2015-11-30 14:40:23 -05:00
__init__.py Bump version in devel now that stable-2.0 has been branched 2015-12-02 17:57:53 +05:30
constants.py Make sudo+requiretty and ANSIBLE_PIPELINING work together 2015-12-01 23:32:20 +05:30
test-requirements.txt Making the switch to v2 2015-05-03 21:47:26 -05:00