Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

vault

ANSIBLE VERSION

devel

CONFIGURATION

OS / ENVIRONMENT

SUMMARY

A single vault encrypted value does not get decrypted in a jinja2 pipeline.

STEPS TO REPRODUCE

Don't worry the below vault data is just useless strings.

---
- hosts: localhost
gather_facts: false
vars:
the_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
66653436353263336535316333313533666563386463623562396234313064643430323066626538
3234393066313964393861613431313832306439383633340a653361636537303033313137613933
33653333633139353736636332333237613761636430356665383839663164363739323337643333
6466313434306462370a663539346162623836626165343830666536646631616165636438646639
6134
tasks:
- command: 'echo {{ the_password|string|type_debug }}'

This outputs:

"stdout": "AnsibleVaultEncryptedUnicode"

This is a little bit of a contrived example, but what it shows, is that if you want to do something like:

- command: "some_command {{ the_password|quote }}"

You will end up with the $ANSIBLE_VAULT;... string instead of the decrypted value

EXPECTED RESULTS

ACTUAL RESULTS

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

script module

ANSIBLE VERSION

$ ansible --version
ansible 2.3.0 (devel 7018aa3316) last updated 2017/03/03 14:22:37 (GMT -500)
config file =
configured module search path = Default w/o overrides

CONFIGURATION

ansible.cfg from git pull

OS / ENVIRONMENT

Management host: macOS 10.12.3

Managemed host: Windows Server 2008 R2 Standard

SUMMARY

The script module reports managed hosts as UNREACHABLE

STEPS TO REPRODUCE

- name: install chocolatey
script: 'InstallChocolatey.ps1'
register: choco
failed_when: choco.rc != 0
changed_when: False

try
{
if ($PSVersionTable.psversion.Major -ge 3)
{
Write-Verbose "Powershell 3+"
$env:chocolateyUseWindowsCompression = 'false'
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
exit $LASTEXITCODE
}
else
{
Write-Verbose "Powershell 3 or lower"
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
exit $LASTEXITCODE
}
}
catch
{
$ErrorMessage = $_.Exception.Message
$FailedItem = $_.Exception.ItemName
Write-Host "Error: $ErrorMessage"
exit -1
}

EXPECTED RESULTS

Latest version of chocolatey would be installed

ACTUAL RESULTS

Running the powershell script interactively works as expected, failure only occurs when run via the script module.

The same script tasks functions correctly on Windows7, Windows8, and Windows10.

TASK [win_chocolatey : install chocolatey] *************************************
task path: /Users/tanner/projects/ansible.git/playbooks.git/roles/win_chocolatey/tasks/main.yml:22
<vconsole.igi.com> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO vconsole.local
EXEC (via pipeline wrapper)
EXEC (via pipeline wrapper)
fatal: [vconsole.local]: UNREACHABLE! => {
"changed": false,
"msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -EncodedCommand UwBlAHQALQBTAHQAcgBpAGMAdABNAG8AZABlACAALQBWAGUAcgBzAGkAbwBuACAATABhAHQAZQBzAHQACgAoAE4AZQB3AC0ASQB0AGUAbQAgAC0AVAB5AHAAZQAgAEQAaQByAGUAYwB0AG8AcgB5ACAALQBQAGEAdABoACAAJABlAG4AdgA6AHQAZQBtAHAAIAAtAE4AYQBtAGUAIAAiAGEAbgBzAGkAYgBsAGUALQB0AG0AcAAtADEANAA4ADgANQA3ADYANwA2ADAALgAxADcALQAxADIAMwA5ADgANQA3ADgANwA0ADkANwA0ADcAMgAiACkALgBGAHUAbABsAE4AYQBtAGUAIAB8ACAAVwByAGkAdABlAC0ASABvAHMAdAAgAC0AUwBlAHAAYQByAGEAdABvAHIAIAAnACcAOwAKAEkAZgAgACgALQBuAG8AdAAgACQAPwApACAAewAgAEkAZgAgACgARwBlAHQALQBWAGEAcgBpAGEAYgBsAGUAIABMAEEAUwBUAEUAWABJAFQAQwBPAEQARQAgAC0ARQByAHIAbwByAEEAYwB0AGkAbwBuACAAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQApACAAewAgAGUAeABpAHQAIAAkAEwAQQBTAFQARQBYAEkAVABDAE8ARABFACAAfQAgAEUAbABzAGUAIAB7ACAAZQB4AGkAdAAgADEAIAB9ACAAfQA=, exited with result 1: C:\\Users\\Administrator\\AppData\\Local\\Temp\\ansible-tmp-1488576760.17-123985787497472\r\n",
"unreachable": true
}```

Running with ANSIBLE_KEEP_REMOTE_FILES=1 I find the temp directory C:\\Users\\Administrator\\AppData\\Local\\Temp\\ansible-tmp-xxxx-xxxxx but I do not find anything inside the directory.

Maybe that's because the script is encoded and passed as the -EncodedCommand, just making note of it here.