Browse Source

added autostart for vm into virt

pull/27/head
Ondrej Smola 8 years ago
parent
commit
b74020fe39
2 changed files with 14 additions and 0 deletions
  1. +11
    -0
      salt/control/virt.sls
  2. +3
    -0
      salt/map.jinja

+ 11
- 0
salt/control/virt.sls View File

# - path: /srv/salt-images/{{ node_name }}.{{ cluster.domain }}/system.qcow2 # - path: /srv/salt-images/{{ node_name }}.{{ cluster.domain }}/system.qcow2
# - id_: {{ node_name }}.{{ cluster.domain }} # - id_: {{ node_name }}.{{ cluster.domain }}
# - unless: virsh list | grep {{ node_name }}.{{ cluster.domain }} # - unless: virsh list | grep {{ node_name }}.{{ cluster.domain }}

{%- if node.get("autostart", True) %}

salt_virt_autostart_{{ cluster_name }}_{{ node_name }}:
module.run:
- name: virt.set_autostart
- vm_: {{ node_name }}.{{ cluster.domain }}
- state: true
- unless: virsh list --autostart | grep {{ node_name }}.{{ cluster.domain }}
{%- endif %}
{%- endif %} {%- endif %}



+ 3
- 0
salt/map.jinja View File

virt_pkgs: virt_pkgs:
- libvirt-dev - libvirt-dev
- pkg-config - pkg-config
{% if grains.oscodename == 'trusty' %}
- libguestfs-tools - libguestfs-tools
{% endif %}

RedHat: RedHat:
virt_pkgs: virt_pkgs:
- libvirt-dev - libvirt-dev

Loading…
Cancel
Save