ganeti.yml 1.6 KB

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