2016-09-06 14:04:41 +00:00
|
|
|
---
|
2018-01-29 11:37:48 +00:00
|
|
|
- import_tasks: bootstrap-ubuntu.yml
|
2016-09-07 18:19:46 +00:00
|
|
|
when: bootstrap_os == "ubuntu"
|
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- import_tasks: bootstrap-debian.yml
|
2017-10-03 07:30:45 +00:00
|
|
|
when: bootstrap_os == "debian"
|
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- import_tasks: bootstrap-coreos.yml
|
2016-12-09 09:38:45 +00:00
|
|
|
when: bootstrap_os == "coreos"
|
|
|
|
|
2018-09-19 17:57:20 +00:00
|
|
|
- import_tasks: bootstrap-fedora.yml
|
|
|
|
when: bootstrap_os == "fedora"
|
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- import_tasks: bootstrap-centos.yml
|
2016-12-07 16:16:06 +00:00
|
|
|
when: bootstrap_os == "centos"
|
|
|
|
|
2018-04-26 09:52:06 +00:00
|
|
|
- import_tasks: bootstrap-opensuse.yml
|
|
|
|
when: bootstrap_os == "opensuse"
|
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- import_tasks: setup-pipelining.yml
|
2017-02-24 21:41:27 +00:00
|
|
|
|
|
|
|
- name: check if atomic host
|
|
|
|
stat:
|
|
|
|
path: /run/ostree-booted
|
|
|
|
register: ostree
|
|
|
|
|
|
|
|
- set_fact:
|
2017-03-27 10:27:15 +00:00
|
|
|
is_atomic: "{{ ostree.stat.exists }}"
|
|
|
|
|
|
|
|
- name: Gather nodes hostnames
|
|
|
|
setup:
|
|
|
|
gather_subset: '!all'
|
2017-09-06 12:10:52 +00:00
|
|
|
filter: ansible_*
|
2017-03-27 10:27:15 +00:00
|
|
|
|
2018-04-26 09:52:06 +00:00
|
|
|
- name: Assign inventory name to unconfigured hostnames (non-CoreOS and Tumbleweed)
|
2017-03-27 10:27:15 +00:00
|
|
|
hostname:
|
|
|
|
name: "{{inventory_hostname}}"
|
2018-04-26 09:52:06 +00:00
|
|
|
when:
|
|
|
|
- override_system_hostname
|
|
|
|
- ansible_distribution not in ['openSUSE Tumbleweed']
|
|
|
|
- ansible_os_family not in ['CoreOS', 'Container Linux by CoreOS']
|
2017-09-06 12:10:52 +00:00
|
|
|
|
2018-04-26 09:52:06 +00:00
|
|
|
- name: Assign inventory name to unconfigured hostnames (CoreOS and Tumbleweed only)
|
2017-09-06 12:10:52 +00:00
|
|
|
command: "hostnamectl set-hostname {{inventory_hostname}}"
|
|
|
|
register: hostname_changed
|
2018-04-26 09:52:06 +00:00
|
|
|
when:
|
|
|
|
- ansible_hostname == 'localhost'
|
|
|
|
- ansible_distribution in ['openSUSE Tumbleweed'] or ansible_os_family in ['CoreOS', 'Container Linux by CoreOS']
|
|
|
|
- override_system_hostname
|
2017-09-06 12:10:52 +00:00
|
|
|
|
2018-04-26 09:52:06 +00:00
|
|
|
- name: Update hostname fact (CoreOS and Tumbleweed only)
|
2017-09-06 12:10:52 +00:00
|
|
|
setup:
|
|
|
|
gather_subset: '!all'
|
|
|
|
filter: ansible_hostname
|
2018-04-26 09:52:06 +00:00
|
|
|
when:
|
|
|
|
- hostname_changed.changed
|