1

all,

A very simple playbook,

---
- hosts: localhost
  gather_facts: yes
  vars:

  tasks:
    #- setup:
    - debug: msg = "Hostname is {{ ansible_hostname }}"

when I set "gather_facts" to "yes", then ansible-playbook reports the below error:

fatal: [localhost]: FAILED! => {"msg": "module (setup) is missing interpreter line"}

I know it's related to the "setup" module, but don't have a clue to dig it. Did anyone meet the similar issue before? Or any suggestion? Thanks.

2

3 Answers 3

1

This is a reported bug for ansible. The issue can be seen here. Although there is a pull request merged in the mainline code for this (see here), if the issue is not fixed for you, would be good to re-open it. Also, try the fixed provided in the Common issues section here.

1

I think this command will help you to resolve this issue

$ export ANSIBLE_LIBRARY=/

Ansible will search for modules at the path specified.

1
  • 1
    Please explain your answer so future users can understand better and benefit from your answer
    – Jayme
    Jan 17, 2020 at 8:03
0

unset ANSIBLE_LIBRARY

ANSIBLE_LIBRARY was set to a bad path which was causing this error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.