- name: 'Install Xen related packages' apt: pkg: '{{ item }}' install_recommends: 'no' state: 'installed' with_items: - 'xen-linux-system-amd64' - 'bridge-utils' - 'debootstrap' when: with_xen - name: 'Add GRUB options for Xen' 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 dom0_max_vcpus=1 dom0_vcpus_pin {{ xen_grub_opts }}"' notify: - 'Update GRUB' when: with_xen - name: 'Set Xen hypervisor to boot first' command: 'dpkg-divert --divert /etc/grub.d/09_linux_xen --rename /etc/grub.d/20_linux_xen creates=/etc/grub.d/09_linux_xen' notify: - 'Update GRUB' when: with_xen - name: 'Configure Xend' template: src: 'xen/xend-config.sxp.j2' dest: '/etc/xen/xend-config.sxp' owner: 'root' group: 'root' mode: '0644' when: with_xen - name: 'Configure Xendomains init script (disable save and restore)' lineinfile: dest: '/etc/default/xendomains' regexp: '{{ item.regexp }}' line: '{{ item.line }}' with_items: - { regexp: '^#?XENDOMAINS_RESTORE=', line: 'XENDOMAINS_RESTORE=false' } - { regexp: '^#?XENDOMAINS_SAVE=', line: 'XENDOMAINS_SAVE=' } when: with_xen