Skip to content

wait_for_connection to localhost explicitly specified in the inventory and ansible_python_interpreter set to ansible_playbook_python fails with 'timed out waiting for ping module test: 'int' object has no attribute 'template'"' #1079

@pstrzelczak

Description

@pstrzelczak

Reproduction steps:

$ docker run --rm -it rockylinux:8.9.20231119 bash
$ yum install -y python38
$ pip3 install ansible==6.7.0
$ pip3 install mitogen=0.3.7
$ ANSIBLE_STRATEGY_PLUGINS=/usr/local/lib/python3.8/site-packages/ansible_mitogen/plugins/strategy ANSIBLE_STRATEGY=mitogen_linear ansible -i /tmp/hosts.yml localhost -m ansible.builtin.wait_for_connection -vvv

where

# $ cat /tmp/hosts.yml 
all:
        hosts:
                localhost:
                        ansible_connection: local
                        ansible_python_interpreter: "{{ ansible_playbook_python }}"

Result:

localhost | FAILED! => {
    "changed": false,
    "elapsed": 600,
    "msg": "timed out waiting for ping module test: 'int' object has no attribute 'template'"
}

Suprisingly, with implicit inventory it works fine:

$ ANSIBLE_STRATEGY_PLUGINS=/usr/local/lib/python3.8/site-packages/ansible_mitogen/plugins/strategy ANSIBLE_STRATEGY=mitogen_linear ansible localhost -m ansible.builtin.wait_for_connection
[WARNING]: No inventory was parsed, only implicit localhost is available
localhost | SUCCESS => {
    "changed": false,
    "elapsed": 0
}
  • Which version of Ansible are you running?
$ ansible --version
ansible [core 2.13.13]
(...)
  python version = 3.8.17 (default, Aug 10 2023, 18:03:39) [GCC 8.5.0 20210514 (Red Hat 8.5.0-20)]
  jinja version = 3.1.3
  libyaml = True
  • Is your version of Ansible patched in any way?
    No

  • Are you running with any custom modules, or module_utils loaded?
    No

  • Have you tried the latest master version from Git?
    Yes

  • Do you have some idea of what the underlying problem may be?
    https://mitogen.networkgenomics.com/ansible_detailed.html#common-problems has
    instructions to help figure out the likely cause and how to gather relevant
    logs.
    No

  • Mention your host and target OS and versions
    Rocky 8.8

  • Mention your host and target Python versions
    Python 3.8

  • If reporting a performance issue, mention the number of targets and a rough
    description of your workload (lots of copies, lots of tiny file edits, etc.)

  • If reporting a crash or hang in Ansible, please rerun with -vvv and include
    200 lines of output around the point of the error, along with a full copy of
    any traceback or error text in the log. Beware "-vvv" may include secret
    data! Edit as necessary before posting.

  • If reporting any kind of problem with Ansible, please include the Ansible
    version along with output of "ansible-config dump --only-changed".
    Empty

EDIT: 2024-10-07 @moreati Syntax highlighting

Metadata

Metadata

Assignees

No one assigned

    Labels

    DesignRequiredIssues that cannot progress due to incomplete designaffects-0.3Issues related to 0.3.X Mitogen releasesbugCode feature that hinders desired execution outcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions