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.

61 lines
1.8 KiB

  1. ---
  2. - name: Fetch /etc/os-release
  3. raw: cat /etc/os-release
  4. register: os_release
  5. changed_when: false
  6. environment: {}
  7. - include_tasks: bootstrap-ubuntu.yml
  8. when: '"Ubuntu" in os_release.stdout'
  9. - include_tasks: bootstrap-debian.yml
  10. when: '"Debian" in os_release.stdout'
  11. - include_tasks: bootstrap-coreos.yml
  12. when: '"CoreOS" in os_release.stdout'
  13. - include_tasks: bootstrap-fedora.yml
  14. when: '"Fedora" in os_release.stdout'
  15. - include_tasks: bootstrap-centos.yml
  16. when: '"CentOS" in os_release.stdout or "Red Hat Enterprise Linux" in os_release.stdout'
  17. - include_tasks: bootstrap-opensuse.yml
  18. when: '"OpenSUSE" in os_release.stdout'
  19. - include_tasks: bootstrap-clearlinux.yml
  20. when: '"Clear Linux OS" in os_release.stdout'
  21. - import_tasks: setup-pipelining.yml
  22. - name: Create remote_tmp for it is used by another module
  23. file:
  24. path: "{{ lookup('config', 'DEFAULT_REMOTE_TMP', on_missing='skip', wantlist=True) | first | default('~/.ansible/tmp') }}"
  25. state: directory
  26. mode: 0700
  27. - name: Gather nodes hostnames
  28. setup:
  29. gather_subset: '!all'
  30. filter: ansible_*
  31. - name: Assign inventory name to unconfigured hostnames (non-CoreOS and Tumbleweed)
  32. hostname:
  33. name: "{{inventory_hostname}}"
  34. when:
  35. - override_system_hostname
  36. - ansible_os_family not in ['Suse', 'CoreOS', 'Container Linux by CoreOS', 'ClearLinux']
  37. - name: Assign inventory name to unconfigured hostnames (CoreOS and Tumbleweed only)
  38. command: "hostnamectl set-hostname {{inventory_hostname}}"
  39. register: hostname_changed
  40. when:
  41. - override_system_hostname
  42. - ansible_os_family in ['Suse', 'CoreOS', 'Container Linux by CoreOS', 'ClearLinux']
  43. - name: Update hostname fact (CoreOS and Tumbleweed only)
  44. setup:
  45. gather_subset: '!all'
  46. filter: ansible_hostname
  47. when:
  48. - hostname_changed.changed