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.

53 lines
1.4 KiB

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