Commit Graph

87 Commits (e45b3b89a20c98a7589ec4d5ceba7043808539e3)

Author SHA1 Message Date
feliksik 95cf095222 hashi_vault lookup: be more rebust, and allow fields with other name than 'value' (#13690)
* more robust hashi_vault module, and allow querying specific field in secret-dict

* allow fetching entire secret dict with trailing ':'

* process comment by bcoca for PR #13690
2016-05-14 21:48:31 -04:00
Toshio Kuratomi c75b5ba85f Use to_bytes and to_str instead of str as str is unsafe. 2016-04-04 12:57:32 -07:00
Dag Wieers 055aae55f7 Implement own CSVRecoder and CSVReader from documentation
As detailed in the python manual:
https://docs.python.org/2/library/csv.html
2016-04-04 20:32:08 +02:00
Dag Wieers ac75069ee0 Support different encoding types in csvfile lookup plugin
This fixes #15266.
2016-04-04 14:11:44 -04:00
Brian Coca 0bd6f3a5e8 correctly adds searchpath as list 2016-04-01 23:14:56 -04:00
Toshio Kuratomi b70bf3b056 Use io.StringIO and io.BytesIO instead of StringIO.StringIO for compat with py3 2016-02-26 16:43:05 -08:00
Brian Coca a8aa5ff4eb fix cartesian lookup
it seems that this was not working in 1.9 but we swallowed up the error
fixes #14437
2016-02-11 10:35:37 -05:00
Dag Wieers dee5dba82a Handle when the lookup-plugin is used in jinja-style
This fixes #14190.
2016-02-03 17:10:40 +01:00
Brian Coca dd4787701f fix unicode input for template lookup
fixes #14207
2016-01-29 10:42:52 -05:00
Brian Coca c2ac1507ea corrected host/group match in inventory_hostnames
now the lookup works when using ! and & operators
fixes #13997
2016-01-20 18:32:39 -05:00
Brian Coca 89646d4253 no need to be executable 2015-11-16 14:40:35 -08:00
Sebi Calbaza 1f052d5ce6 fixed super invocation 2015-11-15 13:48:40 +02:00
Toshio Kuratomi 958fb29b78 Merge pull request #12881 from Scypho/devel
fix for issue #11885 - allowing json in lookup template calls
2015-11-12 15:39:35 -08:00
Toshio Kuratomi 62979efa14 Finish up plugin porting to global display
Also remove display = display which does nothing
2015-11-11 10:44:23 -08:00
Toshio Kuratomi b05d0b8c9c Port lookup plugins to global display. 2015-11-11 10:44:22 -08:00
Toshio Kuratomi db5d3f03a9 Fix first_found not finding files in roles (only templates) 2015-11-09 13:47:17 -08:00
Brian Coca 57d3245d0d remove commented out prints 2015-10-30 14:02:41 -04:00
Jens Peter Schroer ecae636160 allowing json in lookup template calls 2015-10-23 14:21:46 +02:00
James Cammarata 86de1429e5 Cleaning up FIXMEs 2015-10-22 16:03:50 -04:00
Toshio Kuratomi f34b55ac2b Add python3-compat boilerplate to all .py files in lib/ansible 2015-10-19 18:36:19 -07:00
Toshio Kuratomi 7aa9f6754a Cleanup more pyflakes warnings (2 real problems) 2015-10-19 12:01:01 -07:00
Toshio Kuratomi 0888d78b84 Cleanup some pyflakes warning (1 real error) 2015-10-19 11:42:46 -07:00
Brian Coca 6d87bd405d Merge pull request #12765 from bcoca/lookup_inventory_hostname
implemented inventory_hostname lookup in v2
2015-10-16 15:05:23 -04:00
Toshio Kuratomi baa309309d 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
Brian Coca 9b088a1e40 implemented inventory_hostname lookup in v2 2015-10-15 13:11:42 -04:00
Toshio Kuratomi 8277747a04 Fix password lookup when password file exists and the password is not encrypted 2015-10-12 15:52:03 -07:00
Toshio Kuratomi b49e0995cb Fix typo 2015-10-12 13:29:04 -07:00
Toshio Kuratomi b58d7470d4 Cleanup logic and be more paranoid about passwords with spaces 2015-10-12 12:55:33 -07:00
Brian Coca f5f3bf06e4 Merge pull request #12550 from redrampage/remove-pw-salt-deletion
Removed deletion of salt by 'password' lookup
2015-10-12 11:33:19 -04:00
Brian Coca 4ba5ebd1c8 Merge pull request #12538 from yesbox/url_lookup_plugin_httperror_fix
Fix url lookup plugin HTTPError message not being reachable
2015-10-02 21:30:16 -04:00
Abhijit Menon-Sen 49b35ad5dd Remove mysterious old cruft
The two lines were added in 2673eb0a and modified in 60e1a1f8, but foo
is completely unused. Removing it doesn't break anything: out it goes!
2015-10-01 20:32:08 +05:30
RedRampage 922b5c8109 Removed deletion of salt by 'password' lookup
Removed deletion of salt param from lookup file by 'password' lookup_filter.
Old behaviour leads to constant changed status when two tasks uses same lookup,
one with 'encrypt' parameter, and other without.

For example:

    tasks:
      - name: Create user
        user:
          password: "{{ lookup('password', inventory_dir + '/creds/user/pass' ncrypt=sha512_crypt) }}"
          ...
    # Lookup file 'creds/user/pass' now contain password with salt
      - name: Create htpasswd
        htpasswd:
          password: "{{ lookup('password', inventory_dir + '/creds/user/pass') }}"
          ...
    # Salt gets deleted from lookup file 'creds/user/pass'
    # Next run of "Create user" task will create it again and will have 'changed' status
2015-09-28 23:28:01 +03:00
Jesper Geertsen Jonsson 353b549eb0 Fix HTTPError message not being reachable 2015-09-27 18:01:19 +00:00
James Cammarata 60e1a1f8eb Fix bug in nested lookup where pop is called indiscriminately 2015-09-25 17:16:56 -04:00
James Cammarata 65630d2ce1 Fixing one more bug related to staticmethods in LookupBase 2015-09-23 02:33:32 -04:00
James Cammarata cbbb270761 Cleanup bug from moving base lookup methods to staticmethods 2015-09-23 02:26:19 -04:00
Toshio Kuratomi c83f51b7f2 Some LookupBase cleanups:
* Make LookupBase an abc with required methods (run()) marked as an
  abstractmethod
* Mark methods that don't use self as @staticmethod
* Document how to implement the run method of a lookup plugin.
2015-09-22 16:19:36 -07:00
James Cammarata c95d4ca05f Properly assign search path to environment.loader in template lookup
Same fix as was applied in f162990c to the action plugin

Fixes #12355
2015-09-17 14:47:20 -04:00
Toshio Kuratomi e2c49b4ef4 Fix problem with "=" in the initial file path. 2015-09-09 11:14:31 -07:00
Toshio Kuratomi c68e04c185 Use parse_kv to correctly parse parameters from password lookup
Fixes https://github.com/ansible/ansible-modules-core/issues/1968
2015-09-04 12:18:46 -07:00
Marius Gedminas 0c6ce31f76 Use 'except ... as' syntax
This syntax works on Python 2.6 through 3.x.  lib/ansible/module_utils
(and lib/ansible/modules) need to support Python 2.4, so I didn't touch
those.
2015-08-27 22:15:04 +03:00
Brian Coca b2bfe3502b make sure delimiter is basestring for cvsfile
fixes #12062
2015-08-26 18:38:39 -04:00
Brian Coca 47d9e7ca93 Merge pull request #11984 from Alphadelta14/devel
Support any Mapping for with_dict lookup.
2015-08-22 12:39:42 -04:00
Brian Coca 2787b3acac ported consul_kv lookup from v1 2015-08-21 00:22:20 -04:00
Brian Coca 74079db8d2 ported dig lookup from v1 2015-08-21 00:22:01 -04:00
Brian Coca 1acb29ff9b sequence will now run once for start=end, added test to suite
fixes #11979
2015-08-18 02:33:23 -04:00
Alphadelta14 77b60a1a67 Support any Mapping for with_dict lookup.
This resolves 3939348286 breaking `with_dict: hostvars`.
2015-08-17 20:11:24 -04:00
Brian Coca 9f5e4c0ef6 lookup plugin that does no flattening 2015-08-14 17:05:41 -04:00
Brian Coca 8af0ff4a58 Merge pull request #11567 from lekum/shelvefile_lookup
Add shelvefile lookup plugin
2015-08-13 10:47:44 -04:00
Brian Coca 7666bde666 updated hashi_vault to new listify, added to changelog 2015-08-10 21:10:00 -04:00