Automatically infer bootstrap_os (#3498)

* Automatically infer bootstrap_os

* Rename bootstrap os to os_family
This commit is contained in:
Giacomo Longo
2018-10-11 08:32:10 +02:00
committed by k8s-ci-robot
parent e813b26963
commit 3f786542d3
22 changed files with 31 additions and 43 deletions

View File

@@ -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"