mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-28 09:39:12 +03:00
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
@@ -7,58 +7,61 @@
|
||||
check_mode: false
|
||||
environment: {}
|
||||
|
||||
- include_tasks: bootstrap-ubuntu.yml
|
||||
when: '"Ubuntu" in os_release.stdout'
|
||||
- include_tasks: bootstrap-centos.yml
|
||||
when: '"CentOS" in os_release.stdout or "Red Hat Enterprise Linux" in os_release.stdout'
|
||||
|
||||
- include_tasks: bootstrap-debian.yml
|
||||
when: '"Debian" in os_release.stdout'
|
||||
- include_tasks: bootstrap-clearlinux.yml
|
||||
when: '"Clear Linux OS" in os_release.stdout'
|
||||
|
||||
- include_tasks: bootstrap-coreos.yml
|
||||
when: '"CoreOS" in os_release.stdout'
|
||||
|
||||
- include_tasks: bootstrap-debian.yml
|
||||
when: '"Debian" in os_release.stdout or "Ubuntu" in os_release.stdout'
|
||||
|
||||
- include_tasks: bootstrap-fedora.yml
|
||||
when: '"Fedora" in os_release.stdout'
|
||||
|
||||
- include_tasks: bootstrap-centos.yml
|
||||
when: '"CentOS" in os_release.stdout or "Red Hat Enterprise Linux" in os_release.stdout'
|
||||
|
||||
- include_tasks: bootstrap-opensuse.yml
|
||||
when: '"openSUSE" in os_release.stdout'
|
||||
|
||||
- include_tasks: bootstrap-clearlinux.yml
|
||||
when: '"Clear Linux OS" in os_release.stdout'
|
||||
|
||||
- name: Create remote_tmp for it is used by another module
|
||||
file:
|
||||
path: "{{ ansible_remote_tmp | default('~/.ansible/tmp') }}"
|
||||
state: directory
|
||||
mode: 0700
|
||||
|
||||
- name: Gather nodes hostnames
|
||||
# Workaround for https://github.com/ansible/ansible/issues/42726
|
||||
# (1/3)
|
||||
- name: Gather host facts to get ansible_os_family
|
||||
setup:
|
||||
gather_subset: '!all'
|
||||
filter: ansible_*
|
||||
|
||||
- name: Assign inventory name to unconfigured hostnames (non-CoreOS and Tumbleweed)
|
||||
- name: Assign inventory name to unconfigured hostnames (non-CoreOS, Suse and ClearLinux)
|
||||
hostname:
|
||||
name: "{{ inventory_hostname }}"
|
||||
when:
|
||||
- override_system_hostname
|
||||
- ansible_os_family not in ['Suse', 'CoreOS', 'Container Linux by CoreOS', 'ClearLinux']
|
||||
- ansible_os_family not in ['Suse', 'Container Linux by CoreOS', 'ClearLinux']
|
||||
|
||||
- name: Assign inventory name to unconfigured hostnames (CoreOS and Tumbleweed only)
|
||||
# (2/3)
|
||||
- name: Assign inventory name to unconfigured hostnames (CoreOS, Suse and ClearLinux only)
|
||||
command: "hostnamectl set-hostname {{ inventory_hostname }}"
|
||||
register: hostname_changed
|
||||
changed_when: false
|
||||
when:
|
||||
- override_system_hostname
|
||||
- ansible_os_family in ['Suse', 'CoreOS', 'Container Linux by CoreOS', 'ClearLinux']
|
||||
- ansible_os_family in ['Suse', 'Container Linux by CoreOS', 'ClearLinux']
|
||||
|
||||
- name: Update hostname fact (CoreOS and Tumbleweed only)
|
||||
# (3/3)
|
||||
- name: Update hostname fact (CoreOS, Suse and ClearLinux only)
|
||||
setup:
|
||||
gather_subset: '!all'
|
||||
filter: ansible_hostname
|
||||
when:
|
||||
- hostname_changed.changed
|
||||
- override_system_hostname
|
||||
- ansible_os_family in ['Suse', 'Container Linux by CoreOS', 'ClearLinux']
|
||||
|
||||
- name: "Install ceph-commmon package"
|
||||
package:
|
||||
|
||||
Reference in New Issue
Block a user