Commit Graph

101 Commits (6a8062baad3d62613d054d6159b3bd2e2b3aad56)

Author SHA1 Message Date
Brian Coca 49fce3587b Merge pull request #10311 from jpmens/lookup-module-dig1
New lookup-plugin: `dig' for performing DNS lookups
2015-02-27 09:33:26 -05:00
Jan-Piet Mens a3618f619e New lookup-plugin: `dig' for performing DNS lookups
add support for argument qtype=XXX
remove spurious print
add dict returns
typo
Add dict returns for all major DNS types
Finish adding more types. For now. Until somebody complains.
I forgot to add NAPTR; here it is.
2015-02-27 09:16:50 +01:00
Brian Coca 5d946ec4f2 adds cartesian product lookup 2015-02-20 09:04:00 -05:00
Brian Coca 788889225d Merge pull request #10078 from sgargan/consul
Ansible support for Consul
2015-02-11 13:58:15 -05:00
Brian Coca 3d6b6edea9 added url lookup plugin 2015-01-27 17:26:18 -05:00
Steve Gargan c02f114967 Initial commit of Ansible support for the Consul clustering framework (http://consul.io).
Submission includes support for
 - creating and registering services and checks
 - reading, writing and lookup for values in consul's kv store
 - creating and manipulating sessions for distributed locking on values in the kv
 - creating and manipulating ACLs for restricting access to the kv store
 - inventory support that reads the Consul catalog and group nodes according to
     - datacenters
     - exposed services
     - service availability
     - arbitrary groupings from the kv store

This submission makes extensive use of the python-consul library and this is required
as a dependency and can be installed from pip.

The tests were written to target a vagrant cluster which can be setup by following the
instructions here http://github.com/sgargan/consul-vagrant
2015-01-24 01:09:03 +00:00
Brian Coca 9a5cbf747a fine tuned lookup/templating errors 2014-11-26 22:06:37 -05:00
Brian Coca db145a368d now only flattened ignores failonundefined cause of it's special need 2014-11-25 16:12:15 -05:00
James Cammarata da5de725d7 Allow with_first_files to search relative to templates and vars in roles
Fixes #8879
2014-09-18 16:05:30 -05:00
James Cammarata d4ff0d125a Make sure password files from lookups are created with restrictive permissions
Also adds checks for the lookup integration test for passwords.

Fixes #8652
2014-08-19 11:30:04 -05:00
James Cammarata ad97c618cf Add support for relative paths in the file lookup plugin for roles
Fixes #7628
2014-06-04 15:20:59 -05:00
James Cammarata 365bfd732e Don't use listify_ function, when all we want to do is template variables
This was causing a bug in the env module, due to the fact that we now
pass variables for the module through the templating engine combined
with the fact that we split-up the hostvars and setup variables. As a
result, if a variable in the env lookup had the same name as the variable
in Ansible, it would try and template itself over and over again until
the recursion limit would be hit, at which time an empty string was
returned.

Fixes #7396
2014-05-20 13:39:23 -05:00
Joshua Conner 1c504eff68 etcd lookup: use $ANSIBLE_ETCD_URL if it exists in the env 2014-03-20 15:16:28 -07:00
James Tanner 49807877fa Fixes #6550 Use shell for pipe lookup subprocess.popen calls 2014-03-18 12:21:26 -04:00
James Tanner ba0fec4f42 Force command action to not be executed by the shell unless specifically enabled 2014-03-10 16:13:30 -05:00
Richard C Isaacson af616fe15e Rename flatten funciton.
flatten(x) is used a lot in the various lookup plugins where in each it is slightly different. This is to make this name slightly more unique.
2014-02-25 14:59:06 -06:00
Kent R. Spillner 1fcc9ff666 lookup_plugins: loop over hashes
Create a lookup plugin named dict that can be used to loop over hashes.
It converts a dict into a list of key-value pairs, with attributes named
"key" and "value."  Also adds a brief explanation and simple example to
the docs.

Signed-off-by: Kent R. Spillner <kspillner@acm.org>
2014-02-25 11:20:15 -06:00
Timur Batyrshin 658c15930e reword "except Error as e:" into "except Error, e:" to be compatible with Python 2.5 (#5852) 2014-02-03 13:00:40 -06:00
Brian Coca ff024b65b2 now with_items also accepts sets
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2014-02-01 17:55:38 -05:00
jctanner 671b0454c6 Merge pull request #4987 from jpmens/lookup-csvfile
New lookup plugin csvreader
2014-01-14 07:17:52 -08:00
Levi Gross dc6a26123b
Fixed syntax error and removed unused imports 2013-12-25 11:04:47 -05:00
Michael DeHaan 643690ffec Remove depedency of lookup plugin on setting in ansible.cfg 2013-12-21 08:49:08 -05:00
James Tanner b8146e3bc7 Fixes #4979 Check for the correct context when inside the inventory_hostnames plugin 2013-11-25 10:57:10 -05:00
Jan-Piet Mens 252a51be91 New lookup plugin csvreader 2013-11-21 09:39:52 +01:00
James Tanner b815a09529 Fix pep8 error in password lookup 2013-11-19 16:36:18 -05:00
James Tanner f31cb7c6e8 Merge pull request #4664 from jpmens/ansible
Lookup plugin for etcd

with support for configurable etcd URL in ansible.cfg (and environment)
2013-11-12 15:29:05 -05:00
James Tanner 6e49ee6cfc Remove commented code block 2013-11-11 14:44:13 -05:00
James Tanner 288c33e286 Merge pull request #4078 from mkaluza/ansible
add 'chars' parameter to password plugin to allow custom character set
2013-11-11 14:30:49 -05:00
Alan Fairless 0824f004d9 Revised patch for more password entropy 2013-11-01 09:51:35 -05:00
Jan-Piet Mens bd5cd8e652 Lookup plugin for etcd
with support for configurable etcd URL in ansible.cfg (and environment)
2013-10-24 21:28:48 +02:00
James Tanner 242f20c297 Fixes #4402 wrong order for isinstance parameters in dnstxt.py 2013-10-17 15:43:39 -04:00
Michael DeHaan 3f968ff46a Check one more skipped scenario in with_subelements. 2013-10-09 17:14:42 -04:00
Michael DeHaan 2078518735 Allow subelements to work right with skipped results. 2013-10-09 15:55:47 -04:00
Michael DeHaan a7adc8ef4d Allow doing things like "groups.groupname" in with_nested.
Fixes #3858
2013-10-07 16:58:29 -04:00
Marcin Kałuża 6786773797 filter out qoutes since they cause random errors 2013-09-10 15:00:29 +02:00
Marcin Kałuża aab445a28f add 'chars' parameter to password plugin to allow custom character set
It accepts comma separated list of names that are
either string module attributes (ascii_letters,digits, etc)
or are used literally

To enter comma use two commas ',,' somewhere - preferably at the end
Qoutes and double qoutes are not supported
2013-09-10 11:59:16 +02:00
Serge van Ginderachter 4f9af7efad subelements lookup plugin 2013-09-09 23:45:55 +02:00
Abhijit Menon-Sen 1a90d01ba9 Fix some typos discovered during casual reading 2013-08-11 18:41:23 +05:30
Michael DeHaan 76fd769704 Merge pull request #3685 from mspaulding06/indexed_items
Indexed items lookup plugin
2013-08-03 11:36:51 -07:00
Michael DeHaan c0ab417ef9 Don't iterate across strings in with_nested. 2013-08-03 14:22:18 -04:00
Matt Spaulding 5d15515bbf Add indexed_items lookup plugin 2013-07-28 13:54:17 -07:00
Vincent Hardion 09ef7751e1 Fix nested loop for more than 3 elements
- combine flatten list for each nested level instead once at the end
2013-07-24 14:19:13 +02:00
Serge van Ginderachter b40295910d also rename plugin name in error message 2013-07-22 16:47:36 +02:00
Michael DeHaan 0cf5e5cec3 Merge branch 'devel' of git://github.com/bradleyy/ansible into together 2013-07-21 11:47:05 -04:00
Michael DeHaan f7dec4f8f4 Rename plugin. 2013-07-20 11:02:16 -04:00
Serge van Ginderachter 730b368259 Introduce flat_list lookup plugin
- hosts: localhost
    gather_facts: False
    tasks:
    - debug: msg="{{item}}"
      with_flat_list:
      - a
      - - b
        - c
        - d
        - - e
        - f
        - - g
          - h
      - i
      - j
      - - k
        - l

  # note: main list or list (sub)items can also be set as a variable

  TASK: [debug msg="{{item}}"] **************************************************
  ok: [localhost] => (item=a) => {"item": "a", "msg": "a"}
  ok: [localhost] => (item=b) => {"item": "b", "msg": "b"}
  ok: [localhost] => (item=c) => {"item": "c", "msg": "c"}
  ok: [localhost] => (item=d) => {"item": "d", "msg": "d"}
  ok: [localhost] => (item=e) => {"item": "e", "msg": "e"}
  ok: [localhost] => (item=f) => {"item": "f", "msg": "f"}
  ok: [localhost] => (item=g) => {"item": "g", "msg": "g"}
  ok: [localhost] => (item=h) => {"item": "h", "msg": "h"}
  ok: [localhost] => (item=i) => {"item": "i", "msg": "i"}
  ok: [localhost] => (item=j) => {"item": "j", "msg": "j"}
  ok: [localhost] => (item=k) => {"item": "k", "msg": "k"}
  ok: [localhost] => (item=l) => {"item": "l", "msg": "l"}
2013-07-17 13:59:41 +02:00
Bradley Young 23557b6e5a change the name from transpose to "together". Change to use itertools.izip_longest() rather than method cribbed from nested.py 2013-07-14 16:31:37 -07:00
Bradley Young ea93a36b10 Adding transpose lookup method. This will matrix transpose arrays that are passed in, and then work like items over the resulting list of lists. e.g.:
Transpose a list of arrays:
    [1, 2, 3], [4, 5, 6] -> [1, 4], [2, 5], [3, 6]
    Replace any empty spots in 2nd array with "":
    [1, 2], [3] -> [1, 3], [2, ""]
2013-07-11 23:45:03 -07:00
Michael DeHaan fc45470162 Merge branch 'with_inventory_hostnames' of git://github.com/sdossett/ansible into inv_hostnames 2013-06-19 22:01:57 -04:00
trbs 87c7fa9138 enable use of multiple terms in first_found 2013-06-19 16:37:29 +02:00