ansible_host: Fix running ansible on latest el9

Newest ansible version on el9 uses python 3.11 but netaddr package is
not yet packaged for it. This patch will install python 3.9 netaddr
package and copy library files from there.
This commit is contained in:
Timo Makinen 2023-06-18 18:06:37 +00:00
parent c58406959e
commit 3a48849a29

View file

@ -7,8 +7,28 @@
- ansible
- ansible-collection-ansible-posix
- ansible-collection-community-general
- python3-dns # required for lookup('dig', 'hostname')
- python3-netaddr # required by iptables role
- python3.11-dns # required for lookup('dig', 'hostname')
- python3-netaddr # required by iptables role
- name: Create python3.11 lib directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: 0755
owner: root
group: "{{ ansible_wheel }}"
with_items:
- /usr/local/lib/python3.11
- /usr/local/lib/python3.11/site-packages
- name: Kludge to add netaddr to python3.11 until package is released
ansible.builtin.copy:
dest: /usr/local/lib/python3.11/site-packages/netaddr
src: /usr/lib/python3.9/site-packages/netaddr
mode: preserve
owner: root
group: "{{ ansible_wheel }}"
remote_src: true
- name: Create private directory and force permissions
ansible.builtin.file: