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.

71 lines
2.1 KiB

  1. ---
  2. - name: Fetch /etc/os-release
  3. raw: cat /etc/os-release
  4. register: os_release
  5. changed_when: false
  6. # This command should always run, even in check mode
  7. check_mode: false
  8. environment: {}
  9. - include_tasks: bootstrap-centos.yml
  10. when: '"CentOS" in os_release.stdout or "Red Hat Enterprise Linux" in os_release.stdout'
  11. - include_tasks: bootstrap-clearlinux.yml
  12. when: '"Clear Linux OS" in os_release.stdout'
  13. - include_tasks: bootstrap-coreos.yml
  14. when: '"CoreOS" in os_release.stdout'
  15. - include_tasks: bootstrap-debian.yml
  16. when: '"Debian" in os_release.stdout or "Ubuntu" in os_release.stdout'
  17. - include_tasks: bootstrap-fedora.yml
  18. when: '"Fedora" in os_release.stdout'
  19. - include_tasks: bootstrap-opensuse.yml
  20. when: '"openSUSE" in os_release.stdout'
  21. - name: Create remote_tmp for it is used by another module
  22. file:
  23. path: "{{ ansible_remote_tmp | default('~/.ansible/tmp') }}"
  24. state: directory
  25. mode: 0700
  26. # Workaround for https://github.com/ansible/ansible/issues/42726
  27. # (1/3)
  28. - name: Gather host facts to get ansible_os_family
  29. setup:
  30. gather_subset: '!all'
  31. filter: ansible_*
  32. - name: Assign inventory name to unconfigured hostnames (non-CoreOS, Suse and ClearLinux)
  33. hostname:
  34. name: "{{ inventory_hostname }}"
  35. when:
  36. - override_system_hostname
  37. - ansible_os_family not in ['Suse', 'Container Linux by CoreOS', 'ClearLinux']
  38. # (2/3)
  39. - name: Assign inventory name to unconfigured hostnames (CoreOS, Suse and ClearLinux only)
  40. command: "hostnamectl set-hostname {{ inventory_hostname }}"
  41. register: hostname_changed
  42. changed_when: false
  43. when:
  44. - override_system_hostname
  45. - ansible_os_family in ['Suse', 'Container Linux by CoreOS', 'ClearLinux']
  46. # (3/3)
  47. - name: Update hostname fact (CoreOS, Suse and ClearLinux only)
  48. setup:
  49. gather_subset: '!all'
  50. filter: ansible_hostname
  51. when:
  52. - override_system_hostname
  53. - ansible_os_family in ['Suse', 'Container Linux by CoreOS', 'ClearLinux']
  54. - name: "Install ceph-commmon package"
  55. package:
  56. name:
  57. - ceph-common
  58. state: present
  59. when: rbd_provisioner_enabled|default(false)