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.

40 lines
1.1 KiB

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