ganeti.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. tags:
  24. - 'hypervisor'
  25. - 'ganeti'
  26. - name: 'Enable ganeti instances templates for debootstrap'
  27. lineinfile:
  28. dest: '/etc/ganeti/instance-debootstrap/variants.list'
  29. regexp: '^{{ item }}$'
  30. line: '{{ item }}'
  31. owner: 'root'
  32. group: 'root'
  33. mode: '0644'
  34. with_items:
  35. - 'jessie'
  36. - 'stretch'
  37. tags:
  38. - 'hypervisor'
  39. - 'ganeti'
  40. - name: 'Exclude DRBD devices from lvm devices while using ganeti'
  41. blockinfile:
  42. dest: '/etc/lvm/lvm.conf'
  43. marker: ' # ======= {mark} Exclude DRBD devices while using ganeti (managed by ansible) ======'
  44. content: ' filter = ["r|/dev/drbd[0-9]+|"]'
  45. insertafter: '^\s*devices\s+{'
  46. tags:
  47. - 'hypervisor'
  48. - 'ganeti'
  49. - name: 'Add options for kernel modules while using ganeti'
  50. template:
  51. src: 'ganeti/kernel/modprobe.conf.j2'
  52. dest: '/etc/modprobe.d/ganeti.conf'
  53. owner: 'root'
  54. group: 'root'
  55. mode: '0644'
  56. notify:
  57. - 'Rebuild initramfs'
  58. tags:
  59. - 'hypervisor'
  60. - 'ganeti'
  61. - name: 'Add kernel modules to load while using ganeti'
  62. template:
  63. src: 'ganeti/kernel/modules.conf.j2'
  64. dest: '/etc/modules-load.d/ganeti.conf'
  65. owner: 'root'
  66. group: 'root'
  67. mode: '0644'
  68. tags:
  69. - 'hypervisor'
  70. - 'ganeti'
  71. # vim: ft=yaml.ansible