2018-09-20 01:57:20 +08:00
|
|
|
---
|
2019-04-24 06:46:02 +08:00
|
|
|
# Some Fedora based distros ship without Python installed
|
|
|
|
|
2019-02-12 06:04:27 +08:00
|
|
|
- name: Check if bootstrap is needed
|
2019-04-24 06:46:02 +08:00
|
|
|
raw: which python
|
2018-09-20 01:57:20 +08:00
|
|
|
register: need_bootstrap
|
|
|
|
failed_when: false
|
|
|
|
changed_when: false
|
2019-04-24 06:46:02 +08:00
|
|
|
tags:
|
|
|
|
- facts
|
2018-09-20 01:57:20 +08:00
|
|
|
|
2021-01-08 02:50:53 +08:00
|
|
|
- name: Add proxy to dnf.conf if http_proxy is defined
|
2023-06-26 18:15:45 +08:00
|
|
|
community.general.ini_file:
|
2021-01-08 02:50:53 +08:00
|
|
|
path: "/etc/dnf/dnf.conf"
|
|
|
|
section: main
|
|
|
|
option: proxy
|
|
|
|
value: "{{ http_proxy | default(omit) }}"
|
|
|
|
state: "{{ http_proxy | default(False) | ternary('present', 'absent') }}"
|
|
|
|
no_extra_spaces: true
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0644"
|
2019-05-03 03:28:22 +08:00
|
|
|
become: true
|
2021-01-08 02:50:53 +08:00
|
|
|
when: not skip_http_proxy_on_os_packages
|
2019-05-03 03:28:22 +08:00
|
|
|
|
2020-04-18 21:35:36 +08:00
|
|
|
# libselinux-python3 is required on SELinux enabled hosts
|
2019-04-24 06:46:02 +08:00
|
|
|
# See https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#managed-node-requirements
|
2024-03-29 06:17:52 +08:00
|
|
|
- name: Install ansible requirements
|
|
|
|
raw: "dnf install --assumeyes python3 python3-dnf libselinux-python3"
|
2019-02-12 06:04:27 +08:00
|
|
|
become: true
|
2024-03-29 06:17:52 +08:00
|
|
|
when:
|
|
|
|
- need_bootstrap.rc != 0
|