Puppet is really handy for initial configuration of the environment, however it's actually really poor at running stack.sh because you don't get any output as you go. This instead moves that to the shell provisioning tool to make for a better interactive experience. Change-Id: Ia00a68d7ebd58a5b0ab653e53fb4e479b408c2a2
50 lines
1.0 KiB
Puppet
50 lines
1.0 KiB
Puppet
# == Class: devstack
|
|
#
|
|
|
|
class devstack(
|
|
$dir = '/home/stack/devstack'
|
|
)
|
|
{
|
|
$user = $user::stack::username
|
|
|
|
if $devstack_git {
|
|
$source = $devstack_git
|
|
} else {
|
|
$source = 'https://github.com/openstack-dev/devstack'
|
|
}
|
|
|
|
if $devstack_branch {
|
|
$branch = $devstack_branch
|
|
} else {
|
|
$branch = 'master'
|
|
}
|
|
|
|
exec { 'devstack_clone':
|
|
require => File['/usr/local/bin/git_clone.sh'],
|
|
path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:.',
|
|
environment => "HOME=/home/$user",
|
|
user => 'stack',
|
|
group => 'stack',
|
|
command => "/usr/local/bin/git_clone.sh ${source} ${branch} ${dir}",
|
|
logoutput => true,
|
|
timeout => 1200,
|
|
}
|
|
|
|
file { "$dir/local.sh":
|
|
owner => $user,
|
|
group => $user,
|
|
mode => '0755',
|
|
source => 'puppet:///modules/devstack/local.sh',
|
|
require => Exec['devstack_clone'],
|
|
}
|
|
|
|
file { "$dir/local.conf":
|
|
owner => $user,
|
|
group => $user,
|
|
mode => '0644',
|
|
content => template('devstack/local.erb'),
|
|
require => File["$dir/local.sh"],
|
|
}
|
|
|
|
}
|