ganeti.yml 1.7 KB

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