Create roles here, in either the Role Ruby DSL (.rb) or JSON (.json) files. To install roles on the server, use knife.
For example, create roles/base_example.rb
:
name "base_example"
description "Example base role applied to all nodes."
# List of recipes and roles to apply. Requires Chef 0.8, earlier versions use 'recipes()'.
#run_list()
# Attributes applied if the node doesn't have it set already.
#default_attributes()
# Attributes applied no matter what the node has set already.
#override_attributes()
Then upload it to the Chef Server:
knife role from file roles/base_example.rb
Description: This will create an all-in-one (all services on one box) Openstack environment.
role[single-controller]
role[single-compute]
Description: "Base role for a server" TODO: Needs a better description
recipe[rcb::packages]
recipe[openssh]
recipe[ntp]
"ntp" => {
"servers" => ["0.pool.ntp.org", "1.pool.ntp.org", "2.pool.ntp.org"]
}
Description: "Glance API server"
role[base]
recipe[glance::api]
Description: "Glance Registry server"
role[base]
recipe[glance::registry]
Description: "Glance server"
role[base]
recipe[glance]
Description: "Primary Nova Controller (HA)"
role[base]
role[mysql-master]
role[rabbitmq-server]
role[keystone-setup]
role[keystone-api]
role[glance-setup]
role[glance-registry]
role[nova-setup]
role[nova-network-controller]
role[nova-scheduler]
role[nova-conductor]
role[nova-api-ec2]
role[nova-api-os-compute]
role[cinder-setup]
role[cinder-api]
role[cinder-scheduler]
role[nova-cert]
role[nova-vncproxy]
role[horizon-server]
role[openstack-ha]
Description: "Additional Nova Controller (HA)"
role[base]
role[mysql-master]
role[rabbitmq-server]
role[keystone-api]
role[glance-registry]
role[glance-api]
role[nova-scheduler]
role[nova-conductor]
role[nova-api-ec2]
role[nova-api-os-compute]
role[cinder-api]
role[cinder-scheduler]
role[nova-cert]
role[nova-vncproxy]
role[horizon-server]
role[openstack-ha]
Description: "Horizon (OpenStack Dashboard) Server"
role[base]
recipe[horizon::server]
Description: this inherits from role[allinone], sets default attributes required by our jenkins jobs.
role[allinone]
"mysql" => {
"allow_remote_root" => true
},
"glance" => {
"image_upload" => true,
"images" => ["tty"]
},
"package_component" => "folsom",
"public" => {
"bridge_dev" => "eth0.100"
},
"private" => {
"bridge_dev" => "eth0.101"
},
"virt_type" => "qemu"
Description: This inherits from role[single-compute], and sets default attributes required by our jenkins jobs.
role[single-compute]
"mysql" => {
"allow_remote_root" => true
},
"package_component" => "folsom",
"public" => {
"bridge_dev" => "eth0.100"
},
"private" => {
"bridge_dev" => "eth0.101"
},
"virt_type" => "qemu"
Description: This inherits from role[single-controller], and sets default attributes required by our jenkins jobs.
role[single-controller]
"mysql" => {
"allow_remote_root" => true,
"root_network_acl" => "%"
},
"glance" => {
"image_upload" => true,
"images" => ["tty"]
},
"package_component" => "folsom",
"public" => {
"bridge_dev" => "eth0.100"
},
"private" => {
"bridge_dev" => "eth0.101"
},
"virt_type" => "qemu"
Description: "Installs and Configures a Keystone Server" TODO: Rename to keystone-server
role[base]
recipe[keystone::server]
Expects that a node with role[mysql-master] exists
Description: "MySQL Server (non-ha)"
role[base]
recipe[mysql::server]
Description: "Installs and Configures the OpenStack EC2 compatability API."
role[base]
recipe[nova::api-ec2]
TODO: Need to make sure this list is correct
Description: "Installs and Configures the OpenStack API."
role[base]
recipe[nova::api-os-compute]
TODO: Need to make sure this list is correct
Description: "Installs and Configures both OpenStack APIs (OS and EC2)."
role[base]
recipe[nova::api-ec2]
recipe[nova::api-os-compute]
TODO: Need to make sure this list is correct
TODO: Needs to be filled out
Description: "Installs the Nova Scheduler Service."
role[base]
recipe[nova::scheduler]
Description: "Installs the Nova VNCProxy Service."
role[base]
recipe[nova::vncproxy]
Description: "Installs the Nova Volume Service."
role[base]
recipe[nova::volume]
Description: "Installs a RabbitMQ Server."
role[base]
recipe[erlang::default]
recipe[rabbitmq::default]
Description "Nova core functions"
role[base] role[nova-setup] role[nova-scheduler] role[nova-api-ec2] role[nova-api-os-compute] role[nova-volume] role[nova-vncproxy] )
Description: "Installs the Nova Compute Service."
role[base]
recipe[nova::compute]
Description: "Installs and configures a (non-HA) Nova Controller."
role[base]
role[mysql-master]
role[rabbitmq-server]
role[keystone]
role[glance-registry]
role[glance-api]
role[nova-controller]
role[nova-scheduler]
role[nova-api-ec2]
role[nova-api-os-compute]
role[nova-volume]
role[nova-vncproxy]
role[horizon-server]
TODO: Needs to be filled out
TODO: Needs to be filled out
TODO: Needs to be filled out
TODO: Needs to be filled out
TODO: Needs to be filled out
Description "Collectd Server"
role[base] recipe[collectd-graphite::collectd-server] )
Description "Collectd Client"
role[base] recipe[collectd-graphite::collectd-client] )
Description "graphite and carbon/whisper"
role[base] recipe[graphite::graphite] recipe[graphite::carbon] )