Bug 1567995 - Ansible cannot manage localhost
Summary: Ansible cannot manage localhost
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: ansible
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kevin Fenzi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1567996
TreeView+ depends on / blocked
 
Reported: 2018-04-16 14:27 UTC by Andrei Stepanov
Modified: 2018-04-16 19:57 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1567996 (view as bug list)
Environment:
Last Closed: 2018-04-16 19:57:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Andrei Stepanov 2018-04-16 14:27:43 UTC
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"
}

Comment 1 Andrei Stepanov 2018-04-16 19:57:13 UTC
We define `localhost` explicitly. As a result, we must set `ansible_python_interpreter` too.


Note You need to log in before you can comment on or make changes to this bug.