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.

74 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. - include_tasks: bootstrap-oracle.yml
  22. when: '"Oracle" in os_release.stdout'
  23. - name: Create remote_tmp for it is used by another module
  24. file:
  25. path: "{{ ansible_remote_tmp | default('~/.ansible/tmp') }}"
  26. state: directory
  27. mode: 0700
  28. # Workaround for https://github.com/ansible/ansible/issues/42726
  29. # (1/3)
  30. - name: Gather host facts to get ansible_os_family
  31. setup:
  32. gather_subset: '!all'
  33. filter: ansible_*
  34. - name: Assign inventory name to unconfigured hostnames (non-CoreOS, Suse and ClearLinux)
  35. hostname:
  36. name: "{{ inventory_hostname }}"
  37. when:
  38. - override_system_hostname
  39. - ansible_os_family not in ['Suse', 'Container Linux by CoreOS', 'ClearLinux']
  40. # (2/3)
  41. - name: Assign inventory name to unconfigured hostnames (CoreOS, Suse and ClearLinux only)
  42. command: "hostnamectl set-hostname {{ inventory_hostname }}"
  43. register: hostname_changed
  44. changed_when: false
  45. when:
  46. - override_system_hostname
  47. - ansible_os_family in ['Suse', 'Container Linux by CoreOS', 'ClearLinux']
  48. # (3/3)
  49. - name: Update hostname fact (CoreOS, Suse and ClearLinux only)
  50. setup:
  51. gather_subset: '!all'
  52. filter: ansible_hostname
  53. when:
  54. - override_system_hostname
  55. - ansible_os_family in ['Suse', 'Container Linux by CoreOS', 'ClearLinux']
  56. - name: "Install ceph-commmon package"
  57. package:
  58. name:
  59. - ceph-common
  60. state: present
  61. when: rbd_provisioner_enabled|default(false)