forked from mattymo/fuelweb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
80 lines (62 loc) · 2.59 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# -*- mode: ruby -*-
# vi: set ft=ruby :
ENVIRONMENT_SETUP_SCRIPT = <<-EOS
# To use this script, you must fetch fuel submodule:
# git submodule update
#!/bin/bash
grep -q devnailgun /etc/hosts || echo "10.0.2.15 devnailgun.mirantis.com devnailgun" >> /etc/hosts
sed 's/HOSTNAME=.*/HOSTNAME=devnailgun.mirantis.com/' -i /etc/sysconfig/network
echo "Installing puppet..."
rpm -Uhv http://fedora-mirror02.rbc.ru/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-6.noarch.rpm
for pkg in `grep puppet /vagrant/requirements-rpm.txt`; do yum -y install $pkg; done
echo "Configuring puppet..."
grep -q devnailgun /etc/puppet/puppet.conf || echo " server = devnailgun.mirantis.com" >> /etc/puppet/puppet.conf
grep -q autosign /etc/puppet/puppet.conf || echo "\n[master]\n autosign = true" >> /etc/puppet/puppet.conf
chkconfig puppetmaster on; service puppetmaster restart
echo "Use fuel puppet modules to install mcollective&rabbitmq"
rm -f /etc/puppet/modules.old || :
mv /etc/puppet/modules /etc/puppet/modules.old || :
ln -sfT /fuel/deployment/puppet /etc/puppet/modules
mv /etc/puppet/manifests/site.pp /etc/puppet/manifests/site.pp.old || :
cat > /etc/puppet/manifests/site.pp << EOF
node default {
Exec {path => '/usr/bin:/bin:/usr/sbin:/sbin'}
class { mcollective::rabbitmq:
user => "mcollective",
password => "marionette",
}
class { mcollective::client:
pskey => "unset",
user => "mcollective",
password => "marionette",
host => "127.0.0.1",
port => "61613"
}
}
EOF
puppet agent --test
echo "Restoring site.pp and modules to previously set.."
mv /etc/puppet/modules.old /etc/puppet/modules || :
mv /etc/puppet/manifests/site.pp.old /etc/puppet/manifests/site.pp || :
echo "Installing mcollective..."
for pkg in `grep mcollective /vagrant/requirements-rpm.txt`; do yum -y install $pkg; done
chkconfig mcollective on
service mcollective start
# Debug tools
yum -y install strace bind-utils
yum -y install httpd
EOS
Vagrant::Config.run do |config|
config.vm.define :centos63 do |vm_config|
vm_config.vm.box = "centos63"
vm_config.vm.box_url = "http://srv08-srt.srt.mirantis.net/CentOS-6.3-x86_64-minimal.box"
vm_config.vm.customize ["modifyvm", :id, "--memory", 1024]
# Boot with a GUI so you can see the screen. (Default is headless)
#config.vm.boot_mode = :gui
config.vm.share_folder "v-data", "/fuel", "./fuel"
# extra network for testing
vm_config.vm.network :hostonly, '10.1.1.2', :adapter => 2
vm_config.vm.provision :shell, :inline => ENVIRONMENT_SETUP_SCRIPT
end
end