add all-in-one and compute sls

This commit is contained in:
Lei Zhang 2014-08-01 10:23:20 +08:00
parent c517cce726
commit 0640536e8b
6 changed files with 120 additions and 7 deletions

28
nova/all-in-one.sls Normal file
View File

@ -0,0 +1,28 @@
{%- from "nova/map.jinja" import nova with context %}
include:
- .base
- .db
- .keystone
- .conf
nova:
pkg.installed:
- refresh: False
- pkgs: {{ nova.all_in_one_pkgs }}
- require_in:
- file: /etc/nova/nova.conf
service.running:
- enable: True
- restart: True
- names: {{ nova.all_in_one_services}}
- require:
- pkg: nova
- watch:
- file: /etc/nova/nova.conf
nova_db_sync:
cmd.run:
- name: nova-manage db sync
- require:
- file: /etc/nova/nova.conf

View File

@ -1,6 +1,8 @@
{%- from "nova/map.jinja" import nova with context %}
pkg-utils:
pkg.installed:
- refresh: False
- pkgs:
- sysfsutils
- conntrack
- {{ nova.conntrack }}

41
nova/compute.sls Normal file
View File

@ -0,0 +1,41 @@
include:
- .base
- .conf
nova-network:
pkg.installed:
- refresh: False
- pkgs:
- nova-network
- nova-api-metadata
- require_in:
- file: /etc/nova/nova.conf
service.running:
- enable: True
- restart: True
- names:
- nova-network
- nova-api-metadata
- require:
- pkg: nova-network
- watch:
- file: /etc/nova/nova.conf
nova-compute:
pkg.installed:
- refresh: False
- pkgs:
- nova-compute
- nova-compute-{{ salt['pillar.get']('nova:config:libvirt:virt_type', 'kvm') }}
- require_in:
- file: /etc/nova/nova.conf
service.running:
- enable: True
- restart: True
- names:
- nova-compute
- require:
- pkg: nova-compute
- file: /etc/nova/nova.conf
- watch:
- file: /etc/nova/nova.conf

View File

@ -10,6 +10,8 @@ nova:
pkg.installed:
- refresh: False
- pkgs: {{ nova.controller_pkgs }}
- require_in:
- file: /etc/nova/nova.conf
service.running:
- enable: True
- restart: True

View File

@ -11,7 +11,36 @@
"nova-conductor",
"nova-consoleauth",
"nova-scheduler"],
"conntrack": "conntrack",
"all_in_one_pkgs": ["nova-api",
"nova-compute",
"nova-compute-" + salt["pillar.get"]("nova:config:libvirt:virt_type", "kvm"),
"nova-conductor",
"nova-consoleauth",
"nova-novncproxy",
"nova-network",
"nova-scheduler"],
"all_in_one_services": ["nova-api",
"nova-compute",
"nova-conductor",
"nova-consoleauth",
"nova-scheduler",
"nova-network"]
},
"RedHat": {
"name": "nova",
"controller_pkgs": ["openstack-nova-api",
"openstack-nova-conductor",
"openstack-nova-common",
"openstack-nova-novncproxy",
"openstack-nova-scheduler",
"python-novaclient"],
"controller_services": ["openstack-nova-api",
"openstack-nova-conductor",
"openstack-nova-consoleauth",
"openstack-nova-scheduler"],
"conntrack": "conntrack-tools",
}
}, merge=salt["pillar.get"]("nova:lookup")) %}
# Set the nova default config
@ -31,21 +60,24 @@
"enabled_apis": "ec2,osapi_compute,metadata",
"memcached_servers": salt["pillar.get"]("nova:internal_ip") + ":11211",
"compute_driver": "libvirt.LibvirtDriver",
"auth_strategy": "keystone",
"glance_host": salt["pillar.get"]("nova:internal_ip"),
"glance_host": salt["pillar.get"]("nova:glance:host"),
"rpc_backend": "nova.openstack.common.rpc.impl_kombu",
"rabbit_userid": salt["pillar.get"]("nova:rabbitmq:name"),
"rabbit_password": salt["pillar.get"]("nova:rabbitmq:password"),
"rabbit_host": salt["pillar.get"]("nova:rabbitmq:ip"),
"novncproxy_host": "0.0.0.0",
"vncserver_listen": "0.0.0.0",
"novncproxy_base_url": "http://" + salt["pillar.get"]("nova:config:DEFAULT:novncproxy_base_ip") + ":6080/vnc_auto.html",
"vncserver_proxyclient_address": salt["pillar.get"]("nova:internal_ip"),
"network_manager ": "nova.network.manager.VlanManager",
"vlan_start ": "1000",
"vlan_interface ": salt["pillar.get"]("nova:private_interface"),
"network_manager": "nova.network.manager.VlanManager",
"vlan_start": "1000",
"vlan_interface": salt["pillar.get"]("nova:private_interface"),
"multi_host": True,
"send_arp_for_ha": True,
"public_interface": salt["pillar.get"]("nova:public_interface"),
@ -80,5 +112,12 @@
}
} %}
{% for section, value in salt["pillar.get"]("nova:config").iteritems() %}
{% if not nova_config.has_key(section) %}
{% do nova_config.update({ section:{} }) %}
{% endif %}
{% do nova_config[section].update(value) %}
{% endfor %}
{#- vim:ft=sls
-#}

View File

@ -18,8 +18,9 @@ nova:
password: pass
config:
DEFAULT:
novncproxy_base_ip: 10.0.0.12
novncproxy_base_ip:
libvirt:
virt_type: qemu
{#- vim:ft=sls
-#}