I was able to resolve this by changing the Python interpreter in ansible.cfg from /usr/bin/python3 to /usr/bin/python