Skip to content

Commit

Permalink
Work-in-progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
amscanne committed Apr 3, 2013
1 parent b1536bd commit 92692bc
Show file tree
Hide file tree
Showing 32 changed files with 1,253 additions and 417 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ peer to peer communication across the board you can use:
Configuration
-------------

You can find full information about configuration values in `config.sls`.
You can find full information about configuration values in `config.sls` and
`ceph/config.sls`.
5 changes: 4 additions & 1 deletion api.sls
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% include "openstack/glance/api.sls" %}
{% include "openstack/glance/registry.sls" %}
{% include "openstack/nova/api.sls" %}
{% include "openstack/nova/scheduler.sls" %}
{% include "openstack/cinder/api.sls" %}
{% include "openstack/cinder/scheduler.sls" %}
{% include "openstack/keystone/api.sls" %}
{% include "openstack/glance/api.sls" %}
12 changes: 12 additions & 0 deletions backend/mysql.sls
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ keystone:
mysql_user.present:
- name: {{ config.mysql_keystone_username }}
- password: {{ config.mysql_keystone_password }}
- host: "%"
mysql_grants.present:
- grant: all privileges
- database: {{ config.mysql_keystone_database }}.*
- user: {{ config.mysql_keystone_username }}
- host: "%"
require:
- service: mysql
nova:
Expand All @@ -29,10 +31,12 @@ nova:
mysql_user.present:
- name: {{ config.mysql_nova_username }}
- password: {{ config.mysql_nova_password }}
- host: "%"
mysql_grants.present:
- grant: all privileges
- database: {{ config.mysql_nova_database }}.*
- user: {{ config.mysql_nova_username }}
- host: "%"
require:
- service: mysql
glance:
Expand All @@ -41,10 +45,12 @@ glance:
mysql_user.present:
- name: {{ config.mysql_glance_username }}
- password: {{ config.mysql_glance_password }}
- host: "%"
mysql_grants.present:
- grant: all privileges
- database: {{ config.mysql_glance_database }}.*
- user: {{ config.mysql_glance_username }}
- host: "%"
require:
- service: mysql
cinder:
Expand All @@ -53,10 +59,12 @@ cinder:
mysql_user.present:
- name: {{ config.mysql_cinder_username }}
- password: {{ config.mysql_cinder_password }}
- host: "%"
mysql_grants.present:
- grant: all privileges
- database: {{ config.mysql_cinder_database }}.*
- user: {{ config.mysql_cinder_username }}
- host: "%"
require:
- service: mysql
horizon:
Expand All @@ -65,10 +73,12 @@ horizon:
mysql_user.present:
- name: {{ config.mysql_horizon_username }}
- password: {{ config.mysql_horizon_password }}
- host: "%"
mysql_grants.present:
- grant: all privileges
- database: {{ config.mysql_horizon_database }}.*
- user: {{ config.mysql_horizon_username }}
- host: "%"
require:
- service: mysql
quantum:
Expand All @@ -77,10 +87,12 @@ quantum:
mysql_user.present:
- name: {{ config.mysql_quantum_username }}
- password: {{ config.mysql_quantum_password }}
- host: "%"
mysql_grants.present:
- grant: all privileges
- database: {{ config.mysql_quantum_database }}.*
- user: {{ config.mysql_quantum_username }}
- host: "%"
require:
- service: mysql
Expand Down
25 changes: 25 additions & 0 deletions backend/rabbitmq.sls
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
{% import "openstack/config.sls" as config with context %}
rabbitmq-server:
pkg:
- installed
service:
- running
require:
- pkg.installed: rabbitmq-server
watch:
- pkg.installed: rabbitmq-server
rabbitmq:
rabbitmq_user.present:
- name: {{ config.rabbitmq_user }}
- password: {{ config.rabbitmq_password }}
- force: True
rabbitmq_vhost.present:
- name: {{ config.rabbitmq_vhost }}
- user: {{ config.rabbitmq_user }}
- conf: .*
- write: .*
- read: .*
require:
- service: rabbitmq-server
{% set res = salt['data.update']('openstack.rabbitmq', config.internal_ip) %}
37 changes: 37 additions & 0 deletions ceph/ceph.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[global]
log file = ""
log to syslog = true
clog to monitors = false
clog to syslog = true
log to stderr = false

[mon]
mon data = /var/lib/ceph/mon/ceph-$id

[osd]
osd data = /var/lib/ceph/osd/ceph-$id
osd journal = /mnt/rbd/osd$id/journal
osd class dir = /usr/lib/rados-classes
filestore filemap = false

{% set monno = 0 %}
{% set osdno = 0 %}
{% for (host, devices) in devices|dictsort %}
{% if grain['localhost'] == host %}
[mon.{{i}}]
host = {{host}}
mon addr = {{host}}:6789
{% endif %}
{% for device in devices %}
{% if grain['localhost'] == host %}
[osd.{{i}}]
host = {{host}}
cluster addr = {{host}}
public addr = {{host}}
osd journal size = 8192
devs = {{device}}
{% endif %}
{% set osdno = osdno + 1 %}
{% endfor %}
{% set monno = monno + 1 %}
{% endfor %}
5 changes: 5 additions & 0 deletions ceph/config.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% import "openstack/config.sls" as config with context %}

{% set source = pillar.get('openstack:ceph:source', 'deb http://ceph.com/debian precise main') %}
{% set ip = config.internal_ip %}
{% set devices = pillar.get('openstack:ceph:devices', {}) %}
55 changes: 55 additions & 0 deletions ceph/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{% import "openstack/ceph/config.sls" as config with context %}
ceph-keyring:
cmd.run:
- name: 'wget -q -O - https://raw.github.com/ceph/ceph/master/keys/release.asc | sudo apt-key add -'
- unless: 'apt-key list | grep -q -i ceph'
ceph:
pkgrepo.managed:
- name: {{ config.source }}
- baseurl: {{ config.source }}
- humanname: ceph
- file: /etc/apt/sources.list.d/ceph.list
pkg:
- latest
require:
- pkgrepo: {{ config.source }}
- state: ceph-keyring
/etc/ceph/ceph.conf:
file.managed:
- source: salt://openstack/ceph/ceph.conf
- owner: root
- group: root
- mode: 0644
- template: jinja
- context:
devices: {{ config.devices }}
{% set i = 0 %}
{% for (host, _) in config.devices|dictsort %}
{% if grains['localhost'] == host %}
/var/lib/ceph/mon/ceph-{{i}}:
file.directory:
- owner: root
- group: root
- mode: 0755
- makedirs: true
{% endif %}
{% set i = i + 1 %}
{% endfor %}
{% set i = 0 %}
{% for (host, devices) in config.devices|dictsort %}
{% for device in devices %}
{% if grains['localhost'] == host %}
/var/lib/ceph/osd/ceph-{{i}}:
file.directory:
- owner: root
- group: root
- mode: 0755
- makedirs: true
{% endif %}
{% set i = i + 1 %}
{% endfor %}
{% endfor %}
5 changes: 2 additions & 3 deletions cinder/api.sls
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ include:
service.running:
- enable: True
- watch:
- file: /etc/cinder/cinder.conf
- file: /etc/cinder/policy.json
- file: /etc/cinder/api-paste.ini
- pkg: cinder-api
require:
- file: /etc/cinder/cinder.conf
- file: /etc/cinder/policy.json
- file: /etc/cinder/api-paste.ini
{% set res = salt['data.update']('openstack.cinder.api', config.public_ip) %}
6 changes: 4 additions & 2 deletions cinder/base.sls
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{% import "openstack/config.sls" as config with context %}
cinder:
- user.present
- group.present
user:
- present
group:
- present
/etc/cinder/cinder.conf:
file.managed:
Expand Down
Loading

0 comments on commit 92692bc

Please sign in to comment.