Skip to content

local_action running on jump host when connection delegation is enabled? #251

@Aeon

Description

@Aeon

Hi, and thank you for the awesome project

Trying to get it set up for testing with mitogen_via option, and immediately running into the following when I run my playbook against a small group of hosts:

fatal: [morty2]: UNREACHABLE! => {"changed": false, "msg": "error occurred on host bastion1: Child start failed: [Errno 2] No such file or directory. Command was: \"/webapps/xyzzy/venv/bin/python2.7\" \"-c\" \"import codecs,os,sys;_=codecs.decode;exec(_(_(\\\"eNpd0FFLwzAQB/Bn+yl8u4SF0nRjaKGgFPG9D/ZBRbr0psGsCWm7OD+9Nzo09S2/+1/uSGrRlHZInXbIeOJFiKT314S99Z+MF8kVnbvJ5SwTMsv4n2sRy1MqZytjB2R1DB+jiRFmYH/U3vbPcF8/PmXwWg4nKn6hmsZ2Z3DuIRq2DMSSK2AHPdp37ItBfWA3GfR3rj39Ih3UMW2dM5gqeyhyudnecuAJjQ9ej8ikgIcqe+mpVpVv7PwRnXXY0/PB74CnHtuOSSlvtlzAt3bz5UtTIyAA/ctlWBVnYZnBJpfrNS1aVf/Xy/P6Hzv/gWU=\\\".encode(),\\\"base64\\\"),\\\"zip\\\"))\"", "unreachable": true}
fatal: [morty7]: UNREACHABLE! => {"changed": false, "msg": "error occurred on host bastion1: Child start failed: [Errno 2] No such file or directory. Command was: \"/webapps/xyzzy/venv/bin/python2.7\" \"-c\" \"import codecs,os,sys;_=codecs.decode;exec(_(_(\\\"eNpd0FFLwzAQB/Bn+yl8u4SF0nRjaKGgFPG9D/ZBRbr0psGsCWm7OD+9Nzo09S2/+1/uSGrRlHZInXbIeOJFiKT314S99Z+MF8kVnbvJ5SwTMsv4n2sRy1MqZytjB2R1DB+jiRFmYH/U3vbPcF8/PmXwWg4nKn6hmsZ2Z3DuIRq2DMSSK2AHPdp37ItBfWA3GfR3rj39Ih3UMW2dM5gqeyhyudnecuAJjQ9ej8ikgIcqe+mpVpVv7PwRnXXY0/PB74CnHtuOSSlvtlzAt3bz5UtTIyAA/ctlWBVnYZnBJpfrNS1aVf/Xy/P6Hzv/gWU=\\\".encode(),\\\"base64\\\"),\\\"zip\\\"))\"", "unreachable": true}
fatal: [morty4]: UNREACHABLE! => {"changed": false, "msg": "error occurred on host bastion1: Child start failed: [Errno 2] No such file or directory. Command was: \"/webapps/xyzzy/venv/bin/python2.7\" \"-c\" \"import codecs,os,sys;_=codecs.decode;exec(_(_(\\\"eNpd0FFLwzAQB/Bn+yl8u4SF0nRjaKGgFPG9D/ZBRbr0psGsCWm7OD+9Nzo09S2/+1/uSGrRlHZInXbIeOJFiKT314S99Z+MF8kVnbvJ5SwTMsv4n2sRy1MqZytjB2R1DB+jiRFmYH/U3vbPcF8/PmXwWg4nKn6hmsZ2Z3DuIRq2DMSSK2AHPdp37ItBfWA3GfR3rj39Ih3UMW2dM5gqeyhyudnecuAJjQ9ej8ikgIcqe+mpVpVv7PwRnXXY0/PB74CnHtuOSSlvtlzAt3bz5UtTIyAA/ctlWBVnYZnBJpfrNS1aVf/Xy/P6Hzv/gWU=\\\".encode(),\\\"base64\\\"),\\\"zip\\\"))\"", "unreachable": true}
...

Of course this is because /webapps/xyzzy/venv/bin/python2.7 does not exist on the jump host. However, since it's local_action, shouldn't it still run on localhost?

For reference, the local action is a initial step to ensure that a network-based disk image is mounted before we copy data off it to remote hosts. Looks something like this:

  - name: mount latest source.dmg
    local_action:
      module: shell
      args: |
        if [[ -d /tmp/Project ]]; then
          hdiutil detach /tmp/Project
        fi
        hdiutil attach /Corp/Source/Images/Current/Project.dmg -nobrowse -mountpoint /tmp/Project
    tags:
      - preflight

But I am pretty sure that the content of the action is irrelevant, the issue is that it's trying to execute on jumphost. It would actually even work there, probably, if the interpreter path was correct.

I tried setting ansible_python_interpreter config var for the jumphost, but that did nothing.

Thanks again
Anton

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions