You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.2 KiB

8 years ago
  1. ---
  2. - include: bootstrap-ubuntu.yml
  3. when: bootstrap_os == "ubuntu"
  4. - include: bootstrap-debian.yml
  5. when: bootstrap_os == "debian"
  6. - include: bootstrap-coreos.yml
  7. when: bootstrap_os == "coreos"
  8. - include: bootstrap-centos.yml
  9. when: bootstrap_os == "centos"
  10. - include: setup-pipelining.yml
  11. - name: check if atomic host
  12. stat:
  13. path: /run/ostree-booted
  14. register: ostree
  15. - set_fact:
  16. is_atomic: "{{ ostree.stat.exists }}"
  17. - name: Gather nodes hostnames
  18. setup:
  19. gather_subset: '!all'
  20. filter: ansible_*
  21. - name: Assign inventory name to unconfigured hostnames (non-CoreOS)
  22. hostname:
  23. name: "{{inventory_hostname}}"
  24. when: ansible_os_family not in ['CoreOS', 'Container Linux by CoreOS']
  25. - name: Assign inventory name to unconfigured hostnames (CoreOS only)
  26. command: "hostnamectl set-hostname {{inventory_hostname}}"
  27. register: hostname_changed
  28. when: ansible_hostname == 'localhost' and ansible_os_family in ['CoreOS', 'Container Linux by CoreOS']
  29. - name: Update hostname fact (CoreOS only)
  30. setup:
  31. gather_subset: '!all'
  32. filter: ansible_hostname
  33. when: ansible_os_family in ['CoreOS', 'Container Linux by CoreOS'] and hostname_changed.changed