ganeti.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. - name: 'Install Ganeti related packages'
  2. apt:
  3. pkg:
  4. - 'ganeti'
  5. - 'ganeti-instance-debootstrap'
  6. - 'drbd-utils'
  7. - 'dnsutils'
  8. install_recommends: 'no'
  9. state: 'present'
  10. tags:
  11. - 'hypervisor'
  12. - 'ganeti'
  13. - name: 'Install ganeti instances templates for debootstrap'
  14. template:
  15. src: 'ganeti/instance-debootstrap/{{ item }}.conf.j2'
  16. dest: '/etc/ganeti/instance-debootstrap/variants/{{ item }}.conf'
  17. owner: 'root'
  18. group: 'root'
  19. mode: '0644'
  20. with_items:
  21. - 'jessie'
  22. - 'stretch'
  23. - 'buster'
  24. tags:
  25. - 'hypervisor'
  26. - 'ganeti'
  27. - name: 'Enable ganeti instances templates for debootstrap'
  28. lineinfile:
  29. dest: '/etc/ganeti/instance-debootstrap/variants.list'
  30. regexp: '^{{ item }}$'
  31. line: '{{ item }}'
  32. owner: 'root'
  33. group: 'root'
  34. mode: '0644'
  35. with_items:
  36. - 'jessie'
  37. - 'stretch'
  38. - 'buster'
  39. tags:
  40. - 'hypervisor'
  41. - 'ganeti'
  42. - name: 'Exclude DRBD devices from lvm devices while using ganeti'
  43. blockinfile:
  44. dest: '/etc/lvm/lvm.conf'
  45. marker: ' # ======= {mark} Exclude DRBD devices while using ganeti (managed by ansible) ======'
  46. content: ' filter = ["r|/dev/drbd[0-9]+|"]'
  47. insertafter: '^\s*devices\s+{'
  48. tags:
  49. - 'hypervisor'
  50. - 'ganeti'
  51. - name: 'Add options for kernel modules while using ganeti'
  52. template:
  53. src: 'ganeti/kernel/modprobe.conf.j2'
  54. dest: '/etc/modprobe.d/ganeti.conf'
  55. owner: 'root'
  56. group: 'root'
  57. mode: '0644'
  58. notify:
  59. - 'Rebuild initramfs'
  60. tags:
  61. - 'hypervisor'
  62. - 'ganeti'
  63. - name: 'Add kernel modules to load while using ganeti'
  64. template:
  65. src: 'ganeti/kernel/modules.conf.j2'
  66. dest: '/etc/modules-load.d/ganeti.conf'
  67. owner: 'root'
  68. group: 'root'
  69. mode: '0644'
  70. tags:
  71. - 'hypervisor'
  72. - 'ganeti'
  73. # vim: ft=yaml.ansible