January 2020 Support for python2 was stopped. But some tools you still have to force to use python3 (maybe, because the python2 ist still the default on my distribution?)
Ansible is one of these cases …
This small shell script forces ansible to use python3 on the control computer.
If you have strange effects with modules: I had to install some libraries for python3 (pip3 install) and had to delete a certain .pyc file in that module.
#!/usr/bin/bash # use ansible with python3 dir="/usr/local/packages/ansible/bin" me=$(basename "$0") case $me in ansible) python3 $dir/$me "$@" ;; ansible-playbook) python3 $dir/$me "$@" ;; ansible-pull) python3 $dir/$me "$@" ;; ansible-doc) python3 $dir/$me "$@" ;; *) # do nothing ;; esac
Don't forget the matching symlinks for ansible-playbook
, ansible-pull
and ansible-doc
….
Valid for all tips, tricks and cheat sheets:
these are simple notes for my personal use,
here readable for all in the hope it
might help someone else, too.
Use at your own risk
Hints, error reports, thanks , etc. send please to: web.21@unixwitch.de
more at: System Administration