mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-15 22:34:21 +03:00
Automatically infer bootstrap_os (#3498)
* Automatically infer bootstrap_os * Rename bootstrap os to os_family
This commit is contained in:
committed by
k8s-ci-robot
parent
e813b26963
commit
3f786542d3
@@ -1,4 +1,25 @@
|
||||
---
|
||||
- name: Fetch /etc/os-release
|
||||
raw: cat /etc/os-release
|
||||
register: os_release
|
||||
changed_when: false
|
||||
|
||||
- name: Set bootstrap_os
|
||||
set_fact:
|
||||
os_family: >-
|
||||
{%- if 'Ubuntu' in os_release.stdout -%}
|
||||
ubuntu
|
||||
{%- elif 'Debian' in os_release.stdout -%}
|
||||
debian
|
||||
{%- elif 'CoreOS' in os_release.stdout -%}
|
||||
coreos
|
||||
{%- elif 'Fedora' in os_release.stdout -%}
|
||||
fedora
|
||||
{%- elif 'CentOS' in os_release.stdout -%}
|
||||
centos
|
||||
{%- elif 'OpenSUSE' in os_release.stdout -%}
|
||||
opensuse
|
||||
{% endif %}
|
||||
|
||||
- include_tasks: bootstrap-ubuntu.yml
|
||||
when: os_family == "ubuntu"
|
||||
|
||||
Reference in New Issue
Block a user