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.

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