mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-12 11:57:39 -02:30
Define and implement specs for bootstrap-os (#4455)
* Add README to bootstrap-os role * Rework bootstrap-os once more * Document workarounds for bugs/deficiencies in Ansible modules * Unify and document role variables * Remove installation of additional packages and repositories * Merge Ubuntu and Debian tasks * Remove pipelining setting from default playbooks * Fix OpenSUSE not running its required tasks
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
d588532c9b
commit
76db060afb
@@ -1,22 +1,46 @@
|
||||
---
|
||||
# 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 "{{ item }}"
|
||||
raw: which python
|
||||
register: need_bootstrap
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
with_items:
|
||||
- python
|
||||
environment: {}
|
||||
tags: facts
|
||||
tags:
|
||||
- facts
|
||||
|
||||
# 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
|
||||
- name: Install python on fedora
|
||||
raw: "dnf install --assumeyes --quiet python"
|
||||
raw: "dnf install --assumeyes --quiet python2"
|
||||
become: true
|
||||
environment: {}
|
||||
when: need_bootstrap.results | map(attribute='rc') | sort | last | bool
|
||||
when:
|
||||
- need_bootstrap.rc != 0
|
||||
- not is_atomic
|
||||
|
||||
- name: Install required python packages
|
||||
dnf:
|
||||
# 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:
|
||||
name: libselinux-python
|
||||
state: present
|
||||
become: true
|
||||
when:
|
||||
- not is_atomic
|
||||
|
||||
Reference in New Issue
Block a user