Commit Graph

447 Commits (3e0c33c1fa5b9b11d4a0692a75c3a58806ab2c57)

Author SHA1 Message Date
Michael DeHaan 8e7dc3c79c Remove an extra space in the module execution line if no environment was set. 2013-04-19 08:11:56 -04:00
Seth Vidal 7b8cec3f59 clean up first_found to fix a few issues:
- add a skip option so it won't raise an exception if you don't match anything
 - make it work as a drop-in replacement for first_available_file
 - document in the module comments all of the above cases
2013-04-18 16:47:10 -04:00
C. Morgan Hamill 88eb5516eb Fix 'sequence' plugin error.
If 'terms' is a string, replace it with a single item list.
2013-04-17 11:45:28 -04:00
C. Morgan Hamill 663d37b537 Fix errors in lookup plugins.
Lookup plugins 'sequence' and 'template' now import 'ansible.utils'
appropriately in order to use the 'listify_lookup_plugin_terms'
function.

Also, 'dnstxt' and 'env' now check to see if 'terms' is a string;
without this calls like '{{ lookup('env', 'HOME') }}' fail.
2013-04-17 11:31:38 -04:00
Dale Sedivec 515fd9e915 copy action plug-in check mode respects force=no
The copy action accepts force=no, which tells it not to replace an
existing file even if it differs from the source.  The copy action
plug-in wasn't respecting this option when operated in check mode, so it
would report that changes are necessary in check mode even though copy
would make no changes when run normally.

Runner._remote_md5 was changed to make the logic for setting rc perhaps
a little more clear, and to make sure that rc=0 when the file does not
exist.
2013-04-16 20:22:51 -04:00
Michael DeHaan 7c6341718e Merge branch 'combine_vars' of git://github.com/laggyluke/ansible into exp
Conflicts:
	lib/ansible/inventory/vars_plugins/group_vars.py
	lib/ansible/runner/__init__.py
	lib/ansible/utils/__init__.py
	test/TestPlayBook.py
2013-04-16 20:06:06 -04:00
Michael DeHaan 86d47bce5f Make more lookup plugins tolerant of new variable system, with a little better 'do what I mean' logic to resolving
what happens if you get a string back as a template result.
2013-04-16 19:07:19 -04:00
Michael DeHaan c0f8af5202 Make more lookup plugins happy with newstyle variables. Not quite done, but this fixes up with_items/with_nested/file/fileglob. 2013-04-16 18:50:30 -04:00
Michael DeHaan 7037023aa8 Make debug print things nicer if {{ foo }} didn't interpolate 2013-04-12 15:02:54 -04:00
Michael DeHaan 85099be48f Merge pull request #2656 from dstoflet/first_available_file_fix
Quick fix for first_available_file and role support
2013-04-12 08:56:26 -07:00
Michael DeHaan 251f19263c Remove unneeded import. 2013-04-12 10:23:53 -04:00
Michael DeHaan 8457cf433d Update pause module to not use utils.template 2013-04-12 10:00:20 -04:00
Darryl Stoflet c63207bf75 Quick fix for first_available_file and roles 2013-04-11 20:40:23 -07:00
Michael DeHaan a05361f515 This is a fix on top of the 'airplane variable upgrade' commits that fixes legacy when_string so it evaluates correctly in the new eval construct. 2013-04-11 17:20:40 -04:00
Michael DeHaan 11a819cc4b Merge pull request #2631 from stoned/templates-filters-base64
Add base64 encode and decode filters to templates
2013-04-11 09:49:27 -07:00
Michael DeHaan a6777f7e7c Fix template call in group_by module. 2013-04-11 12:43:02 -04:00
Michael DeHaan 81a926547c Some continued work on new-style templates and associated test code changes. Legacy template functions
are marked with "legacy_" for possible future removal.
2013-04-10 19:09:57 -04:00
Michael DeHaan f0b21dcc0f allow references to names of variables in with_items without needing to surround them with Jinja2 '{{' delimeters 2013-04-10 18:42:54 -04:00
Michael DeHaan b09ef21ec9 Add code to flag legacy templating like $foo.{bar} as deprecated in favor of Jinja2 {{ foo.bar }} so we
can remove the legacy system at a later date.
2013-04-10 17:52:35 -04:00
Michael DeHaan 0113951580 Enable usage of when_set within new eval system. 2013-04-10 16:26:59 -04:00
Michael DeHaan a83e10d77d Use safe_eval vs eval. 2013-04-10 16:17:24 -04:00
Michael DeHaan fecfbf9226 Allow jinja2 evals that produce lists to be used in with_items. Ideally want something a bit less heavy
than the eval here.
2013-04-10 15:22:08 -04:00
Stoned Elipot 0893562605 Add base64 encode and decode filters to templates 2013-04-10 02:30:31 +02:00
Sébastien Bocahu b94bf051d5 Makes $PIPE and $FILE macros accept utf-8 input 2013-04-06 23:28:15 +02:00
Michael DeHaan 892484812e Much requested feature -- allows relative imports of content within roles or relative to any task or handler include (../templates for template ../files for copy) 2013-04-06 12:13:04 -04:00
Michael DeHaan 95f30f0def Complete streamlining of vars handling in playbooks and how those are templated to avoid
repeat template calls at playbook intialization time.
2013-04-06 10:45:09 -04:00
George Miroshnykov 6826aa7360 Tweaked merge_hash to also affect Runner behavior 2013-04-06 13:06:38 +03:00
Michael DeHaan f585c4cde7 Upgraded variable support met with upgraded conditional support, see examples/playbooks/upgraded_vars.yml
for details!
2013-04-05 19:10:32 -04:00
Michael DeHaan 9073aa17ab Chroot also needs args/kwargs. 2013-04-05 14:50:15 -04:00
Michael DeHaan 3d25b4a7c0 Standardize args/kwargs on connection plugins. 2013-04-05 14:50:15 -04:00
Dag Wieers d5d26bab9b Make private key customizable per host using ansible_ssh_private_key_file configurable as variable
This fixes issue #1026 for @toshywoshy together with ansible_ssh_user and ansible_ssh_port.
2013-04-05 14:50:15 -04:00
Michael DeHaan 550bf47636 Merge pull request #2565 from willthames/default_exec
Added DEFAULT_EXECUTABLE as a constant
2013-04-05 10:56:56 -07:00
Michael DeHaan f37da4fdd7 Merge branch 'ssh_config_user_overrides' of git://github.com/bcoca/ansible into devel 2013-04-05 13:09:38 -04:00
willthames e55e123c01 Added DEFAULT_EXECUTABLE as a constant
Use DEFAULT_EXECUTABLE when no executable is passed to
_low_level_command_exec

Works as a standard constant - can be overridden in all the normal ways
and defaults to /bin/sh

Motiviation is for a user that only has /bin/bash in /etc/sudoers
2013-04-04 13:32:23 +10:00
Michael DeHaan cdaa2085ee Preliminary ability to use Jinja2 {{ }} to replace ${foo.bar} in playbooks. Can't use both at the same time per line. 2013-04-03 01:04:16 -04:00
Brian Coca 82c3b4e685 now ssh connection plugin will only pass user as an option to ssh if it is
differnt from the current user. This should enable overrides for user in
.ssh/config w/o breaking any current functionality.

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-03-27 16:41:54 -04:00
Michael DeHaan 0d11f53eff Let the callbacks see the playbook and (current) runner objects. 2013-03-25 22:47:06 -04:00
Michael DeHaan 783a12cc0e Resolve merge commit. 2013-03-25 22:32:01 -04:00
Michael DeHaan 3c5890f42b Ensure that when transferring a file to a directory the name of the file is the correct basename and not 'source'. 2013-03-25 22:19:35 -04:00
Michael DeHaan 7044e53e07 Allow conditionals on BYPASS_HOST_LOOP plugins like add_host 2013-03-25 21:16:18 -04:00
Rob Parrott 81e2d871aa inject a dictionary of avaiable variables and the environment into the executor, so that templates can be used to debug playbooks by dumping more of the available context. 2013-03-19 13:04:57 -04:00
Michael DeHaan a22009806e Nested iteration would make more sense in this order. 2013-03-11 17:58:27 -04:00
Michael DeHaan edc04d61f3 Added 'with_nested' lookup plugin that can easily do nested loops. 2013-03-11 17:47:57 -04:00
Michael DeHaan 298d64aa1d Quote remote md5 operations. Fixes #2368 2013-03-11 17:19:43 -04:00
Michael DeHaan e304cc3d8e Simple fix for spaces in filenames with the template module. 2013-03-11 17:13:59 -04:00
Michael DeHaan 6e2ea327d1 A very simple fix to enable spaces in the files sent via the copy module. 2013-03-11 17:11:53 -04:00
Michael DeHaan 2962073bcf Merge branch 'fix-module-encoding' of git://github.com/andreparames/ansible into devel 2013-03-18 00:17:07 -04:00
Michael DeHaan f2c8df2a93 Clarify an error message 2013-03-17 23:33:13 -04:00
Patrick Pelletier c7c7a63ee5 Add support to directly set content in copy module 2013-03-17 23:33:13 -04:00
Michael DeHaan c53653dc0d Merge pull request #2348 from candeira/password-plugin
password lookup plugin, with working tests and documentation
2013-03-10 16:31:17 -07:00