Ansible cannot manage localhost system without tweaking, ansible uses /usr/bin/python by default, which is not available on Rawhide. ansible-2.5.0-2.fc29.noarch # ansible -i localhost, all -m ping --extra-vars "ansible_connection=local" localhost | FAILED! => { "changed": false, "module_stderr": "/bin/sh: /usr/bin/python: No such file or directory\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 127 } # ls /usr/bin/python* /usr/bin/python3 /usr/bin/python3.6 /usr/bin/python3.6m /usr/bin/python3-chardetect # cat /etc/os-release NAME=Fedora VERSION="29 (Cloud Edition)" ID=fedora VERSION_ID=29 PRETTY_NAME="Fedora 29 (Cloud Edition)" ANSI_COLOR="0;34" CPE_NAME="cpe:/o:fedoraproject:fedora:29" HOME_URL="https://fedoraproject.org/" SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Fedora" REDHAT_BUGZILLA_PRODUCT_VERSION=rawhide REDHAT_SUPPORT_PRODUCT="Fedora" REDHAT_SUPPORT_PRODUCT_VERSION=rawhide PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy" VARIANT="Cloud Edition" VARIANT_ID=cloud User must specify extra parameters, which is not intuitive: # ansible -i localhost, all -m ping --extra-vars "ansible_connection=local" --extra-vars ansible_python_interpreter=/usr/bin/python3 localhost | SUCCESS => { "changed": false, "ping": "pong" }
We define `localhost` explicitly. As a result, we must set `ansible_python_interpreter` too.