2016-09-06 14:04:41 +00:00
|
|
|
---
|
2016-09-07 18:19:46 +00:00
|
|
|
- include: bootstrap-ubuntu.yml
|
|
|
|
when: bootstrap_os == "ubuntu"
|
|
|
|
|
2017-10-03 07:30:45 +00:00
|
|
|
- include: bootstrap-debian.yml
|
|
|
|
when: bootstrap_os == "debian"
|
|
|
|
|
2016-09-06 14:04:41 +00:00
|
|
|
- include: bootstrap-coreos.yml
|
2016-12-09 09:38:45 +00:00
|
|
|
when: bootstrap_os == "coreos"
|
|
|
|
|
2016-12-07 16:16:06 +00:00
|
|
|
- include: bootstrap-centos.yml
|
|
|
|
when: bootstrap_os == "centos"
|
|
|
|
|
2017-10-18 16:28:54 +00:00
|
|
|
- task:
|
|
|
|
debug:
|
|
|
|
msg: "bootstrap_os: {{ bootstrap_os|d('') }}"
|
|
|
|
|
2017-02-24 21:41:27 +00:00
|
|
|
- include: setup-pipelining.yml
|
|
|
|
|
|
|
|
- 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
|
|
|
|
2017-09-06 12:10:52 +00:00
|
|
|
- name: Assign inventory name to unconfigured hostnames (non-CoreOS)
|
2017-03-27 10:27:15 +00:00
|
|
|
hostname:
|
|
|
|
name: "{{inventory_hostname}}"
|
2017-09-06 12:10:52 +00:00
|
|
|
when: ansible_os_family not in ['CoreOS', 'Container Linux by CoreOS']
|
|
|
|
|
|
|
|
- name: Assign inventory name to unconfigured hostnames (CoreOS only)
|
|
|
|
command: "hostnamectl set-hostname {{inventory_hostname}}"
|
|
|
|
register: hostname_changed
|
|
|
|
when: ansible_hostname == 'localhost' and ansible_os_family in ['CoreOS', 'Container Linux by CoreOS']
|
|
|
|
|
|
|
|
- name: Update hostname fact (CoreOS only)
|
|
|
|
setup:
|
|
|
|
gather_subset: '!all'
|
|
|
|
filter: ansible_hostname
|
|
|
|
when: ansible_os_family in ['CoreOS', 'Container Linux by CoreOS'] and hostname_changed.changed
|