Help Please? Trying to build AWX - Getting an error where the local Machine (MacOS) is looking for powershell.

I’m trying to figure out why this is happening. The local connection is MacOS Catalina, and the remote is Alpine Linux 12.

Either way I try this (locally or remote) it seems to have the same problem. Thanks in advance!

┌[kiwish-4.2]-(awx/installer)-[git:13_installer*]-[76%]

└> ansible-playbook -u markh --ask-become-pass -i inventory install.yml -vvv

ansible-playbook 2.9.11

config file = /Users/mhorninger/projects/dominion-solutions/awx/installer/ansible.cfg

configured module search path = [‘/Users/mhorninger/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]

ansible python module location = /usr/local/lib/python3.8/site-packages/ansible

executable location = /usr/local/bin/ansible-playbook

python version = 3.8.5 (default, Jul 21 2020, 10:48:26) [Clang 11.0.3 (clang-1103.0.32.62)]

Using /Users/mhorninger/projects/dominion-solutions/awx/installer/ansible.cfg as config file

BECOME password:

host_list declined parsing /Users/mhorninger/projects/dominion-solutions/awx/installer/inventory as it did not pass its verify_file() method

script declined parsing /Users/mhorninger/projects/dominion-solutions/awx/installer/inventory as it did not pass its verify_file() method

auto declined parsing /Users/mhorninger/projects/dominion-solutions/awx/installer/inventory as it did not pass its verify_file() method

Parsed /Users/mhorninger/projects/dominion-solutions/awx/installer/inventory inventory source with ini plugin

statically imported: /Users/mhorninger/projects/dominion-solutions/awx/installer/roles/local_docker/tasks/upgrade_postgres.yml

[DEPRECATION WARNING]: docker_service is kept for backwards compatibility but usage is discouraged. The module documentation details page may explain more about this rationale… This feature will be removed in a future release. Deprecation warnings can be disabled by setting

deprecation_warnings=False in ansible.cfg.

statically imported: /Users/mhorninger/projects/dominion-solutions/awx/installer/roles/local_docker/tasks/set_image.yml

statically imported: /Users/mhorninger/projects/dominion-solutions/awx/installer/roles/local_docker/tasks/compose.yml

PLAYBOOK: install.yml ****************************************************************************************************************************************************************************************************************************************************************

1 plays in install.yml

PLAY [Build and deploy AWX] **********************************************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************************************************************************

task path: /Users/mhorninger/projects/dominion-solutions/awx/installer/install.yml:2

<192.168.88.10> ESTABLISH SSH CONNECTION FOR USER: markh

<192.168.88.10> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“markh”’ -o ConnectTimeout=10 -o ControlPath=/Users/mhorninger/.ansible/cp/ad227640a4 192.168.88.10 ‘/usr/bin/env ash -c ‘"’“‘echo ~markh && sleep 0’”’"‘’

<192.168.88.10> (0, b’/home/markh\n’, b’')

<192.168.88.10> ESTABLISH SSH CONNECTION FOR USER: markh

<192.168.88.10> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“markh”’ -o ConnectTimeout=10 -o ControlPath=/Users/mhorninger/.ansible/cp/ad227640a4 192.168.88.10 ‘/usr/bin/env ash -c ‘"’"’( umask 77 && mkdir -p “echo /home/markh/.ansible/tmp”&& mkdir /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536 && echo ansible-tmp-1596142461.5403461-6592-165134273621536=“echo /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536” ) && sleep 0’“'”‘’

<192.168.88.10> (0, b’ansible-tmp-1596142461.5403461-6592-165134273621536=/home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536\n’, b’')

Using module file /usr/local/lib/python3.8/site-packages/ansible/modules/~indows/setup.ps1

<192.168.88.10> PUT /Users/mhorninger/.ansible/tmp/ansible-local-6587va5c8_e5/tmp0c6h5g_q TO /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536/AnsiballZ_setup.ps1

<192.168.88.10> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“markh”’ -o ConnectTimeout=10 -o ControlPath=/Users/mhorninger/.ansible/cp/ad227640a4 ‘[192.168.88.10]’

<192.168.88.10> (0, b’sftp> put /Users/mhorninger/.ansible/tmp/ansible-local-6587va5c8_e5/tmp0c6h5g_q /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536/AnsiballZ_setup.ps1\n’, b’')

<192.168.88.10> ESTABLISH SSH CONNECTION FOR USER: markh

<192.168.88.10> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“markh”’ -o ConnectTimeout=10 -o ControlPath=/Users/mhorninger/.ansible/cp/ad227640a4 192.168.88.10 ‘/usr/bin/env ash -c ‘"’“‘chmod u+x /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536/ /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536/AnsiballZ_setup.ps1 && sleep 0’”’"‘’

<192.168.88.10> (0, b’‘, b’')

<192.168.88.10> ESTABLISH SSH CONNECTION FOR USER: markh

<192.168.88.10> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“markh”’ -o ConnectTimeout=10 -o ControlPath=/Users/mhorninger/.ansible/cp/ad227640a4 -tt 192.168.88.10 ‘/usr/bin/env ash -c ‘"’“‘powershell /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536/AnsiballZ_setup.ps1 && sleep 0’”’"‘’

<192.168.88.10> (127, b’ash: powershell: not found\r\n’, b’Shared connection to 192.168.88.10 closed.\r\n’)

<192.168.88.10> Failed to connect to the host via ssh: Shared connection to 192.168.88.10 closed.

<192.168.88.10> ESTABLISH SSH CONNECTION FOR USER: markh

<192.168.88.10> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“markh”’ -o ConnectTimeout=10 -o ControlPath=/Users/mhorninger/.ansible/cp/ad227640a4 192.168.88.10 ‘/usr/bin/env ash -c ‘"’“‘rm -f -r /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536/ > /dev/null 2>&1 && sleep 0’”’"‘’

<192.168.88.10> (0, b’‘, b’')

fatal: [192.168.88.10]: FAILED! => {

“ansible_facts”: {},

“changed”: false,

“failed_modules”: {

“setup”: {

“failed”: true,

“module_stderr”: “Shared connection to 192.168.88.10 closed.\r\n”,

“module_stdout”: “ash: powershell: not found\r\n”,

“msg”: “The module failed to execute correctly, you probably need to set the interpreter.\nSee stdout/stderr for the exact error”,

“rc”: 127

}

},

“msg”: “The following modules failed to execute: setup\n”

}

PLAY RECAP ***************************************************************************************************************************************************************************************************************************************************************************

192.168.88.10 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

(attachments)

ansible.cfg (39 Bytes)
inventory (4.75 KB)

Repasting the output as it’s impossible to read in the OP

┌[kiwish-4.2]-(awx/installer)-[git:13_installer*]-[76%]
└> ansible-playbook -u markh --ask-become-pass -i inventory install.yml -vvv
ansible-playbook 2.9.11
config file = /Users/mhorninger/projects/dominion-solutions/awx/installer/ansible.cfg
configured module search path = [‘/Users/mhorninger/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
executable location = /usr/local/bin/ansible-playbook
python version = 3.8.5 (default, Jul 21 2020, 10:48:26) [Clang 11.0.3 (clang-1103.0.32.62)]
Using /Users/mhorninger/projects/dominion-solutions/awx/installer/ansible.cfg as config file
BECOME password:
host_list declined parsing /Users/mhorninger/projects/dominion-solutions/awx/installer/inventory as it did not pass its verify_file() method
script declined parsing /Users/mhorninger/projects/dominion-solutions/awx/installer/inventory as it did not pass its verify_file() method
auto declined parsing /Users/mhorninger/projects/dominion-solutions/awx/installer/inventory as it did not pass its verify_file() method
Parsed /Users/mhorninger/projects/dominion-solutions/awx/installer/inventory inventory source with ini plugin
statically imported: /Users/mhorninger/projects/dominion-solutions/awx/installer/roles/local_docker/tasks/upgrade_postgres.yml
[DEPRECATION WARNING]: docker_service is kept for backwards compatibility but usage is discouraged. The module documentation details page may explain more about this rationale… This feature will be removed in a future release. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
statically imported: /Users/mhorninger/projects/dominion-solutions/awx/installer/roles/local_docker/tasks/set_image.yml
statically imported: /Users/mhorninger/projects/dominion-solutions/awx/installer/roles/local_docker/tasks/compose.yml

PLAYBOOK: install.yml ****************************************************************************************************************************************************************************************************************************************************************
1 plays in install.yml

PLAY [Build and deploy AWX] **********************************************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************************************************************************
task path: /Users/mhorninger/projects/dominion-solutions/awx/installer/install.yml:2
<192.168.88.10> ESTABLISH SSH CONNECTION FOR USER: markh
<192.168.88.10> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“markh”’ -o ConnectTimeout=10 -o ControlPath=/Users/mhorninger/.ansible/cp/ad227640a4 192.168.88.10 ‘/usr/bin/env ash -c ‘"’“‘echo ~markh && sleep 0’”’“‘’
<192.168.88.10> (0, b’/home/markh\n’, b’')
<192.168.88.10> ESTABLISH SSH CONNECTION FOR USER: markh
<192.168.88.10> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“markh”’ -o ConnectTimeout=10 -o ControlPath=/Users/mhorninger/.ansible/cp/ad227640a4 192.168.88.10 '/usr/bin/env ash -c '”‘"’( umask 77 && mkdir -p “echo /home/markh/.ansible/tmp”&& mkdir /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536 && echo ansible-tmp-1596142461.5403461-6592-165134273621536=“echo /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536” ) && sleep 0’“'”‘’
<192.168.88.10> (0, b’ansible-tmp-1596142461.5403461-6592-165134273621536=/home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536\n’, b’‘)
Using module file /usr/local/lib/python3.8/site-packages/ansible/modules/~indows/setup.ps1
<192.168.88.10> PUT /Users/mhorninger/.ansible/tmp/ansible-local-6587va5c8_e5/tmp0c6h5g_q TO /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536/AnsiballZ_setup.ps1
<192.168.88.10> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“markh”’ -o ConnectTimeout=10 -o ControlPath=/Users/mhorninger/.ansible/cp/ad227640a4 ‘[192.168.88.10]’
<192.168.88.10> (0, b’sftp> put /Users/mhorninger/.ansible/tmp/ansible-local-6587va5c8_e5/tmp0c6h5g_q /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536/AnsiballZ_setup.ps1\n’, b’‘)
<192.168.88.10> ESTABLISH SSH CONNECTION FOR USER: markh
<192.168.88.10> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“markh”’ -o ConnectTimeout=10 -o ControlPath=/Users/mhorninger/.ansible/cp/ad227640a4 192.168.88.10 ‘/usr/bin/env ash -c ‘"’“‘chmod u+x /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536/ /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536/AnsiballZ_setup.ps1 && sleep 0’”’"’’
<192.168.88.10> (0, b’‘, b’‘)
<192.168.88.10> ESTABLISH SSH CONNECTION FOR USER: markh
<192.168.88.10> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“markh”’ -o ConnectTimeout=10 -o ControlPath=/Users/mhorninger/.ansible/cp/ad227640a4 -tt 192.168.88.10 ‘/usr/bin/env ash -c ‘"’“‘powershell /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536/AnsiballZ_setup.ps1 && sleep 0’”’"’’
<192.168.88.10> (127, b’ash: powershell: not found\r\n’, b’Shared connection to 192.168.88.10 closed.\r\n’)
<192.168.88.10> Failed to connect to the host via ssh: Shared connection to 192.168.88.10 closed.
<192.168.88.10> ESTABLISH SSH CONNECTION FOR USER: markh
<192.168.88.10> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“markh”’ -o ConnectTimeout=10 -o ControlPath=/Users/mhorninger/.ansible/cp/ad227640a4 192.168.88.10 ‘/usr/bin/env ash -c ‘"’“‘rm -f -r /home/markh/.ansible/tmp/ansible-tmp-1596142461.5403461-6592-165134273621536/ > /dev/null 2>&1 && sleep 0’”’"‘’
<192.168.88.10> (0, b’‘, b’')
fatal: [192.168.88.10]: FAILED! => {
“ansible_facts”: {},
“changed”: false,
“failed_modules”: {
“setup”: {
“failed”: true,
“module_stderr”: “Shared connection to 192.168.88.10 closed.\r\n”,
“module_stdout”: “ash: powershell: not found\r\n”,
“msg”: “The module failed to execute correctly, you probably need to set the interpreter.\nSee stdout/stderr for the exact error”,
“rc”: 127
}
},
“msg”: “The following modules failed to execute: setup\n”
}

PLAY RECAP ***************************************************************************************************************************************************************************************************************************************************************************
192.168.88.10 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

Turn off gather_facts. Not quite sure why Mac is turning to pwsh for fact gathering

Thanks!

Now we’re on to the next issue where it apparently cannot access /tmp to create the files.

└> ansible-playbook -i inventory install.yml -vvv
ansible-playbook 2.9.10
config file = /Users/mhorninger/projects/dominion-solutions/awx/installer/ansible.cfg
configured module search path = [‘/Users/mhorninger/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
executable location = /usr/local/bin/ansible-playbook
python version = 3.8.5 (default, Jul 21 2020, 10:48:26) [Clang 11.0.3 (clang-1103.0.32.62)]
Using /Users/mhorninger/projects/dominion-solutions/awx/installer/ansible.cfg as config file
host_list declined parsing /Users/mhorninger/projects/dominion-solutions/awx/installer/inventory as it did not pass its verify_file() method
script declined parsing /Users/mhorninger/projects/dominion-solutions/awx/installer/inventory as it did not pass its verify_file() method
auto declined parsing /Users/mhorninger/projects/dominion-solutions/awx/installer/inventory as it did not pass its verify_file() method
Parsed /Users/mhorninger/projects/dominion-solutions/awx/installer/inventory inventory source with ini plugin
statically imported: /Users/mhorninger/projects/dominion-solutions/awx/installer/roles/local_docker/tasks/upgrade_postgres.yml
[DEPRECATION WARNING]: docker_service is kept for backwards compatibility but usage is discouraged. The module documentation details page may explain more about this rationale… This feature will be removed in a future release. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
statically imported: /Users/mhorninger/projects/dominion-solutions/awx/installer/roles/local_docker/tasks/set_image.yml
statically imported: /Users/mhorninger/projects/dominion-solutions/awx/installer/roles/local_docker/tasks/compose.yml

PLAYBOOK: install.yml ****************************************************************************************************************************************************************************************************************************************************************
1 plays in install.yml

PLAY [Build and deploy AWX] **********************************************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************************************************************************
task path: /Users/mhorninger/projects/dominion-solutions/awx/installer/install.yml:2
ESTABLISH LOCAL CONNECTION FOR USER: mhorninger
EXEC /usr/bin/env sh -c ‘( umask 77 && mkdir -p “echo /tmp/ansible”&& mkdir /tmp/ansible/ansible-tmp-1596147275.5013602-8059-211804918938272 && echo ansible-tmp-1596147275.5013602-8059-211804918938272=“echo /tmp/ansible/ansible-tmp-1596147275.5013602-8059-211804918938272” ) && sleep 0’
fatal: [localhost]: UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in "/tmp", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p "echo /tmp/ansible"&& mkdir /tmp/ansible/ansible-tmp-1596147275.5013602-8059-211804918938272 && echo ansible-tmp-1596147275.5013602-8059-211804918938272="echo /tmp/ansible/ansible-tmp-1596147275.5013602-8059-211804918938272" ), exited with result 1”,
“unreachable”: true
}

PLAY RECAP ***************************************************************************************************************************************************************************************************************************************************************************
localhost : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0

┌[kiwish-4.2]-(awx/installer)-[git:13_installer*]-[68%]
└>

Mark,
First time I heard of a command named “ash” in MacOs, should it be “bash”?

from your ansible.cfg file:

[defaults]
executable=/usr/bin/env **ash**

Regards,

Patricio

Mark,

I’m not sure if AWX is meant to be installed in MacOS. I have it installed in a CentOS VM running in virtualbox.

Having said that, /tmp is a folder owned by root, that’s why you are getting the permissions error:

lrwxr-xr-x@ 1 root admin 11 Oct 8 2019 /tmp → private/tmp

Regards,
Patricio

Hi Patricio,

Thanks for the response. For reference, ash is a version of dash which is a smaller shell. It is the default shell for alpine Linux. The ansible.cfg with that line in it was in a state of flux at the time, as I was abandoning trying to build on MacOS in favor of building on my alpine box, which is what I did at the end of the day. Our company is transitioning from MacOS to Linux Mint, so this is a non-issue for us. Getting the AWX server up was (thought to be) part of the transition. For our purposes, it ended up being much simpler to set up a git repository and set up a cron job that uses: ansible-pull -U

We’re still going to use it for server management purposes, but that’s still in the works.

– Mark