xen.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. - name: Install Xen related packages
  2. apt: pkg={{ item }} install_recommends=no state=installed update_cache=yes
  3. with_items:
  4. - bridge-utils
  5. - xen-linux-system-amd64
  6. - debootstrap
  7. when: with_xen
  8. - name: Add GRUB options for Xen
  9. lineinfile: dest=/etc/default/grub regexp="^GRUB_CMDLINE_XEN_DEFAULT=" insertafter="^GRUB_CMDLINE_LINUX=" line='GRUB_CMDLINE_XEN_DEFAULT="dom0_mem={{ xendom0_mem }}M,max:{{ xendom0_mem }}M"'
  10. when: with_xen
  11. - name: Set Xen hypervisor to boot first
  12. command: dpkg-divert --divert /etc/grub.d/09_linux_xen --rename /etc/grub.d/20_linux_xen creates=/etc/grub.d/09_linux_xen
  13. notify:
  14. - Update GRUB
  15. when: with_xen
  16. - name: Configure Xend (memory)
  17. lineinfile: dest=/etc/xen/xend-config.sxp regexp="^#?\(dom0-min-mem" line="(dom0-min-mem {{ xendom0_mem }})"
  18. when: with_xen
  19. - name: Configure Xend (disable auto-ballooning)
  20. lineinfile: dest=/etc/xen/xend-config.sxp regexp="^#?\(enable-dom0-ballooning" line="(enable-dom0-ballooning no)"
  21. when: with_xen
  22. - name: Configure Xendomains init script (disable restore)
  23. lineinfile: dest=/etc/default/xendomains regexp="^#?XENDOMAINS_RESTORE=" line="XENDOMAINS_RESTORE=false"
  24. when: with_xen
  25. - name: Configure Xendomains init script (disable save)
  26. lineinfile: dest=/etc/default/xendomains regexp="^#?XENDOMAINS_SAVE=" line="XENDOMAINS_SAVE="
  27. when: with_xen