Add swift roles
This adds roles for testing swift. imports swift roles from the swift module. Adds swift roles to hosts.pp makes keystone role more specific (so that it will not match our new swift_keystone role) Add vagrant definitions for swift converts all config to hiera. share the hiera data folder add heira config files
This commit is contained in:
45
Vagrantfile
vendored
45
Vagrantfile
vendored
@@ -94,6 +94,38 @@ Vagrant::Config.run do |config|
|
||||
'ip1' => '172.16.0.10'
|
||||
}
|
||||
},
|
||||
{ 'swift_proxy' => {
|
||||
'memory' => 512,
|
||||
'ip1' => '172.16.0.21',
|
||||
'run_mode' => :agent
|
||||
}
|
||||
},
|
||||
{ 'swift_storage_1' => {
|
||||
'memory' => 512,
|
||||
'ip1' => '172.16.0.22',
|
||||
'run_mode' => :agent
|
||||
}
|
||||
},
|
||||
{ 'swift_storage_2' => {
|
||||
'memory' => 512,
|
||||
'ip1' => '172.16.0.23',
|
||||
'run_mode' => :agent
|
||||
}
|
||||
},
|
||||
{ 'swift_storage_3' => {
|
||||
'memory' => 512,
|
||||
'ip1' => '172.16.0.24',
|
||||
'run_mode' => :agent
|
||||
}
|
||||
},
|
||||
# keystone instance to build out for testing swift
|
||||
{
|
||||
'swift_keystone' => {
|
||||
'memory' => 512,
|
||||
'ip1' => '172.16.0.25',
|
||||
'run_mode' => :agent
|
||||
}
|
||||
},
|
||||
{ 'puppetmaster' => {
|
||||
'memory' => 512,
|
||||
'ip1' => '172.16.0.31'
|
||||
@@ -140,12 +172,9 @@ Vagrant::Config.run do |config|
|
||||
agent.vm.provision :shell, :inline => "yum clean all"
|
||||
end
|
||||
|
||||
agent.vm.provision :puppet do |puppet|
|
||||
puppet.manifests_path = 'manifests'
|
||||
puppet.manifest_file = "setup/#{os_name}.pp"
|
||||
puppet.module_path = 'modules'
|
||||
#puppet.options = ['--verbose', '--show_diff', "--certname=#{node_name}"]
|
||||
puppet.options = ["--certname=#{node_name}"]
|
||||
puppet_options = ["--certname=#{node_name}"]
|
||||
puppet_options.merge!({'--verbose', '--show_diff'}) if v_config['verbose']
|
||||
|
||||
if v_config['update_repos'] == true
|
||||
|
||||
agent.vm.provision(:puppet, :pp_path => "/etc/puppet") do |puppet|
|
||||
@@ -171,6 +200,10 @@ Vagrant::Config.run do |config|
|
||||
puppet.module_path = 'modules'
|
||||
#puppet.options = ['--verbose', '--show_diff', "--certname=#{node_name}"]
|
||||
puppet.options = ["--certname=#{node_name}"]
|
||||
|
||||
# export a data directory that can be used by hiera
|
||||
agent.vm.share_folder("hiera_data", '/etc/puppet/hiera_data', './hiera_data/')
|
||||
|
||||
run_mode = props['run_mode'] || :apply
|
||||
|
||||
if run_mode == :apply
|
||||
|
||||
43
hiera_data/common.yaml
Normal file
43
hiera_data/common.yaml
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
# database password
|
||||
mysql_root_password: mysql_root_password
|
||||
keystone_db_password: keystone_db_password
|
||||
glance_db_password: glance_db_password
|
||||
nova_db_password: nova_db_password
|
||||
cinder_db_password: cinder_db_password
|
||||
quantum_db_password: quantum_db_password
|
||||
# mysql allowed hosts
|
||||
allowed_hosts:
|
||||
- %
|
||||
# keystone settings
|
||||
admin_token: service_token
|
||||
admin_email: keystone@localhost
|
||||
admin_password: ChangeMe
|
||||
glance_user_password: glance_user_password
|
||||
nova_user_password: nova_user_password
|
||||
cinder_user_password: cinder_user_password
|
||||
quantum_user_password: quantum_user_password
|
||||
verbose: True
|
||||
# nova settings
|
||||
public_interface: eth0
|
||||
private_interface: eth2
|
||||
rabbit_password: rabbit_password
|
||||
rabbit_user: nova
|
||||
secret_key: secret_key
|
||||
libvirt_type: qemu
|
||||
#libvirt_type: kvm
|
||||
network_type: nova
|
||||
#network_type: quantum
|
||||
fixed_network_range: 10.0.0.0/24
|
||||
floating_network_range: 172.16.0.128/25
|
||||
auto_assign_floating_ip: false
|
||||
# openstack controller ip address
|
||||
openstack_controller: 172.16.0.3
|
||||
# swift settings
|
||||
swift_admin_email: dan@example_company.com
|
||||
admin_password: admin_password
|
||||
swift_user_password: swift_pass
|
||||
swift_shared_secret: changeme
|
||||
swift_local_net_ip: "%{ipaddress_eth1}"
|
||||
swift_proxy_address: 172.16.0.21
|
||||
swift_controller_node_public: 172.16.0.21
|
||||
2
hiera_data/swift-storage-1.yaml
Normal file
2
hiera_data/swift-storage-1.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
swift_zone: 1
|
||||
2
hiera_data/swift-storage-2.yaml
Normal file
2
hiera_data/swift-storage-2.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
swift_zone: 2
|
||||
3
hiera_data/swift-storage-3.yaml
Normal file
3
hiera_data/swift-storage-3.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
swift_zone: 3
|
||||
|
||||
@@ -23,7 +23,7 @@ node /mysql/ {
|
||||
|
||||
}
|
||||
|
||||
node /keystone/ {
|
||||
node /^keystone/ {
|
||||
|
||||
# TODO keystone logging seems to be totally broken in folsom
|
||||
# this can be removed once it starts working
|
||||
|
||||
@@ -12,6 +12,10 @@ host {
|
||||
'mysql': ip => '172.16.0.8';
|
||||
'cinderclient': ip => '172.16.0.9';
|
||||
'quantumagent': ip => '172.16.0.10';
|
||||
'swift_proxy': ip => '172.16.0.21';
|
||||
'swift_storage_1': ip => '172.16.0.22';
|
||||
'swift_storage_2': ip => '172.16.0.23';
|
||||
'swift_storage_3': ip => '172.16.0.24';
|
||||
}
|
||||
|
||||
group { 'puppet':
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
# basic single and multi-node openstack environments.
|
||||
#
|
||||
|
||||
|
||||
####### shared variables ##################
|
||||
|
||||
#Exec {
|
||||
@@ -11,38 +10,37 @@
|
||||
#}
|
||||
|
||||
# database config
|
||||
$mysql_root_password = 'mysql_root_password'
|
||||
$keystone_db_password = 'keystone_db_password'
|
||||
$glance_db_password = 'glance_db_password'
|
||||
$nova_db_password = 'nova_db_password'
|
||||
$cinder_db_password = 'cinder_db_password'
|
||||
$quantum_db_password = 'quantum_db_password'
|
||||
$mysql_root_password = hiera('mysql_root_password', 'mysql_root_password')
|
||||
$keystone_db_password = hiera('keystone_db_password', 'keystone_db_password')
|
||||
$glance_db_password = hiera('glance_db_password', 'glance_db_password')
|
||||
$nova_db_password = hiera('nova_db_password', 'nova_db_password')
|
||||
$cinder_db_password = hiera('cinder_db_password', 'cinder_db_password')
|
||||
$quantum_db_password = hiera('quantum_db_password', 'quantum_db_password')
|
||||
|
||||
$allowed_hosts = ['%']
|
||||
$allowed_hosts = hiera('allowed_hosts', ['%'])
|
||||
|
||||
# keystone settings
|
||||
$admin_token = 'service_token'
|
||||
$admin_email = 'keystone@localhost'
|
||||
$admin_password = 'ChangeMe'
|
||||
$glance_user_password = 'glance_user_password'
|
||||
$nova_user_password = 'nova_user_password'
|
||||
$cinder_user_password = 'cinder_user_password'
|
||||
$quantum_user_password = 'quantum_user_password'
|
||||
# keystone settings)
|
||||
$admin_token = hiera('admin_token', 'service_token')
|
||||
$admin_email = hiera('admin_email', 'keystone@localhost')
|
||||
$admin_password = hiera('admin_password', 'ChangeMe')
|
||||
$glance_user_password = hiera('glance_user_password', 'glance_user_password')
|
||||
$nova_user_password = hiera('nova_user_password', 'nova_user_password')
|
||||
$cinder_user_password = hiera('cinder_user_password', 'cinder_user_password')
|
||||
$quantum_user_password = hiera('quantum_user_password', 'quantum_user_password')
|
||||
|
||||
$verbose = 'True'
|
||||
$verbose = hiera('verbose', 'True')
|
||||
|
||||
$public_interface = 'eth0'
|
||||
$private_interface = 'eth2'
|
||||
$public_interface = hiera('public_interface', 'eth0')
|
||||
$private_interface = hiera('private_interface', 'eth2')
|
||||
|
||||
$rabbit_password = 'rabbit_password'
|
||||
$rabbit_user = 'nova'
|
||||
$rabbit_password = hiera('rabbit_password', 'rabbit_password')
|
||||
$rabbit_user = hiera('rabbit_user', 'nova')
|
||||
|
||||
$secret_key = 'secret_key'
|
||||
$secret_key = hiera('secret_key', 'secret_key')
|
||||
|
||||
$libvirt_type = 'qemu'
|
||||
#$libvirt_type = 'kvm'
|
||||
#$network_type = 'quantum'
|
||||
$network_type = 'nova'
|
||||
$libvirt_type = hiera('libvirt_type', 'qemu')
|
||||
#$network_type = hiera('', 'quantum')
|
||||
$network_type = hiera('', 'nova')
|
||||
if $network_type == 'nova' {
|
||||
$use_quantum = false
|
||||
$multi_host = true
|
||||
@@ -50,15 +48,15 @@ if $network_type == 'nova' {
|
||||
$use_quantum = true
|
||||
}
|
||||
|
||||
$fixed_network_range = '10.0.0.0/24'
|
||||
$floating_network_range = '172.16.0.128/25'
|
||||
$fixed_network_range = hiera('fixed_network_range', '10.0.0.0/24')
|
||||
$floating_network_range = hiera('floating_network_range', '172.16.0.128/25')
|
||||
|
||||
$auto_assign_floating_ip = false
|
||||
$auto_assign_floating_ip = hiera('auto_assign_floating_ip', false)
|
||||
|
||||
#### end shared variables #################
|
||||
|
||||
#### controller/compute mode settings ####
|
||||
$openstack_controller = '172.16.0.3'
|
||||
$openstack_controller = hiera('openstack_controller', '172.16.0.3')
|
||||
#### controller/compute mode settings ####
|
||||
|
||||
# node declaration for all in one
|
||||
@@ -66,6 +64,9 @@ import 'scenarios/all_in_one.pp'
|
||||
# node declarations for a single server per role
|
||||
import 'scenarios/multi_role.pp'
|
||||
|
||||
# import external swift definitions
|
||||
import '/etc/puppet/modules-0/swift/examples/site.pp'
|
||||
|
||||
node /openstack-controller/ {
|
||||
|
||||
# deploy a script that can be used to test nova
|
||||
|
||||
Reference in New Issue
Block a user