Issue 1:
From @basictheprogram on 2016-10-20T21:26:19Z

ISSUE TYPE

Bug Report

COMPONENT NAME

script module

ANSIBLE VERSION

$ ansible --version
ansible 2.3.0 (devel 05aed6e52e) last updated 2016/10/18 22:32:33 (GMT -500)
lib/ansible/modules/core: (detached HEAD b59b5d36e0) last updated 2016/10/18 22:32:33 (GMT -500)
lib/ansible/modules/extras: (detached HEAD 3f77bb6857) last updated 2016/10/18 22:32:33 (GMT -500)
config file = /Users/tanner/projects/ansible.git/playbooks.git/ansible.cfg
configured module search path = Default w/o overrides

CONFIGURATION

Standard configuration for git pull of the devel branch

OS / ENVIRONMENT

Management host 10.12

Managed host Windows 10

SUMMARY

Attempting to use a script to install chocolatey and getting and error about unable to uncompress the file.

STEPS TO REPRODUCE

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

The InstallChocolatey.ps1 script

if ($PSVersionTable.psversion.Major -ge 3)
{
Write-Verbose "Powershell 3+"
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
}
else
{
Write-Verbose "Powershell 3 or lower"
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
}

EXPECTED RESULTS

The latest version of Chocolatey would be installed.

ACTUAL RESULTS

fatal: [PC147.local]: FAILED! => {
"changed": false,
"failed": true,
"failed_when_result": true,
"invocation": {
"module_args": {
"_raw_params": "InstallChocolatey.ps1"
},
"module_name": "script"
},
"rc": 1,
"stderr": "Exception calling \"DownloadFile\" with \"2\" argument(s): \"The remote server returned an error: (503) Server Unavailable.\"\r\nAt line:149 char:3\r\n+ $downloader.DownloadFile($url, $file)\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException\r\n+ FullyQualifiedErrorId : WebException\r\n\r\nUnable to unzip package using built-in compression. Set $env:chocolateyUseWindowsCompression = 'false' and call \r\ninstall again to use 7zip to unzip. Error: \r\nYou cannot call a method on a null-valued expression.\r\nAt line:185 char:5\r\n+ throw \"Unable to unzip package using built-in compression. Set `$ ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n+ CategoryInfo : OperationStopped: (Unable to unzip...ued expression.:String) [], RuntimeException\r\n+ FullyQualifiedErrorId : Unable to unzip package using built-in compression. Set $env:chocolateyUseWindowsCompres \r\nsion = 'false' and call install again to use 7zip to unzip. Error: \r\nYou cannot call a method on a null-valued expression.\r\n",
"stdout": "Getting latest version of the Chocolatey package for download.\r\nDownloading https://chocolatey.org/api/v2/package/chocolatey/0.10.3 to C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\chocolatey\\chocInstall\\chocolatey.zip\r\nExtracting C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\chocolatey\\chocInstall\\chocolatey.zip to C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\chocolatey\\chocInstall...\r\n",
"stdout_lines": [
"Getting latest version of the Chocolatey package for download.",
"Downloading https://chocolatey.org/api/v2/package/chocolatey/0.10.3 to C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\chocolatey\\chocInstall\\chocolatey.zip",
"Extracting C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\chocolatey\\chocInstall\\chocolatey.zip to C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\chocolatey\\chocInstall..."
]
}

Copied from original issue: ansible/ansible-modules-core#5340

Issue 2:
Issue Type:

Bug Report

Ansible Version:

ansible 1.5.5

Environment:

Running from NixOs, managing GCE (small instance) Debian 7.4 without backports.

Summary:

The problem is that the file and unarchive (possibly others) freeze when using sudo user option on a task. This basically breaks the deploy process.

Steps To Reproduce:

The bug can be reproduced with this playbook:

https://gist.github.com/brodul/11395154

One liner also freezes (after the user is created):

ansible -i tmp_inventory all -m file -a 'path=/srv/pikapika/engine/current/ state=directory' --sudo-user=pikapika --sudo

Expected Results:

There should be a failure, not a freeze. Or even better a directory called /srv/pikapika/engine/current/ owned by 'pikapika'

Actual Results:

The whole thing freezes

https://gist.github.com/brodul/11395399

Notice there are some anomalies in the gist above:

I changed the project user from 'nomnom' to 'pikapika'. But the 'nomnom' still persist.

Tnx for reading this. If you need additional info don't hasitate to ask.

Here is a llama: https://flic.kr/p/9ybQmk