I have a playbook like this, I tried to run it in ansible awx as job template but got an Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-tmp-1609214869.41401-6813-56941014390086/rhv-snapshots.py\", line 4, in <module>\n from prettytable import PrettyTable\nModuleNotFoundError: No module named 'prettytable'
error, it works using ansible CLI but in awx didn't. any idea?
---
- hosts: localhost
tasks:
- name: "Creating Script..."
copy:
content: |
#!/usr/bin/python3
import xml.etree.ElementTree as ET
from prettytable import PrettyTable
print('hello world!')
dest: /tmp/test.py
mode: 777
- name: "Running Script..."
script: /tmp/test.py
register: output
- debug:
var: output.stdout_lines