From 61b0db8129b73a48689d4cc69f007d1ec0f83397 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 16 Nov 2011 08:36:14 -0800 Subject: [PATCH] Add module to prime a devstack template host. Change-Id: I92790b1adad5ad9c04f6acb548d869c78e56ceb4 --- manifests/site.pp | 6 +++ modules/devstack_host/files/rabbitmq-env.conf | 4 ++ modules/devstack_host/manifests/init.pp | 37 +++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 modules/devstack_host/files/rabbitmq-env.conf create mode 100644 modules/devstack_host/manifests/init.pp diff --git a/manifests/site.pp b/manifests/site.pp index 9efba18e85..b887ae6e04 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -155,6 +155,12 @@ node "docs.openstack.org" { include doc_server } +node "devstack-oneiric.template.openstack.org" { + include openstack_server + include devstack_host +} + + # # Jenkins slaves: # diff --git a/modules/devstack_host/files/rabbitmq-env.conf b/modules/devstack_host/files/rabbitmq-env.conf new file mode 100644 index 0000000000..ce9f3c4689 --- /dev/null +++ b/modules/devstack_host/files/rabbitmq-env.conf @@ -0,0 +1,4 @@ +# This file is managed by puppet +# Use localhost in the node name so that we don't need to +# touch /etc/hosts or use dns +NODENAME=rabbit@localhost diff --git a/modules/devstack_host/manifests/init.pp b/modules/devstack_host/manifests/init.pp new file mode 100644 index 0000000000..6b64f936d7 --- /dev/null +++ b/modules/devstack_host/manifests/init.pp @@ -0,0 +1,37 @@ +# A machine ready to run devstack +class devstack_host { + + package { "mysql-server": + ensure => "latest", + } + + package { "rabbitmq-server": + ensure => "latest", + require => File['rabbitmq-env.conf'], + } + + file { "/etc/rabbitmq": + ensure => "directory", + } + + file { 'rabbitmq-env.conf': + name => '/etc/rabbitmq/rabbitmq-env.conf', + owner => 'root', + group => 'root', + mode => 444, + ensure => 'present', + source => [ + "puppet:///modules/devstack_host/rabbitmq-env.conf", + ], + require => File['/etc/rabbitmq'], + } + + exec { "Set MySQL server root password": + subscribe => [ Package["mysql-server"]], + refreshonly => true, + unless => "mysqladmin -uroot -psecret status", + path => "/bin:/usr/bin", + command => "mysqladmin -uroot password secret", + } + +}