kubespray/roles/bootstrap-os/tasks/bootstrap-fedora.yml

47 lines
1.1 KiB
YAML
Raw Normal View History

2018-09-20 01:57:20 +08:00
---
# Some Fedora based distros ship without Python installed
- name: Check if this is an atomic host
raw: stat /run/ostree-booted
register: ostree
environment: {}
failed_when: false
changed_when: false
tags:
- facts
- name: Store the fact if this is an atomic host
set_fact:
is_atomic: "{{ ostree.rc == 0 }}"
tags:
- facts
- name: Check if bootstrap is needed
raw: which python
2018-09-20 01:57:20 +08:00
register: need_bootstrap
failed_when: false
changed_when: false
environment: {}
tags:
- facts
2018-09-20 01:57:20 +08:00
# Fedora's policy as of Fedora 30 is to still install python2 as /usr/bin/python
# See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 for the current status
2018-09-20 01:57:20 +08:00
- name: Install python on fedora
raw: "dnf install --assumeyes --quiet python2"
become: true
environment: {}
when:
- need_bootstrap.rc != 0
- not is_atomic
2018-09-20 01:57:20 +08:00
# libselinux-python is required on SELinux enabled hosts
# See https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#managed-node-requirements
- name: Install libselinux-python
package:
2018-09-20 01:57:20 +08:00
name: libselinux-python
state: present
become: true
when:
- not is_atomic