c12s-kubespray/roles/bootstrap-os/tasks/main.yml
Antoine Legrand c27a91f7f0 Split deploy steps in separate playbooks: part1 (#3451)
* Fix bootstrap_os/ubuntu idempotency

* Update bastion role

* move container_engine in sub-roles

* requires ansible 2.5

* ubuntu18 as first CI job
2018-10-09 19:14:33 -07:00

50 lines
1.4 KiB
YAML

---
- include_tasks: bootstrap-ubuntu.yml
when: os_family == "ubuntu"
- include_tasks: bootstrap-debian.yml
when: os_family == "debian"
- include_tasks: bootstrap-coreos.yml
when: os_family == "coreos"
- include_tasks: bootstrap-fedora.yml
when: os_family == "fedora"
- include_tasks: bootstrap-centos.yml
when: os_family == "centos"
- include_tasks: bootstrap-opensuse.yml
when: os_family == "opensuse"
- import_tasks: setup-pipelining.yml
- name: Gather nodes hostnames
setup:
gather_subset: '!all'
filter: ansible_*
- name: Assign inventory name to unconfigured hostnames (non-CoreOS and Tumbleweed)
hostname:
name: "{{inventory_hostname}}"
when:
- override_system_hostname
- ansible_distribution not in ['openSUSE Tumbleweed']
- ansible_os_family not in ['CoreOS', 'Container Linux by CoreOS']
- name: Assign inventory name to unconfigured hostnames (CoreOS and Tumbleweed only)
command: "hostnamectl set-hostname {{inventory_hostname}}"
register: hostname_changed
when:
- ansible_hostname == 'localhost'
- ansible_distribution in ['openSUSE Tumbleweed'] or ansible_os_family in ['CoreOS', 'Container Linux by CoreOS']
- override_system_hostname
- name: Update hostname fact (CoreOS and Tumbleweed only)
setup:
gather_subset: '!all'
filter: ansible_hostname
when:
- hostname_changed.changed