Commit graph

122 commits

Author SHA1 Message Date
Toshio Kuratomi
1f7b0fee0a Fixes #12076 2015-08-24 19:07:04 -07:00
Toshio Kuratomi
6e107d2f22 Comments pointing the way towards substituting cryptography for pycrypto 2015-08-24 15:50:37 -07:00
Brian Coca
a4ffa09414 Merge pull request #11880 from bcoca/configurable_squash
made squashable with_ plugin list configurable
2015-08-23 13:32:15 -04:00
Brian Coca
e8b86f448d fix issue with improper connection override in delegation 2015-08-19 20:36:08 -04:00
Brian Coca
22a69e2498 fixes to delegation code 2015-08-19 15:49:37 -04:00
Brian Coca
2198f48f54 changed check to avoid OS X broken sem_getvalue()
fixes #11988
2015-08-18 03:46:20 -04:00
James Cammarata
e7b2308b66 Performance improvements
* Speed up serialization of hostvars by simply using the internal
  dictionary used for cached lookups
* Use blocking gets/puts on queues instead of spin locking
* Merge sequential implicitly created blocks
2015-08-17 13:46:57 -04:00
Brian Coca
ee2e31b37a now passes the test of skipping list when dict attribute is undefined, added deprecation warning as this seems like bad behaviour 2015-08-16 10:16:02 -04:00
Brian Coca
245e0dd4b7 made returns from next task consistent to avoid typeerrors, also linear now checks for none
fixes #11965
2015-08-14 18:07:14 -04:00
Brian Coca
6e825e8c22 fixed listify for lookups, made sure convert_bare is only on with_ 2015-08-11 16:42:09 -04:00
James Cammarata
adb9d7e461 Track role execution per-host, not overall in the role
Fixes #11863
Fixes #11878
2015-08-11 16:34:58 -04:00
Brian Coca
7e7b546c34 reinstated listify 2015-08-10 17:38:20 -04:00
Brian Coca
3e5dbd045f fixed ref to removed var 2015-08-10 14:02:42 -04:00
Toshio Kuratomi
d35b956900 listify lookup plugin terms when they're specified as "{{ lookup(terms) }}"
Before this, they were not listified there but they were listified when
specified like this:

with_lookup: terms
2015-08-10 09:07:37 -07:00
Brian Coca
a555a0652e allow for vars_prompt and pause prompt to be skipped in non interactive settings
ansible-pull users rejoice
2015-08-06 19:20:45 -04:00
James Cammarata
5266679964 Use templar all the way down
Fixes bugs related to creating Templar() objects on the fly, where
the shared loader objects (serialized to TaskExecutor) aren't used
so information loaded into plugin loaders after forking is lost.

Fixes #11815
2015-08-04 12:25:53 -04:00
James Cammarata
c2435fab7e Inject the play context vars into the variables used for loop item templating 2015-08-03 12:12:45 -04:00
James Cammarata
2673eb0afb Add option to fail on undefined variables to listify
And use it in the call to get the loop items for a task.
2015-08-03 12:04:31 -04:00
Abhijit Menon-Sen
2cb7cd8379 Remove outdated FIXME; _compute_delegate is called below 2015-08-01 09:35:32 +05:30
Chris Church
e87cf4a3cc Fixes for WinRM/PowerShell support in v2.
- Add support for inserting module args into PowerShell modules.  Fixes #11661.
- Support Windows paths containing spaces.  Applies changes from #10727 to v2.  Fixes #9999.  Should also fix ansible/ansible-modules-core#944 and ansible/ansible-modules-core#1007.
- Change how execution policy is set for running remote scripts.  Applies changes from #11092 to v2.  Also fixes ansible/ansible-modules-core#1776.
- Use codepage 65001 (UTF-8) for WinRM connection instead of default (CP437), convert command to UTF-8 and results from UTF-8.  Replaces changes from #10024.  Fixes #11198.
- Close WinRM connection when task completes.
- Use win_stat, win_file and win_copy modules instead of stat, file and copy when called from within other action plugins (only when using WinRM+PowerShell).
- Unquote Windows path arguments before passing to win_stat, win_file, win_copy and slurp modules (only when using WinRM/PowerShell).
- Check for win_ping module to determine if core modules are missing (only when using WinRM/PowerShell).
- Add stdout_lines to result from running low level commands (so stdout_lines is available when using raw/script).
- Update copy action plugin to use shell functions for joining paths and checking for trailing slash.
- Update fetch action plugin to unquote source path when using Windows paths.
- Add win_copy and win_template action plugins that inherit from copy and template.
- Support running .bat and .cmd scripts using default system encoding instead of UTF-8.
- Always send PowerShell commands as base64-encoded blobs to allow for running simple PowerShell commands via raw.
- Support running modules on Windows with interpreters other than PowerShell.
- Update integration tests to support above changes and test unicode fixes.
- Add test for win_user error from ansible/ansible-modules-core#1241 (fixed by ansible/ansible-modules-core#1774).
- Add test for additional win_stat output values (implemented by ansible/ansible-modules-core#1473).
- Add test for OS architecture and name from setup.ps1 (implemented by ansible/ansible-modules-core#1100).

All WinRM integration tests pass for me with these changes.
2015-07-31 14:38:31 -04:00
Abhijit Menon-Sen
1541e331c9 Also fix UTF-8 handling in vars_prompt 2015-07-30 23:27:39 +05:30
Abhijit Menon-Sen
ff2d160fff Correct invalid reference to global display 2015-07-30 22:52:47 +05:30
Abhijit Menon-Sen
10def3aa54 Uncomment encrypt handling for vars_prompt 2015-07-30 22:42:21 +05:30
Brian Coca
056602c424 rearranged --list- options, now they are consolidated when used toghether, less loops, more concise output
list-hosts works
list-tasks works, but needs better task naming (missing role info)
list-tags only shows play tags
2015-07-28 22:05:49 -04:00
James Cammarata
42cfacf83b Switch up the task/host overrides for PlayContext to use the compiled vars dict
Fixes #11436
2015-07-28 16:25:44 -04:00
James Cammarata
2d90cbf78b Properly fail results with rc != 0
Fixes #11769
2015-07-28 10:15:14 -04:00
James Cammarata
cb262449c7 Reworking internal result flags and making sure include_vars hides vault data
Fixes #10194
2015-07-27 14:04:31 -04:00
Brian Coca
0858d97c44 also captures typeerrors for when not getting a proper string in output 2015-07-24 18:43:40 -04:00
James Cammarata
eccfb7e0b5 Adding initial support for includes in handlers
Fixes #11694
2015-07-24 16:22:02 -04:00
James Cammarata
ff49c5adac Make sure we're actually looping before looking at 'results' in TaskResult
Fixes #11696
2015-07-24 11:55:22 -04:00
James Cammarata
e526743b4f Allowing args: "{{some_var}}" for task params again
This is unsafe and we debated re-adding it to the v2/2.0 codebase,
however it is a common-enough feature that we will simply mark it
as deprecated for now and remove it at some point in the future.

Fixes #11718
2015-07-24 10:33:12 -04:00
Brian Coca
851ed45bbf adding display to plugins and start moving debug to display 2015-07-23 10:26:12 -04:00
Andrew Hamilton
7254b22bf4 Fixing delegate_to when using a variable 2015-07-22 17:12:00 -07:00
James Cammarata
d412bc72ef Fall back to paramiko if the smart detection fails to run ssh
Fixes #11695
2015-07-22 16:14:17 -04:00
James Cammarata
135404738e Fix a couple start-at-task issues
* added pattern matching to match v1 functionality
* check the task name, not the task+role name for matches
* make sure the input is unicode

Fixes #11692
2015-07-22 07:45:03 -04:00
ZviRackover
628925a77d Fix: add missing import 'locale' 2015-07-22 01:09:31 +03:00
James Cammarata
4c733fe4b7 Fix issues with vars_prompt and vars_files
* Prompt had to be moved up, as it needed to be done before the first
  templating of the play occurs, otherwise vars_files won't be templated
  properly
* Fixed a bug related to an earlier fix of vars_files incorporating
  extra vars to do the templating of the file name

Fixes #11404
2015-07-21 14:52:57 -04:00
James Cammarata
e64989beb4 Moving ConnectionInformation -> PlayContext
Also making PlayContext a child class of the Playbook Base class,
which gives it access to all of the FieldAttribute code to ensure
field values are correctly typed after post_validation

Fixes #11381
2015-07-21 12:13:50 -04:00
James Cammarata
dca36c1d16 Reestablishing the use of tags/when for role duplication detection
Not figuring these in can cause problems with "diamond" pattern relationships,
even though this is still not quite optimal.
2015-07-20 14:37:20 -04:00
Brian Coca
171c95672e fixed gathering expression as it was triggering when gather_facts was no 2015-07-19 23:16:54 -04:00
James Cammarata
3d77723e3d Cleaning up some stuff related to the connection info/become/executable change 2015-07-19 01:12:23 -04:00
James Cammarata
1c185b68be Rearranging some become stuff in relation to action/connection plugins
Moving the make_sudo_cmd() calls back up to the action level so that connection
plugins don't have to know about it at all, and moving some of the become data
(prompt and success_key) into the ConnectionInformation object so they don't
need to be passed around needlessly.
2015-07-19 01:12:23 -04:00
James Cammarata
271a7f3281 Cleaning up some of the notify/facts logic added earlier to fix problems 2015-07-17 14:44:19 -04:00
James Cammarata
5abdd3b821 Handle notifications when coupled with a loop
Fixes #11606
2015-07-17 12:03:04 -04:00
Abhijit Menon-Sen
28e2eae902 Make gathering=explicit work again
There was a confusion between the valid values for defaults.gathering
(explicit/implicit/smart) and a play's gather_facts setting (boolean),
which resulted in gathering=explicit being ignored.
2015-07-17 13:05:00 +05:30
Brian Coca
c603caca27 removed extra print now that items are getting passed to callback in result 2015-07-16 15:13:35 -04:00
Piyush
f2bdd9af29 Fix #11369 A result is skipped when all it's children are skipped. This makes it fundamentally different from a result that was changed/failed/unreachable 2015-07-16 17:50:15 +05:30
James Cammarata
ba7243c5f9 Don't set changed for include tasks
Fixes #11197
2015-07-15 15:11:46 -04:00
Brian Coca
b76cb8f655 now that invocation is only async again, no need to sanitize 2015-07-15 10:40:37 -04:00
James Cammarata
0b035a4e35 Unicode in result debug statements caused a traceback 2015-07-15 01:56:28 -04:00