# Bug with Custom Setup.ps1 File in New PPA Release

**URL:** <https://forum.ansible.com/t/bug-with-custom-setup-ps1-file-in-new-ppa-release/20206>\
**Category:** Ansible Developer\
**Tags:** windows\
**Created:** [January 13, 2016, 7:46pm UTC](https://forum.ansible.com/t/bug-with-custom-setup-ps1-file-in-new-ppa-release/20206 "2016-01-13T19:46:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Corwin\_Brown](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@Corwin\_Brown](https://forum.ansible.com/u/Corwin_Brown)\
**Post date:** [January 13, 2016, 7:46pm UTC](https://forum.ansible.com/t/bug-with-custom-setup-ps1-file-in-new-ppa-release/20206/1 "2016-01-13T19:46:53Z")

</div>

Hey gang,

I have a custom version of the ‘setup.ps1’ file in my ‘/etc/ansible/library’ ([It allows me to gather facter facts on Windows](https://github.com/ansible/ansible-modules-core/pull/2380)). In 1.9 Ansible would correctly run ‘setup.py’ on Linux hosts, and my custom ‘library/setup.ps1’ on Windows hosts. However, now EVERYTHING is grabbing that custom ‘setup.ps1’. Am I doing something weird, or is this broken now? It may be worth having a conversation on ‘setup.ps1’ should be renamed ‘win\_setup.ps1’ or something to help prevent this kind of collision,

Anything I can do, or should I attempt to roll back to 1.9 for the moment? Should I file a formal bug on github?

Thanks!

- Corwin

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 13, 2016, 7:53pm UTC](https://forum.ansible.com/t/bug-with-custom-setup-ps1-file-in-new-ppa-release/20206/2 "2016-01-13T19:53:29Z")

</div>

if the file where named 'setup' (no extension) this would be expected,  
but no this seems like a bug.

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [January 14, 2016, 6:09am UTC](https://forum.ansible.com/t/bug-with-custom-setup-ps1-file-in-new-ppa-release/20206/3 "2016-01-14T06:09:08Z")

</div>

I too use a custom setup.ps1 but hadn’t noticed your issue. However I have a copy of setup.py in my /etc/ansible/library so as a workaround that might save you from having to go back to 1.9.4.

Jon

---

<div class="post-metadata">

**Author:** ![Corwin\_Brown](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@Corwin\_Brown](https://forum.ansible.com/u/Corwin_Brown)\
**Post date:** [January 14, 2016, 3:39pm UTC](https://forum.ansible.com/t/bug-with-custom-setup-ps1-file-in-new-ppa-release/20206/4 "2016-01-14T15:39:44Z")

</div>

Hmm, so if I place a ‘setup.py’ in /etc/ansible/library I still have the issue. Now I’m not as convinced its not something I’m doing. For giggles, here’s the specific error:

> Using /home/blakfeld/p4depots/perforce\_corp/d-cbrown\_ansible\_trunk/ansible.cfg as config file
> 
> Loaded callback default of type stdout, v2.0
> 
> 2 plays in ./test\_playbook.yml
> 
> PLAY \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> \<172.16.100.11\> ESTABLISH SSH CONNECTION FOR USER: vagrant
> 
> \<172.16.100.11\> SSH: EXEC sshpass -d14 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=22 -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/blakfeld/.ansible/cp/ansible-ssh-%h-%p-%r -tt 172.16.100.11 ‘( umask 22 && mkdir -p “$( echo /tmp/.ansible/tmp/ansible-tmp-1452785840.72-172858349812402 )” && echo “$( echo /tmp/.ansible/tmp/ansible-tmp-1452785840.72-172858349812402 )” )’
> 
> \<172.16.100.11\> PUT /tmp/tmpedHVyL TO /tmp/.ansible/tmp/ansible-tmp-1452785840.72-172858349812402/setup
> 
> \<172.16.100.11\> SSH: EXEC sshpass -d14 scp -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=22 -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/blakfeld/.ansible/cp/ansible-ssh-%h-%p-%r /tmp/tmpedHVyL ‘[172.16.100.11]:/tmp/.ansible/tmp/ansible-tmp-1452785840.72-172858349812402/setup’
> 
> \<172.16.100.11\> ESTABLISH SSH CONNECTION FOR USER: vagrant
> 
> \<172.16.100.11\> SSH: EXEC sshpass -d14 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=22 -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/blakfeld/.ansible/cp/ansible-ssh-%h-%p-%r -tt 172.16.100.11 ‘/bin/sh -c ‘"’“'sudo -H -S -n -u root /bin/sh -c '”’“'”‘"’“'”‘"’“‘echo BECOME-SUCCESS-kiqfevmhxxfozxxtpnwgikkenrjonfkg; LANG=C LC\_ALL=C LC\_MESSAGES=C powershell /tmp/.ansible/tmp/ansible-tmp-1452785840.72-172858349812402/setup; rm -rf “/tmp/.ansible/tmp/ansible-tmp-1452785840.72-172858349812402/” \> /dev/null 2\>&1’”‘"’“'”‘"’“'”‘"’‘"’"‘’
> 
> fatal: [172.16.100.11]: FAILED! =\> {“changed”: false, “failed”: true, “invocation”: {“module\_name”: “setup”}, “module\_stderr”: “OpenSSH\_6.6.1, OpenSSL 1.0.1f 6 Jan 2014\r\ndebug1: Reading configuration data /home/blakfeld/.ssh/config\r\ndebug1: /home/blakfeld/.ssh/config line 18: Applying options for \*\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 19: Applying options for \*\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug2: mux\_client\_hello\_exchange: master version 4\r\ndebug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux\_client\_request\_session: entering\r\ndebug3: mux\_client\_request\_alive: entering\r\ndebug3: mux\_client\_request\_alive: done pid = 6056\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to 172.16.100.11 closed.\r\n”, “module\_stdout”: “/bin/sh: 1: powershell: not found\r\n”, “msg”: “MODULE FAILURE”, “parsed”: false}
> 
> NO MORE HOSTS LEFT \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

> 172.16.100.11 : ok=0 changed=0 unreachable=0 failed=1

As you can see this is just a vagrant box I’m trying to connect to locally.

Thanks all!

-Corwin

---

<div class="post-metadata">

**Author:** ![Matt\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@Matt\_Davis](https://forum.ansible.com/u/Matt_Davis)\
**Post date:** [January 14, 2016, 5:25pm UTC](https://forum.ansible.com/t/bug-with-custom-setup-ps1-file-in-new-ppa-release/20206/5 "2016-01-14T17:25:39Z")

</div>

Yep, I’m seeing the same thing. I’ve created an issue at [https://github.com/ansible/ansible/issues/13894](https://github.com/ansible/ansible/issues/13894), and I’ll take a look to see what we can do about it.

---

<div class="post-metadata">

**Author:** ![Barney\_Sowood1](https://avatars.discourse-cdn.com/v4/letter/b/f9ae1b/32.png) [@Barney\_Sowood1](https://forum.ansible.com/u/Barney_Sowood1)\
**Post date:** [April 13, 2017, 4:28pm UTC](https://forum.ansible.com/t/bug-with-custom-setup-ps1-file-in-new-ppa-release/20206/6 "2017-04-13T16:28:56Z")

</div>

I’ve also hit this issue, I’ve not managed to work out a fix, but I’ve got a workaround documented here -

[https://github.com/ansible/ansible/issues/13894#issuecomment-293949183](https://github.com/ansible/ansible/issues/13894#issuecomment-293949183)

Regards,

Barney.
