clusterinthecloud / terraform

Terraform config for Cluster in the Cloud
https://cluster-in-the-cloud.readthedocs.io
MIT License
20 stars 23 forks source link

Update the version of Ansible #74

Closed milliams closed 1 year ago

milliams commented 1 year ago

This updates Ansible to version 8 (from version 7). Previously Ansible was installed from RPM (e.g. EPEL started providing it one day and bumped the version from 2.9 to ~7) but now we install it from PyPI (this is aided by the fact that it's now available as a wheel so installation is faster). To aid this we explicitly use a newer version of Python (new Ansible doesn't support Python 3.6 any more) and install it in a virtual environment.

Since Ansible isn't installed from RPM any more, we need to make the /etc/ansible directory ourselves.

Ansible also has the concept of the "control node" and the "managed node". The control node is where ansible-playbook is run from, and the managed node is the machine that it is affecting. You can have a different Python interpreter in those two cases (even if they are the same physical node). The Python version requirements for the managed node are lower (Python >= 3.5) and so we can have Ansible run its tasks on the system Python which is useful as that's where things like the LDAP and SELinux Python wrappers are installed. This is why we set the ansible_python_interpreter to /usr/bin/python3.

This is linked to clusterinthecloud/ansible#135