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:
parent
c58406959e
commit
3a48849a29
1 changed files with 22 additions and 2 deletions
|
@ -7,9 +7,29 @@
|
|||
- ansible
|
||||
- ansible-collection-ansible-posix
|
||||
- ansible-collection-community-general
|
||||
- python3-dns # required for lookup('dig', 'hostname')
|
||||
- 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:
|
||||
path: /export/private
|
||||
|
|
Loading…
Add table
Reference in a new issue