mirror of
https://github.com/sstent/Vagrant_Openstack.git
synced 2026-01-26 07:03:04 +00:00
inital commit
This commit is contained in:
1
.vagrant.v1.1373639075
Normal file
1
.vagrant.v1.1373639075
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"active":{"master":"d823bfc9-ef9e-44fc-a85e-78dfebeb26f3","controller":"66baa24c-0474-42d0-9880-89b4bb9a24cc","compute1":"af5beec5-26a5-43c6-8473-ad6f54b1fc5a"}}
|
||||||
1
.vagrant/machines/compute1/virtualbox/id
Normal file
1
.vagrant/machines/compute1/virtualbox/id
Normal file
@@ -0,0 +1 @@
|
|||||||
|
27bb383d-c4f5-4943-a459-5cd5ecf2f6c3
|
||||||
1
.vagrant/machines/controller/virtualbox/id
Normal file
1
.vagrant/machines/controller/virtualbox/id
Normal file
@@ -0,0 +1 @@
|
|||||||
|
bfcdeb20-d7cb-45f4-8fc4-394378ea1c78
|
||||||
1
.vagrant/machines/puppet/virtualbox/id
Normal file
1
.vagrant/machines/puppet/virtualbox/id
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ff2024ca-2e17-4988-93a3-eb3885c64872
|
||||||
48
Vagrantfile
vendored
Normal file
48
Vagrantfile
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
|
||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
Vagrant::Config.run do |config|
|
||||||
|
# All Vagrant configuration is done here. The most common configuration
|
||||||
|
# options are documented and commented below. For a complete reference,
|
||||||
|
# please see the online documentation at vagrantup.com.
|
||||||
|
|
||||||
|
# Every Vagrant virtual environment requires a box to build off of.
|
||||||
|
config.vm.box = "Centos64Puppet"
|
||||||
|
config.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210.box"
|
||||||
|
|
||||||
|
config.vm.define :puppet do |puppet_config|
|
||||||
|
puppet_config.vm.host_name = "puppet.vagrant.info"
|
||||||
|
puppet_config.vm.network :hostonly, "192.168.33.10" #eth1 MGMT
|
||||||
|
end
|
||||||
|
config.vm.define :controller do |controller_config|
|
||||||
|
controller_config.vm.host_name = "controller.vagrant.info"
|
||||||
|
controller_config.vm.network :hostonly, "192.168.33.11" #eth1 MGMT
|
||||||
|
controller_config.vm.network :hostonly, "10.0.1.11" #eth2 VM Traffic
|
||||||
|
controller_config.vm.network :hostonly, "10.0.2.11" #eth3 floating
|
||||||
|
controller_config.vm.customize ["modifyvm", :id, "--nicpromisc4", "allow-all"] # eth3
|
||||||
|
controller_config.vm.provision :shell, :inline => "ip link set mtu 1546 dev eth2"
|
||||||
|
controller_config.vm.forward_port 80, 8080
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.define :compute1 do |compute1_config|
|
||||||
|
compute1_config.vm.host_name = "compute1.vagrant.info"
|
||||||
|
compute1_config.vm.network :hostonly, "192.168.33.12" #eth1 MGMT
|
||||||
|
compute1_config.vm.network :hostonly, "10.0.1.12"
|
||||||
|
compute1_config.vm.provision :shell, :inline => "ip link set mtu 1546 dev eth2"
|
||||||
|
compute1_config.vm.customize ["modifyvm", :id, "--memory", 2048]
|
||||||
|
compute1_config.vm.customize ["modifyvm", :id, "--cpus", 4]
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.boot_mode = :headless
|
||||||
|
|
||||||
|
config.vm.provision :puppet do |puppet|
|
||||||
|
puppet.manifests_path = "manifests"
|
||||||
|
puppet.module_path = "modules"
|
||||||
|
|
||||||
|
puppet.manifest_file = "site.pp"
|
||||||
|
puppet.options = "--verbose --debug"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
70
Vagrantfile.save
Normal file
70
Vagrantfile.save
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
Vagrant::Config.run do |config|
|
||||||
|
# All Vagrant configuration is done here. The most common configuration
|
||||||
|
# options are documented and commented below. For a complete reference,
|
||||||
|
# please see the online documentation at vagrantup.com.
|
||||||
|
|
||||||
|
# Every Vagrant virtual environment requires a box to build off of.
|
||||||
|
config.vm.box = "Centos64Puppet"
|
||||||
|
|
||||||
|
config.vm.define :master do |master_config|
|
||||||
|
master_config.vm.host_name = "master.vagrant.info"
|
||||||
|
master_config.vm.network :hostonly, "192.168.33.10" # Enable provisioning with chef solo, specifying a cookbooks path, roles
|
||||||
|
# path, and data_bags path (all relative to this Vagrantfile), and adding
|
||||||
|
# some recipes and/or roles.
|
||||||
|
#
|
||||||
|
# config.vm.provision :chef_solo do |chef|
|
||||||
|
# chef.cookbooks_path = "../my-recipes/cookbooks"
|
||||||
|
# chef.roles_path = "../my-recipes/roles"
|
||||||
|
# chef.data_bags_path = "../my-recipes/data_bags"
|
||||||
|
# chef.add_recipe "mysql"
|
||||||
|
# chef.add_role "web"
|
||||||
|
#
|
||||||
|
# # You may also specify custom JSON attributes:
|
||||||
|
# chef.json = { :mysql_password => "foo" }
|
||||||
|
# end
|
||||||
|
|
||||||
|
# Enable provisioning with chef server, specifying the chef server URL,
|
||||||
|
# and the path to the validation key (relative to this Vagrantfile).
|
||||||
|
#
|
||||||
|
# The Opscode Platform uses HTTPS. Substitute your organization for
|
||||||
|
# ORGNAME in the URL and validation key.
|
||||||
|
#
|
||||||
|
# If you have your own Chef Server, use the appropriate URL, which may be
|
||||||
|
# HTTP instead of HTTPS depending on your configuration. Also change the
|
||||||
|
# validation key to validation.pem.
|
||||||
|
#
|
||||||
|
# config.vm.provision :chef_client do |chef|
|
||||||
|
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
|
||||||
|
# chef.validation_key_path = "ORGNAME-validator.pem"
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# If you're using the Opscode platform, your validator client is
|
||||||
|
# ORGNAME-validator, replacing ORGNAME with your organization name.
|
||||||
|
#
|
||||||
|
# IF you have your own Chef Server, the default validation client name is
|
||||||
|
# chef-validator, unless you changed the configuration.
|
||||||
|
#
|
||||||
|
# chef.validation_client_name = "ORGNAME-validator"
|
||||||
|
|
||||||
|
end
|
||||||
|
config.vm.define :client do |client_config|
|
||||||
|
client_config.vm.host_name = "client.vagrant.info"
|
||||||
|
client_config.vm.network :hostonly, "192.168.33.11"
|
||||||
|
client_config.vm.forward_port 80, 8080
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
config.vm.boot_mode = :headless
|
||||||
|
|
||||||
|
# config.vm.provision :puppet do |puppet|
|
||||||
|
# puppet.manifests_path = "manifests"
|
||||||
|
# puppet.manifest_file = "site.pp"
|
||||||
|
# puppet.options = "--verbose --debug"
|
||||||
|
#
|
||||||
|
# end
|
||||||
|
|
||||||
|
end
|
||||||
157
manifests/site.pp
Normal file
157
manifests/site.pp
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
node puppet {
|
||||||
|
|
||||||
|
#ensure git is installed
|
||||||
|
package { 'puppetlabs-release-6-7':
|
||||||
|
provider => 'rpm',
|
||||||
|
ensure => installed,
|
||||||
|
source => "http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-7.noarch.rpm";
|
||||||
|
'git':
|
||||||
|
ensure => 'present';
|
||||||
|
'puppet-server':
|
||||||
|
require => Package["puppetlabs-release-6-7"],
|
||||||
|
ensure => 'present';
|
||||||
|
'rubygem-rake':
|
||||||
|
ensure => 'present';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
vcsrepo { '/etc/puppet/modules/openstack':
|
||||||
|
require => Package["puppet-server"],
|
||||||
|
ensure => latest,
|
||||||
|
provider => git,
|
||||||
|
source => 'https://sstent:farscape5@github.com/stratustech/puppet-openstack.git',
|
||||||
|
notify => File["/etc/puppet/modules/openstack"];
|
||||||
|
'/etc/puppet/manifests':
|
||||||
|
require => [Package["puppet-server"],File['/etc/puppet/manifests']],
|
||||||
|
ensure => latest,
|
||||||
|
provider => git,
|
||||||
|
source => 'https://sstent:farscape5@github.com/stratustech/POC_ALPHA.git';
|
||||||
|
'/etc/puppet/modules/rabbitmq':
|
||||||
|
require => Package["puppet-server"],
|
||||||
|
ensure => latest,
|
||||||
|
provider => git,
|
||||||
|
source => 'https://github.com/gergnz/puppetlabs-rabbitmq.git';
|
||||||
|
'/etc/puppet/modules/horizon':
|
||||||
|
require => Package["puppet-server"],
|
||||||
|
ensure => latest,
|
||||||
|
provider => git,
|
||||||
|
source => 'https://sstent:farscape5@github.com/stratustech/puppet-horizon.git';
|
||||||
|
}
|
||||||
|
|
||||||
|
file { "/etc/puppet/modules/openstack":
|
||||||
|
require => Package["puppet-server"],
|
||||||
|
ensure => "directory",
|
||||||
|
owner => "root",
|
||||||
|
group => "root",
|
||||||
|
mode => 755,
|
||||||
|
recurse => true,
|
||||||
|
notify => Exec["sudo rake modules:clone"];
|
||||||
|
"/etc/puppet/manifests":
|
||||||
|
require => Package["puppet-server"],
|
||||||
|
before => Vcsrepo['/etc/puppet/manifests'],
|
||||||
|
force => true,
|
||||||
|
backup => false,
|
||||||
|
ensure => "absent";
|
||||||
|
"/etc/puppet/autosign.conf":
|
||||||
|
require => Package["puppet-server"],
|
||||||
|
owner => "root",
|
||||||
|
group => "root",
|
||||||
|
mode => 0644,
|
||||||
|
content => "*";
|
||||||
|
}
|
||||||
|
|
||||||
|
exec {"sudo rake modules:clone":
|
||||||
|
require => [Package["rubygem-rake"],Vcsrepo['/etc/puppet/modules/horizon','/etc/puppet/modules/rabbitmq','/etc/puppet/manifests','/etc/puppet/modules/openstack']],
|
||||||
|
cwd => "/etc/puppet/modules/openstack",
|
||||||
|
path => ["/usr/local/bin","/bin","/usr/bin","/usr/local/sbin","/usr/sbin","/sbin","/home/vagrant/bin"];
|
||||||
|
}
|
||||||
|
|
||||||
|
service { "iptables":
|
||||||
|
ensure => "stopped",
|
||||||
|
enable => false;
|
||||||
|
"puppetmaster":
|
||||||
|
require => [File["/etc/puppet/autosign.conf"],Exec["sudo rake modules:clone"]],
|
||||||
|
ensure => "running",
|
||||||
|
enable => true;
|
||||||
|
}
|
||||||
|
|
||||||
|
host { 'controller.vagrant.info':
|
||||||
|
ip => '192.168.33.11',
|
||||||
|
host_aliases => 'controller';
|
||||||
|
'compute1.vagrant.info':
|
||||||
|
ip => '192.168.33.12',
|
||||||
|
host_aliases => 'compute1';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
node controller {
|
||||||
|
|
||||||
|
#ensure git is installed
|
||||||
|
package { 'puppetlabs-release-6-7':
|
||||||
|
provider => 'rpm',
|
||||||
|
ensure => installed,
|
||||||
|
source => "http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-7.noarch.rpm";
|
||||||
|
'puppet':
|
||||||
|
require => Package["puppetlabs-release-6-7"],
|
||||||
|
ensure => 'present';
|
||||||
|
}
|
||||||
|
|
||||||
|
service { "iptables":
|
||||||
|
ensure => "stopped",
|
||||||
|
enable => false;
|
||||||
|
"puppet":
|
||||||
|
require => Package["puppet"],
|
||||||
|
ensure => "running",
|
||||||
|
enable => true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
host { 'puppet.vagrant.info':
|
||||||
|
ip => '192.168.33.10',
|
||||||
|
host_aliases => 'puppet';
|
||||||
|
'compute1.vagrant.info':
|
||||||
|
ip => '192.168.33.12',
|
||||||
|
host_aliases => 'compute1';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
node compute1 {
|
||||||
|
|
||||||
|
#ensure git is installed
|
||||||
|
package { 'puppetlabs-release-6-7':
|
||||||
|
provider => 'rpm',
|
||||||
|
ensure => installed,
|
||||||
|
source => "http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-7.noarch.rpm";
|
||||||
|
'puppet':
|
||||||
|
require => Package["puppetlabs-release-6-7"],
|
||||||
|
ensure => 'present';
|
||||||
|
}
|
||||||
|
|
||||||
|
service { "puppet":
|
||||||
|
require => Package["puppet"],
|
||||||
|
ensure => "running",
|
||||||
|
enable => true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
host { 'puppet.vagrant.info':
|
||||||
|
ip => '192.168.33.10',
|
||||||
|
host_aliases => 'puppet';
|
||||||
|
'controller.vagrant.info':
|
||||||
|
ip => '192.168.33.11',
|
||||||
|
host_aliases => 'controller';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
1
modules/vcsrepo
Submodule
1
modules/vcsrepo
Submodule
Submodule modules/vcsrepo added at 2c81045b53
Reference in New Issue
Block a user