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.

87 lines
2.6 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 or "Oracle" in os_release.stdout'
  11. - include_tasks: bootstrap-clearlinux.yml
  12. when: '"Clear Linux OS" in os_release.stdout'
  13. - include_tasks: bootstrap-fedora-coreos.yml
  14. when: '"ID=fedora" in os_release.stdout and "VARIANT_ID=coreos" in os_release.stdout'
  15. - include_tasks: bootstrap-flatcar.yml
  16. when:
  17. - '"Flatcar" in os_release.stdout'
  18. - '"ID=fedora" not in os_release.stdout'
  19. - include_tasks: bootstrap-debian.yml
  20. when: '"Debian" in os_release.stdout or "Ubuntu" in os_release.stdout'
  21. - include_tasks: bootstrap-fedora.yml
  22. when:
  23. - '"Fedora" in os_release.stdout'
  24. - '"VARIANT_ID=coreos" not in os_release.stdout'
  25. - include_tasks: bootstrap-opensuse.yml
  26. when: '"openSUSE" in os_release.stdout'
  27. - name: Create remote_tmp for it is used by another module
  28. file:
  29. path: "{{ ansible_remote_tmp | default('~/.ansible/tmp') }}"
  30. state: directory
  31. mode: 0700
  32. # Workaround for https://github.com/ansible/ansible/issues/42726
  33. # (1/3)
  34. - name: Gather host facts to get ansible_os_family
  35. setup:
  36. gather_subset: '!all'
  37. filter: ansible_*
  38. - name: Assign inventory name to unconfigured hostnames (non-CoreOS, non-Flatcar, Suse and ClearLinux)
  39. hostname:
  40. name: "{{ inventory_hostname }}"
  41. when:
  42. - override_system_hostname
  43. - ansible_os_family not in ['Suse', 'Flatcar Container Linux by Kinvolk', 'ClearLinux'] and not is_fedora_coreos
  44. # (2/3)
  45. - name: Assign inventory name to unconfigured hostnames (CoreOS, Flatcar, Suse and ClearLinux only)
  46. command: "hostnamectl set-hostname {{ inventory_hostname }}"
  47. register: hostname_changed
  48. become: true
  49. changed_when: false
  50. when:
  51. - override_system_hostname
  52. - ansible_os_family in ['Suse', 'Flatcar Container Linux by Kinvolk', 'ClearLinux'] or is_fedora_coreos
  53. # (3/3)
  54. - name: Update hostname fact (CoreOS, Flatcar, Suse and ClearLinux only)
  55. setup:
  56. gather_subset: '!all'
  57. filter: ansible_hostname
  58. when:
  59. - override_system_hostname
  60. - ansible_os_family in ['Suse', 'Flatcar Container Linux by Kinvolk', 'ClearLinux'] or is_fedora_coreos
  61. - name: "Install ceph-commmon package"
  62. package:
  63. name:
  64. - ceph-common
  65. state: present
  66. when: rbd_provisioner_enabled|default(false)
  67. - name: Ensure bash_completion.d folder exists
  68. file:
  69. name: /etc/bash_completion.d/
  70. state: directory
  71. owner: root
  72. group: root
  73. mode: 0755