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.

68 lines
1.9 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-ubuntu.yml
  10. when: '"Ubuntu" in os_release.stdout'
  11. - include_tasks: bootstrap-debian.yml
  12. when: '"Debian" in os_release.stdout'
  13. - include_tasks: bootstrap-coreos.yml
  14. when: '"CoreOS" in os_release.stdout'
  15. - include_tasks: bootstrap-fedora.yml
  16. when: '"Fedora" in os_release.stdout'
  17. - include_tasks: bootstrap-centos.yml
  18. when: '"CentOS" in os_release.stdout or "Red Hat Enterprise Linux" in os_release.stdout'
  19. - include_tasks: bootstrap-opensuse.yml
  20. when: '"openSUSE" in os_release.stdout'
  21. - include_tasks: bootstrap-clearlinux.yml
  22. when: '"Clear Linux OS" 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. - name: Gather nodes hostnames
  29. setup:
  30. gather_subset: '!all'
  31. filter: ansible_*
  32. - name: Assign inventory name to unconfigured hostnames (non-CoreOS and Tumbleweed)
  33. hostname:
  34. name: "{{ inventory_hostname }}"
  35. when:
  36. - override_system_hostname
  37. - ansible_os_family not in ['Suse', 'CoreOS', 'Container Linux by CoreOS', 'ClearLinux']
  38. - name: Assign inventory name to unconfigured hostnames (CoreOS and Tumbleweed only)
  39. command: "hostnamectl set-hostname {{ inventory_hostname }}"
  40. register: hostname_changed
  41. when:
  42. - override_system_hostname
  43. - ansible_os_family in ['Suse', 'CoreOS', 'Container Linux by CoreOS', 'ClearLinux']
  44. - name: Update hostname fact (CoreOS and Tumbleweed only)
  45. setup:
  46. gather_subset: '!all'
  47. filter: ansible_hostname
  48. when:
  49. - hostname_changed.changed
  50. - name: "Install ceph-commmon package"
  51. package:
  52. name:
  53. - ceph-common
  54. state: present
  55. when: rbd_provisioner_enabled|default(false)