2018-09-19 17:57:20 +00:00
|
|
|
---
|
2019-04-23 22:46:02 +00:00
|
|
|
# Some Fedora based distros ship without Python installed
|
|
|
|
|
2019-02-11 22:04:27 +00:00
|
|
|
- name: Check if bootstrap is needed
|
2019-04-23 22:46:02 +00:00
|
|
|
raw: which python
|
2018-09-19 17:57:20 +00:00
|
|
|
register: need_bootstrap
|
|
|
|
failed_when: false
|
|
|
|
changed_when: false
|
2019-04-23 22:46:02 +00:00
|
|
|
tags:
|
|
|
|
- facts
|
2018-09-19 17:57:20 +00:00
|
|
|
|
2021-01-07 18:50:53 +00:00
|
|
|
- name: Add proxy to dnf.conf if http_proxy is defined
|
|
|
|
ini_file:
|
|
|
|
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
|
2021-07-12 07:00:47 +00:00
|
|
|
mode: 0644
|
2019-05-02 19:28:22 +00:00
|
|
|
become: true
|
2021-01-07 18:50:53 +00:00
|
|
|
when: not skip_http_proxy_on_os_packages
|
2019-05-02 19:28:22 +00:00
|
|
|
|
2020-04-18 13:35:36 +00:00
|
|
|
- name: Install python3 on fedora
|
|
|
|
raw: "dnf install --assumeyes --quiet python3"
|
2019-02-11 22:04:27 +00:00
|
|
|
become: true
|
2019-04-23 22:46:02 +00:00
|
|
|
when:
|
|
|
|
- need_bootstrap.rc != 0
|
2018-09-19 17:57:20 +00:00
|
|
|
|
2020-04-18 13:35:36 +00:00
|
|
|
# libselinux-python3 is required on SELinux enabled hosts
|
2019-04-23 22:46:02 +00:00
|
|
|
# See https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#managed-node-requirements
|
2020-04-18 13:35:36 +00:00
|
|
|
- name: Install libselinux-python3
|
2019-04-23 22:46:02 +00:00
|
|
|
package:
|
2020-04-18 13:35:36 +00:00
|
|
|
name: libselinux-python3
|
2018-09-19 17:57:20 +00:00
|
|
|
state: present
|
2019-02-11 22:04:27 +00:00
|
|
|
become: true
|