I changed the Python 2 to Python 3. I felt the benefits of Asyncio.
Earlier in my project I used Ansible, but it is not supported with Python 3. Can you recommend to me an alternative to Ansible for Python 3?
Ansible will automatically detect and use Python 3 on many platforms that ship with it. To explicitly configure a Python 3 interpreter, set the ansible_python_interpreter inventory variable at a group or host level to the location of a Python 3 interpreter, such as /usr/bin/python3.
While you can write Ansible modules in any language, most Ansible modules are written in Python, including the ones central to letting Ansible work. By default, Ansible assumes it can find a /usr/bin/python on your remote system that is either Python2, version 2.6 or higher or Python3, 3.5 or higher.
Python is quicker than Ansible, but that might not be a problem if you don't have 1000's of devices to automate. Both use human readable code, but Ansible is considered to be more human readable with it's YAML playbooks.
As of 2.2, Ansible works with Python 3. Yep, you may encounter some bugs but any patch related to py3 will be quickly reviewed and merged by the team. I already fixed two that I encountered myself.
Edit: as of Ansible 2.2 this answer is no longer accurate.
The best answer here is to have both versions of Python installed, possibly running Python 2 and Ansible in a virtualenv.
It's possible that Ansible will be refactored for Python 3 but it's unlikely for now, and there is no Alternative in Python 3. If you don't want to use Ansible on Python2, you'll need to switch to another tool like Saltstack, Chef, or Puppet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With