M.Ford
M.Ford

Reputation: 539

Getting a python warning when running playbook EC2 inventory

I am really new to Ansible and I hate getting warnings when I run a playbook. This environment is being used for my education.

Environment:

Inventory

playbook

warning

Things I have tried

I would like to know how to solve this. since I am not running a static inventory, I didn't think that I could specific an interpreter on a per host or group of hosts. While the playbook runs, it seems that something is not configured correctly and I would like to get that sorted. This is only present on the Amazon Linux instances. the Ubuntu instances are fine.

Michael

Upvotes: 16

Views: 27556

Answers (3)

JFFIGK
JFFIGK

Reputation: 682

For me, updating to the most recent version of ansible was enough (ansible [core 2.14.3])

Upvotes: 0

M.Ford
M.Ford

Reputation: 539

Thank you. I did find another route that work though I am sure that you suggest would also work.

I was using the wrong configuration entry. I was using

ansible_python_interpreter = /usr/bin/python

when I should have been using

interpreter_python = /usr/bin/python

on each host I made sure that /usr/bin/python sym link was pointing and the correct version.

according to the documentation

  • for individual hosts and groups, use the ansible_python_interpreter inventory variable
  • globally, use the interpreter_python key in the [defaults] section of ansible.cfg

Regards, Michael.

Upvotes: 13

ikora
ikora

Reputation: 972

You can edit your ansible.cfg and set auto_silent mode:

interpreter_python=auto_silent  

Check reference here: https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html

Upvotes: 14

Related Questions