2016-04-16 23:52:58 +00:00
|
|
|
# -*- mode: yaml -*-
|
|
|
|
{% set xen_provided = salt['grains.get']('xen_provided', False) %}
|
|
|
|
{% set efi = salt['grains.get']('efi', False) %}
|
2016-04-25 11:51:21 +00:00
|
|
|
/etc/portage/env/xen-install-mask:
|
|
|
|
file.managed:
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
- mode: 644
|
2016-04-25 12:04:48 +00:00
|
|
|
- contents: |
|
2016-04-25 12:01:43 +00:00
|
|
|
INSTALL_MASK='/boot/xen.gz /boot/xen-4.gz /boot/xen-4.6.gz'
|
2016-04-25 11:59:42 +00:00
|
|
|
|
2016-04-16 23:52:58 +00:00
|
|
|
xen:
|
2016-04-25 12:02:47 +00:00
|
|
|
portage_config.flags:
|
2016-04-25 11:51:21 +00:00
|
|
|
- name: app-emulation/xen
|
|
|
|
- use: [{{ 'efi' if efi else '-efi' }}]
|
|
|
|
- env:
|
|
|
|
- xen-install-mask
|
2016-04-16 23:52:58 +00:00
|
|
|
pkg.installed:
|
|
|
|
- pkgs:
|
|
|
|
{% if not xen_provided %}
|
|
|
|
- app-emulation/xen: "~>=4.6.0-r8[{{ 'efi' if efi else '-efi' }}]"
|
|
|
|
{% endif %}
|
|
|
|
- app-emulation/xen-tools: "~>=4.6.0-r7[api,hvm,screen,system-qemu,system-seabios]"
|
|
|
|
- app-emulation/qemu: "[xen,numa,nfs,xfs]"
|
|
|
|
- dev-libs/libnl
|
|
|
|
- require:
|
|
|
|
- file: unmask-hvm
|
2016-04-25 11:51:21 +00:00
|
|
|
- portage_config: xen
|
2016-04-16 23:52:58 +00:00
|
|
|
{% if xen_provided %}
|
|
|
|
- file: xen-provided
|
|
|
|
{% endif %}
|
|
|
|
{% if xen_provided %}
|
|
|
|
xen-provided:
|
|
|
|
file.append:
|
|
|
|
- name: /etc/portage/profile/package.provided
|
|
|
|
- text: "app-emulation/xen-4.6.0-r7"
|
|
|
|
{% endif %}
|
|
|
|
unmask-hvm:
|
|
|
|
file.append:
|
|
|
|
- name: /etc/portage/profile/use.mask
|
|
|
|
- text: "-hvm"
|
|
|
|
|
|
|
|
xencommons:
|
|
|
|
service.running:
|
|
|
|
- enable: True
|
|
|
|
|
|
|
|
xenstored:
|
|
|
|
service.running:
|
|
|
|
- enable: True
|
|
|
|
|
|
|
|
xenconsoled:
|
|
|
|
service.running:
|
|
|
|
- enable: True
|
|
|
|
|
|
|
|
/etc/init.d/net.xenbr0:
|
|
|
|
file.symlink:
|
|
|
|
- target: /etc/init.d/net.lo
|
|
|
|
|
|
|
|
net.xenbr0:
|
|
|
|
service.running:
|
|
|
|
- enable: True
|
|
|
|
- require:
|
|
|
|
- file: /etc/init.d/net.xenbr0
|
|
|
|
|
|
|
|
/etc/xen/xl.conf:
|
|
|
|
file.managed:
|
|
|
|
- source: salt://xen/xl.conf
|
|
|
|
- mode: 644
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
|
|
|
|
/etc/init.d/xendomains:
|
|
|
|
file.managed:
|
|
|
|
- source: salt://xen/xendomains.initd
|
|
|
|
- mode: 755
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
|
|
|
|
/etc/conf.d/xendomains:
|
|
|
|
file.managed:
|
|
|
|
- source: salt://xen/xendomains.confd
|
|
|
|
- mode: 644
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
|
|
|
|
/etc/xen/domains/:
|
|
|
|
file.directory:
|
|
|
|
- create: True
|
|
|
|
- mode: 755
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
|
|
|
|
/etc/xen/auto/:
|
|
|
|
file.directory:
|
|
|
|
- create: True
|
|
|
|
- mode: 755
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
|
|
|
|
/etc/xen/scripts/:
|
|
|
|
file.directory:
|
|
|
|
- create: True
|
|
|
|
- mode: 755
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
|
|
|
|
/etc/xen/scripts/block-rbd:
|
|
|
|
file.managed:
|
|
|
|
- source: salt://xen/scripts/block-rbd
|
|
|
|
- mode: 755
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
|
|
|
|
xendomains:
|
|
|
|
service.running:
|
|
|
|
- enable: True
|
|
|
|
- watch:
|
|
|
|
- file: /etc/init.d/xendomains
|
|
|
|
- file: /etc/conf.d/xendomains
|
|
|
|
|
|
|
|
bringup-xendomains:
|
|
|
|
cron.present:
|
|
|
|
- identifier: bringup-xendomains
|
|
|
|
- name: "/etc/init.d/xendomains --ifstarted bringup"
|
|
|
|
- minute: '*/10'
|
|
|
|
- user: root
|
|
|
|
- require:
|
|
|
|
- service: xendomains
|