@@ -7,12 +7,15 @@ parameters: | |||
small: | |||
cpu: 1 | |||
ram: 2 | |||
hdd: 10 | |||
disk_profile: default | |||
net_profile: default | |||
medium: | |||
cpu: 2 | |||
ram: 4 | |||
hdd: 20 | |||
disk_profile: default | |||
net_profile: default | |||
large: | |||
cpu: 4 | |||
ram: 8 | |||
hdd: 70 | |||
disk_profile: default | |||
net_profile: default |
@@ -1,9 +1,13 @@ | |||
{% from "salt/map.jinja" import control with context %} | |||
{%- if control.enabled and control.virt_enabled is defined %} | |||
include: | |||
- salt.minion | |||
salt_control_virt_packages: | |||
pkg.installed: | |||
- names: {{ control.virt_pkgs }} | |||
{# | |||
{%- for package in control.virt_pips %} | |||
@@ -14,6 +18,18 @@ salt_control_virt_packages: | |||
{%- endfor %} | |||
#} | |||
/etc/salt/minion.d/_virt.conf: | |||
file.managed: | |||
- source: salt://salt/files/_virt.conf | |||
- user: root | |||
- group: root | |||
- template: jinja | |||
- require: | |||
- pkg: salt_control_virt_packages | |||
- watch_in: | |||
- service: salt_minion_service | |||
{%- for cluster_name, cluster in control.cluster.iteritems() %} | |||
{%- if cluster.engine == "virt" %} | |||
@@ -32,8 +48,8 @@ salt_control_virt_{{ cluster_name }}_{{ node_name }}: | |||
- mem: {{ size.ram }} | |||
- image: salt://{{ node.image }} | |||
- start: True | |||
- disk: {{ node.disk_profile }} | |||
- nic: {{ node.net_profile }} | |||
- disk: {{ size.disk_profile }} | |||
- nic: {{ size.net_profile }} | |||
- kwargs: | |||
seed: True | |||
serial_type: pty |
@@ -0,0 +1,29 @@ | |||
{% from "salt/map.jinja" import control with context %} | |||
virt: | |||
nic: | |||
{%- for item_name, item in control.get('net_profile', {}).iteritems() %} | |||
{{ item_name }}: | |||
{%- for iface_name, iface in item.iteritems() %} | |||
{{ iface_name }}: | |||
{%- if iface.bridge is defined %} | |||
bridge: {{ iface.bridge }} | |||
{%- endif %} | |||
{%- if iface.network is defined %} | |||
network: {{ iface.network }} | |||
{%- endif %} | |||
{%- if iface.model is defined %} | |||
model: {{ iface.model }} | |||
{%- endif %} | |||
{%- endfor %} | |||
disk: | |||
{%- for item_name, item in control.get('disk_profile', {}).iteritems() %} | |||
{{ item_name }}: | |||
{%- for disk_name, disk in item.iteritems() %} | |||
- {{ disk }}: | |||
{%- if disk.size is defined %} | |||
size: {{ disk.size }} | |||
{%- endif %} | |||
{%- endfor %} | |||
virt.images: /var/lib/libvirt/images |
@@ -1,17 +0,0 @@ | |||
{% from "salt/map.jinja" import control with context %} | |||
virt: | |||
nic: | |||
test: | |||
eth0: | |||
bridge: virbr0 | |||
model: virtio | |||
eth0: | |||
bridge: virbr0 | |||
model: virtio | |||
disk: | |||
database: | |||
- system: | |||
size: 8192 | |||
- data: | |||
size: 30720 |
@@ -113,7 +113,7 @@ | |||
'cloud_pips': ['apache-libcloud', 'netaddr'], | |||
'cloud_pkgs': ['python-netaddr', 'python-libcloud'], | |||
'virt_pips': ['libvirt-python',], | |||
'virt_pkgs': ['libvirt-dev', 'pkg-config'], | |||
'virt_pkgs': ['libvirt-dev', 'pkg-config', 'libguestfs-tools'], | |||
'maas_pkgs': ['python-maas-client',], | |||
'cluster': {}, | |||
}, |
@@ -1,44 +0,0 @@ | |||
wlan0: | |||
network.managed: | |||
- enabled: True | |||
- type: eth | |||
- bridge: br0 | |||
br0: | |||
network.managed: | |||
- enabled: True | |||
- type: bridge | |||
- proto: dhcp | |||
- require: | |||
- network: wlan0 | |||
libvirt: | |||
pkg.installed: [] | |||
file.managed: | |||
- name: /etc/sysconfig/libvirtd | |||
- contents: 'LIBVIRTD_ARGS="--listen"' | |||
- require: | |||
- pkg: libvirt | |||
libvirt.keys: | |||
- require: | |||
- pkg: libvirt | |||
service.running: | |||
- name: libvirtd | |||
- require: | |||
- pkg: libvirt | |||
- network: br0 | |||
- libvirt: libvirt | |||
- watch: | |||
- file: libvirt | |||
libvirt-python: | |||
pkg.installed: [] | |||
libguestfs: | |||
pkg.installed: | |||
- pkgs: | |||
- libguestfs | |||
- libguestfs-tools | |||