123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- - name: 'Install Xen related packages'
- apt:
- pkg:
- - 'xen-linux-system-amd64'
- - 'grub-xen-host'
- - 'bridge-utils'
- - 'debootstrap'
- install_recommends: 'no'
- state: 'present'
- tags:
- - 'hypervisor'
- - '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'
- tags:
- - 'hypervisor'
- - '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'
- - name: 'Configure Xend'
- template:
- src: 'xen/xend-config.sxp.j2'
- dest: '/etc/xen/xend-config.sxp'
- owner: 'root'
- group: 'root'
- mode: '0644'
- tags:
- - 'hypervisor'
- - '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=' }
- tags:
- - 'hypervisor'
- - 'xen'
- # vim: ft=yaml.ansible
|