Les nouveautés d'Ansible 4.0
Publié le :

Après la version 3.0, qui a marqué le changement de packaging d’Ansible, voici la version 4.0. Comme annoncé, elle est basée sur Ansible-base 2.11 et contient toute une série de mises à jour sur les collections incluses. Vous pouvez retrouver la liste complète ici :
Si on parcourt la liste des changements, on remarque que beaucoup de ménage a été fait dans les modules. Donc faites attention lors de la migration, car certains de vos rôles ou playbooks risquent de ne plus fonctionner !
Ansible-test a beaucoup évolué et supporte beaucoup plus de systèmes d’exploitation qu’auparavant (RHEL 8.3, MacOS 11.1, …)
Comment Installer Ansible 4.0.0
Attention si vous avez déjà installé ansible avec pip, il faudra la désinstaller
en premier. De plus, python 3.8 est requis sur le node controller d’Ansible.
*Upgrading directly from ansible-2.10, ansible-3, or ansible-base-2.10 to ansible-4**or greater with pip is known to cause problems. Please uninstall the old version ... *Comment procéder ?
pip3 uninstall ansiblepip3 install ansibleCollecting ansible==4.0.0 Downloading ansible-4.0.0.tar.gz (33.3 MB) |████████████████████████████████| 33.3 MB 5.3 MB/sCollecting ansible-core<2.12,>=2.11.0 Downloading ansible-core-2.11.0.tar.gz (5.8 MB) |████████████████████████████████| 5.8 MB 27.3 MB/sCollecting PyYAML Downloading PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl (662 kB) |████████████████████████████████| 662 kB 3.2 MB/sCollecting cryptography Downloading cryptography-3.4.7-cp36-abi3-manylinux2014_x86_64.whl (3.2 MB) |████████████████████████████████| 3.2 MB 3.4 MB/sCollecting jinja2 Downloading Jinja2-3.0.1-py3-none-any.whl (133 kB) |████████████████████████████████| 133 kB 4.6 MB/sCollecting packaging Downloading packaging-20.9-py2.py3-none-any.whl (40 kB) |████████████████████████████████| 40 kB 3.5 MB/sCollecting resolvelib<0.6.0,>=0.5.3 Downloading resolvelib-0.5.4-py2.py3-none-any.whl (12 kB)Collecting cffi>=1.12 Downloading cffi-1.14.5-cp38-cp38-manylinux1_x86_64.whl (411 kB) |████████████████████████████████| 411 kB 3.9 MB/sCollecting MarkupSafe>=2.0 Downloading MarkupSafe-2.0.1-cp38-cp38-manylinux2010_x86_64.whl (30 kB)Collecting pyparsing>=2.0.2 Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB) |████████████████████████████████| 67 kB 3.7 MB/sCollecting pycparser Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB) |████████████████████████████████| 112 kB 5.6 MB/sBuilding wheels for collected packages: ansible, ansible-core Building wheel for ansible (setup.py) ... done Created wheel for ansible: filename=ansible-4.0.0-py3-none-any.whl size=54846321 sha256=2b9edcb60252103bce1ff3421cf82ffa5498fd99b7fb2f60801593c30a349716 Stored in directory: /root/.cache/pip/wheels/38/b0/6a/98e4da2701736a44647d463f1fa8b37d1c4598957cfc1ccd01 Building wheel for ansible-core (setup.py) ... done Created wheel for ansible-core: filename=ansible_core-2.11.0-py3-none-any.whl size=1949171 sha256=21f1a6e19149010476a2d8d219ddebb45acaa7a663dc954fc85a6b162bce3d10 Stored in directory: /root/.cache/pip/wheels/48/df/48/094515609ba2d4f4cdd8702b0fbe162286d4c2cc95342b653cSuccessfully built ansible ansible-coreInstalling collected packages: PyYAML, pycparser, cffi, cryptography, MarkupSafe, jinja2, pyparsing, packaging, resolvelib, ansible-core, ansibleSuccessfully installed MarkupSafe-2.0.1 PyYAML-5.4.1 ansible-4.0.0 ansible-core-2.11.0 cffi-1.14.5 cryptography-3.4.7 jinja2-3.0.1 packaging-20.9 pycparser-2.20 pyparsing-2.4.7 resolvelib-0.5.4Quels sont les modules disponibles ?
Il suffit de lancer la commande ansible-galaxy pour lister les collections installés par défaut :
ansible-galaxy collection list
Collection Version----------------------------- -------amazon.aws 1.5.0ansible.netcommon 2.0.2ansible.posix 1.2.0ansible.utils 2.1.0ansible.windows 1.5.0arista.eos 2.1.1awx.awx 19.0.0azure.azcollection 1.5.0check_point.mgmt 2.0.0chocolatey.chocolatey 1.1.0cisco.aci 2.0.0cisco.asa 2.0.1cisco.intersight 1.0.15cisco.ios 2.0.1cisco.iosxr 2.1.0cisco.meraki 2.2.1cisco.mso 1.1.0cisco.nso 1.0.3cisco.nxos 2.2.0cisco.ucs 1.6.0cloudscale_ch.cloud 2.1.0community.aws 1.5.0community.azure 1.0.0community.crypto 1.6.2community.digitalocean 1.1.1community.docker 1.5.0community.fortios 1.0.0community.general 3.0.2community.google 1.0.0community.grafana 1.2.1community.hashi_vault 1.1.3community.hrobot 1.1.1community.kubernetes 1.2.1community.kubevirt 1.0.0community.libvirt 1.0.1community.mongodb 1.2.1community.mysql 2.1.0community.network 3.0.0community.okd 1.1.2community.postgresql 1.2.0community.proxysql 1.0.0community.rabbitmq 1.0.3community.routeros 1.1.0community.skydive 1.0.0community.sops 1.0.6community.vmware 1.9.0community.windows 1.3.0community.zabbix 1.3.0containers.podman 1.5.0cyberark.conjur 1.1.0cyberark.pas 1.0.6dellemc.enterprise_sonic 1.0.3dellemc.openmanage 3.3.0dellemc.os10 1.1.1dellemc.os6 1.0.7dellemc.os9 1.0.4f5networks.f5_modules 1.9.0fortinet.fortimanager 2.0.2fortinet.fortios 2.0.1frr.frr 1.0.3gluster.gluster 1.0.1google.cloud 1.0.2hetzner.hcloud 1.4.3hpe.nimble 1.1.3ibm.qradar 1.0.3infinidat.infinibox 1.2.4inspur.sm 1.1.4junipernetworks.junos 2.1.0kubernetes.core 1.2.1mellanox.onyx 1.0.0netapp.aws 21.2.0netapp.azure 21.5.0netapp.cloudmanager 21.5.1netapp.elementsw 21.3.0netapp.ontap 21.5.0netapp.um_info 21.5.0netapp_eseries.santricity 1.2.7netbox.netbox 3.0.0ngine_io.cloudstack 2.1.0ngine_io.exoscale 1.0.0ngine_io.vultr 1.1.0openstack.cloud 1.4.0openvswitch.openvswitch 2.0.0ovirt.ovirt 1.4.2purestorage.flasharray 1.8.0purestorage.flashblade 1.6.0sensu.sensu_go 1.9.4servicenow.servicenow 1.0.5splunk.es 1.0.2t_systems_mms.icinga_director 1.16.0theforeman.foreman 2.0.1vyos.vyos 2.2.0wti.remote 1.0.1ansible --versionansible [core 2.11.0] config file = None configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible python version = 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0] jinja version = 3.0.1 libyaml = TrueSi vous voulez plus de tutorials Ansible je vous renvoie sur le billet de l’introduction à ansible