Update repo with new testing suite

The new testing suite is based upon Chef 12, Chef DK and
Chef Provisioning.  It supports all in one and multi node
environments.  It will be used as the base for future gate
integration testing.  There's is more work to as noted in
the TODO list at the botton of the readme.

Note: to get this thru the existing gate, had to keep the existing
Gemfile.  Added a Gemfile-Provisioning for new stuff and updated
readme with some notes on that.  When we make the switch to kilo
rake gates, we can decide what type of gates the repo needs. I think
it's ready for rubocop at least and maybe continue with something
like spiecweasel to look at the role and environment syntax.

Added draft bootstrap and test default to rubocop to rakefile to
allow for easy integration with new gate rake jobs.

Change-Id: I187df8b78c4cecfb783ab26a6b66b8e8dd6745bd
This commit is contained in:
Mark Vanderwiel 2015-02-26 11:00:49 -06:00
parent e029b6a1ad
commit 016a08eadc
69 changed files with 1618 additions and 1334 deletions

11
.chef/encrypted_data_bag_secret Executable file
View File

@ -0,0 +1,11 @@
wfBM0OA4p1hsqM1tsRNCCFhcjDXP4lffgLvFNbTPgMjh6TZvLDHlrwiA41rqMzdI
SOzSsyO9TBlcwfinbyJcObMpLklSv3wNJ6oWEpa1e78YL998RXx3zmMOoT/SEfWI
ZFN/H5xe+YX4T8T3+W+rfjQH3GP0fTbNfOYtgDthsmtUF05LtBlgxxUXscGkG74D
qDO6f3K97Dcd07QFeMorwvrIBkYDtTyU90HqR1aksMD06fpA2LSGfrLu1ykVUUlb
rTi+O9tyMifSs9SLoJjnrDkeujh3UQXRr4vRwP9tkefEtbQE8OiRpRJ72kLPX2eE
FQGQKjKCk3edAknp7RHhzk66GbUUzY/H+FAJfjFHycIR1rLAHxIbJFToH4dKGj9w
jFkHxgnnGK8TPm7mwyrvo6obR8gBSbG+1xgMiA2/fNoLyuiSqtm21n/1/81QPKBc
FllWAaA8xR6l2Ji8JPoJ705Msk6183ODeN//vn2JvwxacUL9HWqI6Gy2SsETQ3yW
A6PzVVnKHpevco7TH9HhuhKIlpYbjWv4YMUlLAz/5PbbLiOJtDGB54o/6hQGqOP0
3jscQ0ciPjpLgwvQmQJztrB/Uvq6Un2moPLLygwQK0TYSNmM5+BMnB00/aK++y7x
mvymJcSxd48DBrA2NuFDhNBWwOcZSB1R/N50Vs/iq5I=

15
.chef/knife.rb Executable file
View File

@ -0,0 +1,15 @@
# See http://docs.opscode.com/config_rb_knife.html
# for more information on knife configuration options
current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name 'nodienode'
client_key "#{current_dir}/nodienode.pem"
validation_client_name 'chef-validator'
validation_key "#{current_dir}/validator.pem"
chef_server_url 'https://api.opscode.com/organizations/my_awesome_org'
cache_type 'BasicFile'
cache_options(path: "#{ENV['HOME']}/.chef/checksums")
cookbook_path ["#{current_dir}/../cookbooks"]
knife[:secret_file] = "#{current_dir}/encrypted_data_bag_secret"

21
.gitignore vendored
View File

@ -1,11 +1,16 @@
.berkshelf/
.bundle/
.chef/
.cookbooks/
.DS_Store
.kitchen/
.vagrant/
.vagabond/
.zero-knife.rb
berks.json
.kitchen.local.yml
.bundle
.vagrant
berks-cookbooks/
Berksfile.lock
clients/
cookbooks/
Gemfile.lock
nodes/
vms/
.chef/nodienode.pem
.chef/validator.pem
.chef/local-mode-cache/
.project

11
.rubocop.yml Normal file
View File

@ -0,0 +1,11 @@
AllCops:
Include:
- '**/*.rb'
- '**/Gemfile'
- environments/**/*.rb
- roles/**/*.rb
- .chef/**/*.rb
Exclude:
- cookbooks/**/*
- vms/**/*
- nodes/**/*

View File

@ -13,22 +13,22 @@ cookbook 'mysql2_chef_gem', '1.0.1'
cookbook 'openssl', '4.0.0'
cookbook 'postgresql', '3.4.18'
cookbook 'python', '1.4.6'
cookbook 'rabbitmq', '3.10.0'
cookbook 'rabbitmq', '3.9.0'
cookbook 'xfs', '1.1.0'
cookbook 'yum', '3.5.2'
cookbook 'selinux', '0.7.2'
cookbook 'yum-epel', '0.6.0'
cookbook 'statsd', github: 'att-cloud/cookbook-statsd'
cookbook 'openstack-block-storage', github: 'stackforge/cookbook-openstack-block-storage', branch: 'master'
cookbook 'openstack-common', github: 'stackforge/cookbook-openstack-common', branch: 'master'
cookbook 'openstack-compute', github: 'stackforge/cookbook-openstack-compute', branch: 'master'
cookbook 'openstack-dashboard', github: 'stackforge/cookbook-openstack-dashboard', branch: 'master'
cookbook 'openstack-identity', github: 'stackforge/cookbook-openstack-identity', branch: 'master'
cookbook 'openstack-image', github: 'stackforge/cookbook-openstack-image', branch: 'master'
cookbook 'openstack-network', github: 'stackforge/cookbook-openstack-network', branch: 'master'
cookbook 'openstack-object-storage', github: 'stackforge/cookbook-openstack-object-storage', branch: 'master'
cookbook 'openstack-ops-database', github: 'stackforge/cookbook-openstack-ops-database', branch: 'master'
cookbook 'openstack-ops-messaging', github: 'stackforge/cookbook-openstack-ops-messaging', branch: 'master'
cookbook 'openstack-orchestration', github: 'stackforge/cookbook-openstack-orchestration', branch: 'master'
cookbook 'openstack-telemetry', github: 'stackforge/cookbook-openstack-telemetry', branch: 'master'
cookbook 'openstack-block-storage', github: 'stackforge/cookbook-openstack-block-storage', branch: "master"
cookbook 'openstack-common', github: 'stackforge/cookbook-openstack-common', branch: "master"
cookbook 'openstack-compute', github: 'stackforge/cookbook-openstack-compute', branch: "master"
cookbook 'openstack-dashboard', github: 'stackforge/cookbook-openstack-dashboard', branch: "master"
cookbook 'openstack-identity', github: 'stackforge/cookbook-openstack-identity', branch: "master"
cookbook 'openstack-image', github: 'stackforge/cookbook-openstack-image', branch: "master"
cookbook 'openstack-network', github: 'stackforge/cookbook-openstack-network', branch: "master"
cookbook 'openstack-object-storage', github: 'stackforge/cookbook-openstack-object-storage', branch: "master"
cookbook 'openstack-ops-database', github: 'stackforge/cookbook-openstack-ops-database', branch: "master"
cookbook 'openstack-ops-messaging', github: 'stackforge/cookbook-openstack-ops-messaging', branch: "master"
cookbook 'openstack-orchestration', github: 'stackforge/cookbook-openstack-orchestration', branch: "master"
cookbook 'openstack-telemetry', github: 'stackforge/cookbook-openstack-telemetry', branch: "master"

View File

@ -1,40 +0,0 @@
# CHANGELOG for openstack-chef-repo
This file is used to list changes made in each version of openstack-chef-repo
## 10.0.0
* Update to Juno
* Bump mysql and mysql-chef to required levels for Juno
* Bump Chef gem to 11.16
* update berkshelf from 2.0.18 to 3.1.5
* Fix object storage recipe names
* Cleanup ceph cookbook, replace with upstream ceph cookbook
* Add usage with Chef Server manual steps doc
## 9.1.0
* Bump berkshelf to 2.0.18
## 9.0.2
* Add new openrc recipe to all in one role for demos and testing
## 9.0.1
* Add client role
## 9.0.0
* Upgrade to Icehouse
## 8.0.0:
* Updating to Havana
## 7.0.0:
* This is the initial `Grizzly` release of the shared Chef for OpenStack project. It is based on the work done in http://github.com/stackforge and has many contributors.
## 5.0.0:
`Essex` release, no longer actively maintained or supported.
- - -
Check the [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) for help with Markdown.
The [Github Flavored Markdown page](http://github.github.com/github-flavored-markdown/) describes the differences between markdown on github and standard markdown.

36
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,36 @@
Contributing
============
How To Get Started
------------------
If you would like to contribute to the development of OpenStack Chef Cookbooks,
you must follow the steps in this page:
http://docs.openstack.org/infra/manual/developers.html
Gerrit Workflow
---------------
Once those steps have been completed, changes to OpenStack
should be submitted for review via the Gerrit tool, following
the workflow documented at:
http://docs.openstack.org/infra/manual/developers.html#development-workflow
Pull requests submitted through GitHub will be ignored.
Bugs
----
Bugs should be filed on Launchpad, not GitHub:
https://bugs.launchpad.net/openstack-chef
Contacts
--------
Mailing list: groups.google.com/group/opscode-chef-openstack
IRC: #openstack-chef is our channel on irc.freenode.net
Wiki: https://wiki.openstack.org/wiki/Chef/GettingStarted and https://docs.getchef.com/openstack.html
Twitter: @chefopenstack

14
Gemfile
View File

@ -1,8 +1,8 @@
source "https://rubygems.org"
source 'https://rubygems.org'
gem "chef", "~> 11.16.0"
gem "dep-selector-libgecode", "~> 1.0.2"
gem "json", "<= 1.7.7" # chef dependency
gem "spiceweasel", "~> 2.8.0"
gem "berkshelf", "~> 3.1.5"
gem "hashie", "~> 2.0"
gem 'chef', '~> 11.16.0'
gem 'dep-selector-libgecode', '~> 1.0.2'
gem 'json', '<= 1.7.7' # chef dependency
gem 'spiceweasel', '~> 2.8.0'
gem 'berkshelf', '~> 3.1.5'
gem 'hashie', '~> 2.0'

22
Gemfile-Provisioning Normal file
View File

@ -0,0 +1,22 @@
source 'https://rubygems.org'
gem 'chef', '~> 12.0.3'
gem 'chef-provisioning', '~> 0.15'
group :vagrant do
gem 'chef-provisioning-vagrant', '~> 0.8.1'
end
group :lint do
gem 'foodcritic', '~> 4.0.0'
gem 'rubocop', '~> 0.29.0'
end
group :unit do
gem 'berkshelf', '~> 3.2.3'
gem 'chefspec', '~> 4.2.0'
end
group :kitchen do
gem 'test-kitchen', '~> 1.3.1'
end

410
README.md
View File

@ -1,277 +1,211 @@
# Description #
# OpenStack cluster with chef-provisioning
This repository contains examples of the roles, environments and other supporting files for deploying an OpenStack **Juno** reference architecture using Chef. This currently includes all OpenStack core projects: Compute, Dashboard, Identity, Image, Network, Object Storage, Block Storage, Telemetry and Orchestration.
This is the testing framework for OpenStack and Chef. We leverage this to test against our changes to our [cookbooks](https://wiki.openstack.org/wiki/Chef/GettingStarted) to make sure
that you can still build a cluster from the ground up with any changes we push up. This will eventually be tied into the gerrit workflow
and become a stackforge project.
Development of the latest OpenStack release will continue on the `master` branch and releases tagged with `10.0.X`. Once development starts against OpenStack `k` release, this branch will move to `stable/juno` and the appropriate branches will continue development.
This framework also gives us an opportunity to show different Reference Architectures and a sane example on how to start with OpenStack and Chef.
The documentation has been moved to the https://github.com/mattray/chef-docs repository for merging to https://github.com/opscode/chef-docs and eventual release to https://docs.getchef.com/openstack_develop.html. Instructions for building the docs are included in the repository. The documentation for Chef is available at http://docs.getchef.com. There is additional documentation on the [OpenStack wiki](https://wiki.openstack.org/wiki/Chef/GettingStarted).
With the `master` branch of the cookbooks, which is currently tied to the base OpenStack Juno release, this supports deploying to Ubuntu 14 and CentOS 7 platforms for all in one with nova networking. Support for all in one neutron and multi node support is a work in progress.
# Usage with Chef Server #
Support for CentOS 6.5 and Ubuntu 12 with Icehouse is available with the stable/icehouse branch of this project.
This repository uses Berkshelf (https://berkshelf.com) to manage downloading all of the proper cookbook versions, whether from Git or from the Chef Supermarket site (https://supermarket.getchef.com/). The preference is to eventually upstream all cookbook dependencies to the Chef Supermarket site. The [Berksfile](Berksfile) lists the current dependencies. Note that berks will resolve version requirements and dependencies on first run and store these in Berksfile.lock. If new cookbooks become available you can run `berks update` to update the references in Berksfile.lock. Berksfile.lock will be included in stable branches to provide a known good set of dependencies. Berksfile.lock will not be included in development branches to encourage development against the latest cookbooks.
## Prereqs
There is a Spiceweasel (http://bit.ly/spcwsl) [infrastructure.yml](infrastructure.yml) manifest documenting all the roles and environments required to deploy OpenStack.
- [ChefDK](https://downloads.chef.io/chef-dk/) 0.3.6 or later
- [Vagrant](https://www.vagrantup.com/downloads.html) 1.7.2 or later with [VirtualBox](https://www.virtualbox.org/wiki/Downloads) or some other provider
To see the commands necessary to push all of the files to the Chef server, run the following command:
## Initial Setup Steps
```
spiceweasel infrastructure.yml
```shell
$ git clone https://github.com/jjasghar/chef-openstack-testing-stack.git testing-stack
$ cd testing-stack
$ vi vagrant_linux.rb # change the 'vm.box' to the openstack platform you'd like to run.
$ chef exec rake berks_vendor
$ chef exec ruby -e "require 'openssl'; File.binwrite('.chef/validator.pem', OpenSSL::PKey::RSA.new(2048).to_pem)"
```
To actually deploy the repository to your Chef server, run the following command:
The stackforge OpenStack cookbooks by default use databags for configuring passwords. There are four
data_bags : *user_passwords*, *db_passwords*, *service_passwords*, *secrets*. I have a already created
the `data_bags/` directory, so you shouldn't need to make them, if you do something's broken.
See [Databag](#Databags) section below for more details.
```
spiceweasel -e infrastructure.yml
```
**NOTE**: If you are running Ubuntu 14.04 LTS and as your **base** compute machine, you should note that the shipped
kernel `3.13.0-24-generic` has networking issues, and the best way to resolve this is
via: `apt-get install linux-image-generic-lts-utopic`. This will install at least `3.16.0` from the Utopic hardware enablement.
# Usage with Chef Server manual steps #
## Supported Environments
## Perpare Chef Server
* All in One
* Nova networking
* Neutron networking
* Multi-Node
* Nova networking
* Nuetron networking
### Pre-condition
For each environment, there's a corresponding readme file in the doc directory. Please review that for specific details and additional setup that might be required before deploying the cloud.
Make sure your Chef server's hostname is resolvable(i.e. ping your hostname will show the IP address).
## Rake Deploy Commands
### Install Chef Server
Download Chef server package from here: <https://www.chef.io/download-open-source-chef-server-11/>
Install the file using the correct method for your system.
For Debain using `dpkg -i chef-server.deb`, for RHEL using `rpm -i chef-server.rpm`.
### Configure Chef Server
chef-server-ctl reconfigure
## Prepare Chef Workstation
Usually we setup the Chef workstation on Chef server node.
### Install Chef
curl -L https://www.chef.io/chef/install.sh | bash
### Configure Chef Workstation
knife ssl fetch
knife configure -y -i --defaults -r ''
## Prepare Chef repository
### Download OpenStack Chef cookbooks
git clone https://github.com/stackforge/openstack-chef-repo
cd openstack-chef-repo
/opt/chef/embedded/bin/gem install berkshelf
/opt/chef/embedded/bin/berks vendor ./cookbooks
### Upload Chef roles and cookbooks
cd openstack-chef-repo
knife role from file ./roles/*.json
knife cookbook upload --cookbook-path ./cookbooks --all
### Create and upload Chef environment
cd openstack-chef-repo
cp environments/example.json environments/your_environment.json
knife environment from file environments/your_environment.json
NOTE: Your should update the necessary attributes in `environments/your_environment.json`.
## Start deploy OpenStack
Make sure your nodes can connect Chef server through Chef server's hostname/FQDN.
### Deploy an allinone environment
knife bootstrap allinone_node_ip -E your_environment -r 'role[allinone-compute]'
### Deploy a controller + compute environment
knife bootstrap controller_node_ip -E your_environment -r 'role[os-compute-single-controller]'
knife bootstrap compute_node1_ip -E your_environment -r 'role[os-compute-worker],role[os-telemetry-agent-compute]'
knife bootstrap compute_node2_ip -E your_environment -r 'role[os-compute-worker],role[os-telemetry-agent-compute]'
# Usage with Chef Zero #
[Chef Zero](http://www.getchef.com/blog/2013/10/31/chef-client-z-from-zero-to-chef-in-8-5-seconds/) is Chef local mode, without Chef server.
## Install Chef
```
curl -L https://www.getchef.com/chef/install.sh | sudo bash
```
## Checkout cookbooks
```
git clone https://github.com/stackforge/openstack-chef-repo
cd openstack-chef-repo
/opt/chef/embedded/bin/gem install berkshelf
/opt/chef/embedded/bin/berks vendor ./cookbooks
```
## Prepare Chef environment
Here is a minimal [environment file](environments/zero-demo.json).
```
{
"name": "zero-demo",
"override_attributes": {
"mysql": {
"server_root_password": "ilikerandompasswords"
},
"openstack": {
"developer_mode": true
}
}
}
```
## Start to deploy
Note that `your_node_name` below is your node's hostname.
```
cd openstack-chef-repo
chef-client -z -E zero-demo -r 'role[allinone-compute]'
```
If there are no errors in output, congratulations!
# Databags #
You need to have some databags when you run the stackforge without the developer_mode -> true.
You need four databags : user_passwords, db_passwords, service_passwords, secrets
Each data bag need the following item to be created.
user_passwords
ITEM example : {"id" : "admin", "admin" : "mypass"}
- admin
- guest
These commands will spin up various OpenStack cluster configurations, the simplest being the all-in-one controller with Nova networking.
```bash
for item in admin guest ; do
knife data bag create user_passw $p --secret-file ~/.chef/openstack_data_bag_secret;
done
$ chef exec rake aio_nova # All-in-One Nova-networking Controller
$ chef exec rake aio_neutron # All-in-One Neutron Controller
$ chef exec rake multi_neutron # Multi-Neutron Controller and 3 Compute nodes
$ chef exec rake multi_nova # Multi-Nova-networking Controller and 3 Compute nodes
```
### Access the Controller
```bash
$ cd vms
$ vagrant ssh controller
$ sudo su -
```
### Testing the Controller
```bash
# Access the controller as noted above
$ source openrc
$ nova service-list && nova hypervisor-list
$ glance image-list
$ keystone user-list
$ nova list
```
### Working with Security Groups ###
To allow ssh access to instances, a nova security group is defined as follows:
```bash
$ nova secgroup-list
$ nova secgroup-list-rules default
$ nova secgroup-create allow_ssh "allow ssh to instance"
$ nova secgroup-add-rule allow_ssh tcp 22 22 0.0.0.0/0
$ nova secgroup-list-rules allow_ssh
```
### Working with keys ###
To allow ssh keys to be injected into instance, a nova keypair is defined as follows:
```bash
# Just press Enter to all the questions
$ ssh-keygen
$ nova keypair-add --pub-key=/root/.ssh/id_rsa.pub mykey
```
#### Booting up a cirros image on the Controller
```bash
$ nova boot test --image cirros --flavor 1 --security-groups=allow_ssh --key-name=mykey
```
Wait a few seconds and the run `nova list` if Status is not Active, wait a few seconds and repeat.
Once status is active you should be able to log in via ssh to the listed IP.
```bash
$ ssh cirros@<ip address from nova list output>
```
#### Accessing the OpenStack Dashboard
If you would like to use the OpenStack dashboard you should go to https://localhost:9443 and the username and password is `admin/mypass`.
## Cleanup
To remove all the nodes and start over again with a different environment or different environment attribute overrides, using the following rake command.
```bash
$ chef exec rake destroy_machines
```
To refresh all the cookbooks, use the following rake commands.
```bash
$ chef exec rake destroy_cookbooks
$ chef exec rake berks_vendor
```
To cleanup everything, use the following rake command.
```bash
$ chef exec rake clean
```
## Databags
Some basic information about the use of databags within this repo.
```
# Show the list of databags
$ chef exec knife data bag list -z
db_passwords
ITEM example : {"id" : "nova", "nova" : "mypass"}
- nova
- horizon
- keystone
- glance
- ceilometer
- neutron
- cinder
- heat
- dash
```bash
for item in nova horizon keystone glance ceilmeter neutron cinder heat dash ; do
knife data bag create db_passwords $p --secret-file ~/.chef/openstack_data_bag_secret;
done
```
service_passwords
ITEM example : {"id" : "openstack-image", "openstack-image" : "mypass"}
- openstack-image
- openstack-compute
- openstack-block-storage
- openstack-orchestration
- openstack-network
- rbd
```bash
for item in openstack-image openstack-compute openstack-block-storage openstack-orchestration openstack-network rbd ; do
knife data bag create service_passwords $p --secret-file ~/.chef/openstack_data_bag_secret;
done
```
secrets
ITEM example : {"id" : "openstack_identity_bootstrap_token", "openstack_identity_bootstrap_token" : "mytoken"}
service_passwords
user_passwords
- openstack_identity_bootstrap_token
- neutron_metadata_secret
# Show the list of databag items
$ chef exec knife data bag show db_passwords -z
ceilometer
cinder
dash
glance
heat
horizon
keystone
neutron
nova
```bash
for item in openstack_identity_bootstrap_token neutron_metadata_secret ; do
knife data bag create secrets $p --secret-file ~/.chef/openstack_data_bag_secret;
done
# Show contents of databag item
$ chef exec knife data bag show db_passwords ceilometer -z
Encrypted data bag detected, decrypting with provided secret.
ceilometer: mypass
id: ceilometer
# Update contents of databag item
# set EDITOR env var to your editor, for powershell, I used nano
$ chef exec knife data bag edit secrets dispersion_auth_user -z
```
# Cookbooks #
### Databag Default Values
db_passwords are set to "mypass"
secrets are set to "<key>_token"
service_passwords are set to "mypass"
user_passwords are set to "mypass"
The cookbooks have been designed and written in such a way that they can be used to deploy individual service components on _any_ of the nodes in the infrastructure; in short they can be used for single node 'all-in-one' installs (for testing), right up to multi/many node production installs. In order to achieve this flexibility, they are configured by attributes which may be used to override search. Chef 11 or later is currently required. Ruby 1.9.x is considered the minimum supported version of Ruby as well. Most users of this repository test with the full-stack Chef 11 client and a Chef server (Chef Solo is not explicity supported).
### Default Databag Secret
The default secret is stored here .chef\encrypted_data_bag_secret
and referenced by .chef\knife.rb.
Each of the OpenStack services has its own cookbook and will eventually be available on the Chef Community site.
## Known Issues and Workarounds
## OpenStack Block Storage ##
### Gemfile support
http://github.com/stackforge/cookbook-openstack-block-storage/
The ChefDK provides all the required level of gems this testing suite needs. But there exists a Gemfile-Provisioning file that can be used as well.
You will need to replace the Gemfile with the Gemfile-Provisioning before running your gem bundling.
Note: please ignore the Gemfile, as it is needed only to pass the existing gates with older levels of gems.
There is further documentation in the [OpenStack Block Storage cookbook README](http://github.com/stackforge/cookbook-openstack-block-storage/).
### Windows Platform
## OpenStack Compute ##
When using this on a Windows platform, here are some tweaks to make this work.
http://github.com/stackforge/cookbook-openstack-compute/
- In order to get ssh to work, you will need an ssl client installed. I used the one that came with [Git for Windows](git-scm.com/download). I needed to append the `C:\Program Files (x86)\Git\bin;` to the system PATH.
There is further documentation in the [OpenStack Compute cookbook README](http://github.com/stackforge/cookbook-openstack-compute/).
## TODOs
## OpenStack Dashboard ##
- Better instructions for multi-node network setup
- Better support for aio_neutron and muilt node tests
- Support for floating ip's
- Split out the `multi-neutron-network-node` cluster also so the network node is it's own machine
- Support for swift multi node test
- Easier debugging. Maybe a script to pull the logs from the controller.
- More automated verification testing. Tie into some amount of [tempest](https://github.com/openstack/tempest) or [refstack](https://wiki.openstack.org/wiki/RefStack)? for basic cluster testing.
http://github.com/stackforge/cookbook-openstack-dashboard/
There is further documentation in the [OpenStack Dashboard cookbook README](http://github.com/stackforge/cookbook-openstack-dashboard/).
## OpenStack Identity ##
http://github.com/stackforge/cookbook-openstack-identity/
There is further documentation in the [OpenStack Identity cookbook README](http://github.com/stackforge/cookbook-openstack-identity/).
## OpenStack Image ##
http://github.com/stackforge/cookbook-openstack-image/
There is further documentation in the [OpenStack Image cookbook README](http://github.com/stackforge/cookbook-openstack-image/).
## OpenStack Network ##
Http://github.com/stackforge/cookbook-openstack-network/
There is further documentation in the [OpenStack Network cookbook README](http://github.com/stackforge/cookbook-openstack-network/).
## OpenStack Object Storage ##
http://github.com/stackforge/cookbook-openstack-object-storage/
There is further documentation in the [OpenStack Object Storage cookbook README](http://github.com/stackforge/cookbook-openstack-object-storage/).
# Testing #
Please refer to the [TESTING.md](TESTING.md) for instructions for testing the repository and cookbooks with Vagrant or Vagabond.
# License and Author #
| | |
|:---------------------|:---------------------------------------------|
| **Author** | Matt Ray (<matt@opscode.com>) |
| **Author** | Jay Pipes (<jaypipes@gmail.com>) |
| **Author** | Chen Zhiwei (<zhiwchen@cn.ibm.com>) |
| **Author** | Juergen Brueder (<juergen.brueder@gmail.com>) |
| **Author** | Mark Vanderwiel (<vanderwl@us.ibm.com>) |
| | |
| **Copyright** | Copyright (c) 2011-2013 Opscode, Inc. |
| **Copyright** | Copyright (c) 2014-2015 IBM, Corp. |
# License #
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

55
Rakefile Normal file
View File

@ -0,0 +1,55 @@
task default: ["test"]
desc "Default gate tests to run"
task :test => [:rubocop, :berks_vendor]
def run_command(command)
if File.exist?('Gemfile.lock')
sh %(bundle exec #{command})
else
sh %(chef exec #{command})
end
end
task :destroy_all do
Rake::Task[:destroy_machines].invoke
run_command('rm -rf Gemfile.lock && rm -rf Berksfile.lock && rm -rf cookbooks/')
end
desc "Destroy machines"
task :destroy_machines do
run_command('chef-client -z destroy_all.rb')
end
desc "Vendor your cookbooks/"
task :berks_vendor do
run_command('berks vendor cookbooks')
end
desc "All-in-One Neutron build"
task :aio_neutron do
run_command('chef-client -z vagrant_linux.rb aio-neutron.rb')
end
desc "All-in-One Nova-networking build"
task :aio_nova do
run_command('chef-client -z vagrant_linux.rb aio-nova.rb')
end
desc "Multi-Neutron build"
task :multi_neutron do
run_command('chef-client -z vagrant_linux.rb multi-neutron.rb')
end
desc "Multi-Nova-networking build"
task :multi_nova do
run_command('chef-client -z vagrant_linux.rb multi-nova.rb')
end
desc "Blow everything away"
task clean: [:destroy_all]
# CI tasks
require 'rubocop/rake_task'
desc 'Run RuboCop'
RuboCop::RakeTask.new(:rubocop)

View File

@ -1,169 +1,25 @@
# Testing with Vagrant #
# Testing the Openstack Cookbook Repo #
## Prerequisites ##
This cookbook uses [bundler](http://gembundler.com/) and [berkshelf](http://berkshelf.com/) to isolate dependencies. Make sure you have `ruby 1.9.x`, `bundler`, build essentials and the header files for `gecode` installed before continuing. Make sure that you're using gecode version 3. More info [here](https://github.com/opscode/dep-selector-libgecode/tree/0bad63fea305ede624c58506423ced697dd2545e#using-a-system-gecode-instead).
The allinone-compute role may be tested with Vagrant, currently with Ubuntu 14.04. You need the following prerequisites:
## Bundle required gems ##
1. You must have Vagrant 1.2.1 or later installed.
2. You must have a "sane" Ruby 1.9.3 environment.
3. You must have the following Vagrant plugins:
Berkshelf 3.x needs the to use the system gecode 3.x libraries
$ vagrant plugin install vagrant-omnibus
$ vagrant plugin install vagrant-chef-zero
For ubuntu 12.04 use:
__notes:__
$ sudo apt-get update
$ sudo apt-get install -y libgecode-dev libxml2-dev libxml2 libxslt-dev build-essential
$ USE_SYSTEM_GECODE=1 bundle install --path=.bundle --jobs 1 --retry 3 --verbose
* vagrant-berkshelf is no longer used: https://sethvargo.com/the-future-of-vagrant-berkshelf/
For other platforms use:
## Install the gem dependencies for use with bundler
$ bundle install --path=.bundle --jobs 1 --retry 3 --verbose
$ bundle install --path=.bundle
## Vendor the Cookbooks ##
## Upload all of your cookbooks with Berkshelf
$ bundle exec berks vendor .cookbooks
$ bundle exec berks vendor .cookbooks
## Decide which Vagrant instance you wish to use
There are several Vagrant files available:
* Vagrantfile-aio-neutron: single compute node with Neutron
* Vagrantfile-aio-nova: single compute node with nova-network
* Vagrantfile-multi-neutron: seprate controller and compute nodes
Set an environment file to specify which Vagrantfile to use, for example:
$ export VAGRANT_VAGRANTFILE=Vagrantfile-aio-nova
## Starting the allinone-compute node ##
To test with Ubuntu 14.04, run:
$ vagrant up ubuntu1404
## Further testing ##
Now you have an openstack, you'll probably want to be able to actually launch instances.
### Log into box, prepare environment ###
$ vagrant ssh ubuntu1404
$ sudo bash
$ source /root/openrc
### Basic health checks ###
$ nova service-list
$ keystone catalog
### Working with Glance images ###
$ glance image-list
This will return the existing Cirros image which was included in the `vagrant` Environment.
### Working with Security Groups ###
$ nova secgroup-list
$ nova secgroup-list-rules default
$ nova secgroup-create allow_ssh "allow ssh to instance"
$ nova secgroup-add-rule allow_ssh tcp 22 22 0.0.0.0/0
$ nova secgroup-list-rules allow_ssh
### Working with keys ###
$ ssh-keygen
$ nova keypair-add --pub-key=/root/.ssh/id_rsa.pub testing
### Create an instance ###
$ nova flavor-list
$ nova boot --flavor=1 --image=cirros --security-groups=allow_ssh --key-name=testing testserver
Wait a few seconds and the run `nova list` if Status is not Active, wait a few seconds and repeat.
Once status is active you should be able to log in via ssh to the listed IP.
$ ssh cirros@192.168.100.2
# Testing with Vagabond #
We use Vagabond to do integration testing. The Vagabondfile in the root
directory of the Chef repo contains the definitions of the nodes that
are used during integration testing.
To set up Vagabond, do this:
$ bundle exec vagabond init
When prompted, answer "N" to not overwrite the existing Vagabondfile, and then
answer "n" for all templates you don't want to use and "y" for the rest.
When running integration tests, Vagabond starts up a set of LXC containers
to represent the actual hardware nodes used in a deployment, including the
Chef server itself. The nodes we use in integration testing are the
following:
* `server` -- A hardcoded LXC instance name that contains a Chef 11 server
that is loaded up with the Berkshelf cookbooks, the role definitions,
and environment definitions defined in this Chef repo
* `ops` -- An LXC instance that gets all the ops-related recipes and applications
installed in it, including databases, message queues, logging, etc
* `compute-worker` -- An LXC instance that acts as a compute worker
* `controller` -- An LXC instance that contains all the OpenStack control software
### Vagabond Local Chef Server
To start the local Chef 11 server LXC instance using Vagabond:
$ bundle exec vagabond server up
The above will automatically upload the roles and environment
definitions in this Chef repo along with all of the cookbooks
in the Berkshelf.
To re-upload all of the cookbooks in the Berkshelf, simply do:
$ bundle exec vagabond server upload_cookbooks
To re-upload the roles or environment files:
$ bundle exec vagabond server upload_roles
$ bundle exec vagabond server upload_environments
Remember that the above will install the **current** Berkshelf. Remember to
run:
$ bundle exec berks update
before you do the `vagabond server upload_cookbooks` command.
### Test Nodes
To start any of the LXC instances that represent the different ops, controller
and worker nodes in an OpenStack environment, do:
$ bundle exec vagabond up <NODE>
If you make changes to cookbooks and issue a `vagabond server upload_cookbooks` or
role/environment definitions, you will want to re-provision the node, which basically
ensures the node is up and runs chef-client on it:
$ bundle exec vagabond provision <NODE>
To destroy a node:
$ bundle exec vagabond destroy <NODE>
To entirely rebuild a node from scratch:
$ bundle exec vagabond rebuild <NODE>
When a node is up, you can SSH into that node to run tests or investigate logs, etc:
$ bundle exec vagabond ssh <NODE>
To see the status of all the nodes that Vagabond is managing, including the IP addresses
that the containers are bound to:
$ bundle exec vagabond status
## Run the Spiceweasel test ##
$ bundle exec spiceweasel infrastructure.yml --debug

View File

@ -1,55 +0,0 @@
{
:nodes => {
:ops => {
:template => "ubuntu_1404",
:ipaddress => "10.0.3.10",
:environment => "testing",
:run_list => [
"role[os-ops-database]",
"role[os-ops-messaging]",
"role[os-ops-caching]",
"recipe[openstack-ops-database::openstack-db]"
]
},
:controller => {
:template => "ubuntu_1404",
:ipaddress => "10.0.3.11",
:environment => "testing",
:run_list => [
"role[os-base]",
"role[os-identity]",
"role[os-image]",
"role[os-compute-api]",
"role[os-compute-scheduler]",
"role[os-compute-cert]",
"role[os-compute-vncproxy]",
"role[os-block-storage]",
"role[os-dashboard]"
]
},
:compute => {
:template => "ubuntu_1404",
:ipaddress => "10.0.3.12",
:environment => "testing",
:run_list => [
"role[os-base]",
"role[os-compute-worker]"
]
}
},
:clusters => {
:simple => [
"ops",
"controller",
"compute"
]
},
:local_chef_server => {
:zero => false,
:berkshelf => true,
:librarian => false,
:enabled => true,
:auto_upload => true
},
:sudo => true
}

View File

@ -1,95 +0,0 @@
# to use this vagrantfile, do either one of the following (not both):
# 1) export VAGRANT_VAGRANTFILE=Vagrantfile-aio-neutron
# 2) mv Vagrantfile-aio-neutron Vagrantfile
#
# and then use as normal:
# vagrant up centos65
# AND/OR
# vagrant up ubuntu1404
Vagrant.require_version ">= 1.1"
%w(vagrant-chef-zero vagrant-omnibus).each do |plugin|
unless Vagrant.has_plugin?(plugin)
fail LoadError, "#{plugin} is not installed!"
end
end
Vagrant.configure("2") do |config|
# Berkshelf plugin configuration
config.berkshelf.enabled = true
# Chef-Zero plugin configuration
config.chef_zero.enabled = true
config.chef_zero.chef_repo_path = "."
# pre-installed with berks
config.chef_zero.cookbooks = ".cookbooks"
# Omnibus plugin configuration
config.omnibus.chef_version = :latest
# OpenStack-related settings
config.vm.network "private_network", ip: "192.168.100.60"
chef_environment = "vagrant-aio-neutron"
chef_run_list = [ "role[allinone-compute]","role[os-image-upload]" ]
# virtualbox provider settings
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--cpus", 2]
vb.customize ["modifyvm", :id, "--memory", 2048]
vb.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
end
#######################
# Ubuntu 14.04 #
#######################
config.vm.define :ubuntu1404 do |ubuntu1404|
ubuntu1404.vm.hostname = "ubuntu1404"
ubuntu1404.vm.box = "opscode-ubuntu-14.04"
ubuntu1404.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
ubuntu1404.vm.network "forwarded_port", guest: 443, host: 8443 # dashboard-ssl
ubuntu1404.vm.network "forwarded_port", guest: 5000, host: 5000 # identity-api
ubuntu1404.vm.network "forwarded_port", guest: 8773, host: 8773 # compute-ec2-api
ubuntu1404.vm.network "forwarded_port", guest: 8774, host: 8774 # compute-api
ubuntu1404.vm.network "forwarded_port", guest: 4002, host: 4002 # chef-zero
ubuntu1404.vm.network "forwarded_port", guest: 35357, host: 35357 # identity-admin-api
ubuntu1404.vm.provision :chef_zero do |chef|
chef.environment = chef_environment
chef.environments_path = './environments'
chef.roles_path = './roles'
chef.run_list = chef_run_list.unshift("recipe[apt::cacher-client]")
end
end
#######################
# Centos 6.5 #
#######################
config.vm.define :centos65 do |centos65|
centos65.vm.hostname = "centos65"
centos65.vm.box = "opscode-centos-6.5"
centos65.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box"
centos65.vm.network "forwarded_port", guest: 443, host: 9443 # dashboard-ssl
centos65.vm.network "forwarded_port", guest: 8773, host: 9773 # compute-ec2-api
centos65.vm.network "forwarded_port", guest: 8774, host: 9774 # compute-api
centos65.vm.network "forwarded_port", guest: 4001, host: 4001 # chef-zero
centos65.vm.provision :chef_zero do |chef|
chef.environment = chef_environment
chef.environments_path = './environments'
chef.roles_path = './roles'
chef.run_list = chef_run_list
end
end
end

View File

@ -1,103 +0,0 @@
# to use this vagrantfile, do either one of the following (not both):
# 1) export VAGRANT_VAGRANTFILE=Vagrantfile-aio-nova
# 2) mv Vagrantfile-aio-nova Vagrantfile
#
# and then use as normal:
# vagrant up centos65
# AND/OR
# vagrant up ubuntu1404
Vagrant.require_version ">= 1.1"
%w(vagrant-chef-zero vagrant-omnibus).each do |plugin|
unless Vagrant.has_plugin?(plugin)
fail LoadError, "#{plugin} is not installed!"
end
end
Vagrant.configure("2") do |config|
# Berkshelf plugin configuration
config.berkshelf.enabled = true
# Chef-Zero plugin configuration
config.chef_zero.enabled = true
config.chef_zero.chef_repo_path = "."
# pre-installed with berks
config.chef_zero.cookbooks = ".cookbooks"
# Omnibus plugin configuration
config.omnibus.chef_version = :latest
# OpenStack-related settings
config.vm.network "private_network", ip: "192.168.100.60"
chef_environment = "vagrant-aio-nova"
chef_run_list = [ "role[allinone-compute]","role[os-image-upload]" ]
# virtualbox provider settings
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--cpus", 2]
vb.customize ["modifyvm", :id, "--memory", 2048]
vb.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
end
#######################
# Ubuntu 14.04 #
#######################
config.vm.define :ubuntu1404 do |ubuntu1404|
ubuntu1404.vm.hostname = "ubuntu1404"
ubuntu1404.vm.box = "opscode-ubuntu-14.04"
ubuntu1404.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
ubuntu1404.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
ubuntu1404.vm.network "forwarded_port", guest: 443, host: 8443 # dashboard-ssl
ubuntu1404.vm.network "forwarded_port", guest: 4002, host: 4002 # chef-zero
ubuntu1404.vm.network "forwarded_port", guest: 5000, host: 5000 # identity-api
ubuntu1404.vm.network "forwarded_port", guest: 8773, host: 8773 # compute-ec2-api
ubuntu1404.vm.network "forwarded_port", guest: 8774, host: 8774 # compute-api
ubuntu1404.vm.network "forwarded_port", guest: 35357, host: 35357 # identity-admin-api
ubuntu1404.vm.provision :chef_zero do |chef|
chef.environment = chef_environment
chef.environments_path = './environments'
chef.roles_path = './roles'
chef.run_list = chef_run_list.unshift("recipe[apt::cacher-client]")
end
end
#######################
# Centos 6.5 #
#######################
config.vm.define :centos65 do |centos65|
centos65.vm.hostname = "centos65"
centos65.vm.box = "opscode-centos-6.5"
centos65.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box"
centos65.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
centos65.vm.network "forwarded_port", guest: 443, host: 9443 # dashboard-ssl
centos65.vm.network "forwarded_port", guest: 8773, host: 9773 # compute-ec2-api
centos65.vm.network "forwarded_port", guest: 8774, host: 9774 # compute-api
centos65.vm.network "forwarded_port", guest: 4001, host: 4001 # chef-zero
centos65.vm.provision :chef_zero do |chef|
chef.environment = chef_environment
chef.run_list = chef_run_list
chef.environments_path = './environments'
chef.roles_path = './roles'
end
end
end

View File

@ -1,151 +0,0 @@
# to use this vagrantfile, do either one of the following (not both):
# 1) export VAGRANT_VAGRANTFILE=Vagrantfile-multi-neutron
# 2) mv Vagrantfile-multi-neutron Vagrantfile
#
# and then use as normal:
# vagrant up /centos65/
# OR
# vagrant up /ubuntu1404/
# will boot the controller and compute node
#
# NOTE: due to needing to specify IP's in the environment, you can only run
# either ubuntu or centos at one time
Vagrant.require_version ">= 1.1"
%w(vagrant-chef-zero vagrant-omnibus).each do |plugin|
unless Vagrant.has_plugin?(plugin)
fail LoadError, "#{plugin} is not installed!"
end
end
Vagrant.configure("2") do |config|
# Berkshelf plugin configuration
config.berkshelf.enabled = true
# Chef-Zero plugin configuration
config.chef_zero.enabled = true
config.chef_zero.chef_repo_path = "."
# Omnibus plugin configuration
config.omnibus.chef_version = :latest
# OpenStack-related settings
chef_environment = "vagrant-multi-neutron"
controller_run_list = [
"role[os-compute-single-controller-no-network]",
"recipe[openstack-network::identity_registration]",
"role[os-network-openvswitch]",
"role[os-network-dhcp-agent]",
"role[os-network-metadata-agent]",
"role[os-network-server]"
]
# virtualbox provider settings
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--cpus", 2]
vb.customize ["modifyvm", :id, "--memory", 2048]
vb.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
end
#################################
# Ubuntu 14.04 controller #
#################################
config.vm.define :ubuntu1404cont do |ubuntu1404cont|
ubuntu1404cont.vm.hostname = "ubuntu1404cont"
ubuntu1404cont.vm.box = "opscode-ubuntu-14.04"
ubuntu1404cont.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
ubuntu1404cont.vm.network "forwarded_port", guest: 443, host: 8443 # dashboard-ssl
ubuntu1404cont.vm.network "forwarded_port", guest: 8773, host: 8773 # compute-ec2-api
ubuntu1404cont.vm.network "forwarded_port", guest: 8774, host: 8774 # compute-api
ubuntu1404cont.vm.network "private_network", ip: "192.168.3.60"
ubuntu1404cont.vm.network "private_network", ip: "172.16.10.60"
ubuntu1404cont.vm.provision :chef_zero do |chef|
chef.run_list = controller_run_list
chef.environment = chef_environment
chef.environments_path = './environments'
chef.roles_path = './roles'
end
end
#################################
# Ubuntu 14.04 compute1 #
#################################
config.vm.define :ubuntu1404comp1 do |ubuntu1404comp1|
ubuntu1404comp1.vm.hostname = "ubuntu1404comp1"
ubuntu1404comp1.vm.box = "opscode-ubuntu-14.04"
ubuntu1404comp1.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
ubuntu1404comp1.vm.network "private_network", ip: "192.168.3.61"
ubuntu1404comp1.vm.network "private_network", ip: "172.16.10.61"
ubuntu1404comp1.vm.provision :chef_zero do |chef|
chef.run_list = [ "role[os-compute-worker]","recipe[apt::cacher-client]" ]
chef.environment = chef_environment
chef.environments_path = './environments'
chef.roles_path = './roles'
end
end
#################################
# CentOS 6.5 controller #
#################################
config.vm.define :centos65cont do |centos65cont|
centos65cont.vm.hostname = "centos65cont"
centos65cont.vm.box = "opscode-centos-6.5"
centos65cont.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box"
centos65cont.vm.network "forwarded_port", guest: 443, host: 9443 # dashboard-ssl
centos65cont.vm.network "forwarded_port", guest: 8773, host: 9773 # compute-ec2-api
centos65cont.vm.network "forwarded_port", guest: 8774, host: 9774 # compute-api
centos65cont.vm.network "private_network", ip: "192.168.3.60"
centos65cont.vm.network "private_network", ip: "172.16.10.60"
centos65cont.vm.provision :chef_zero do |chef|
chef.run_list = controller_run_list
chef.environment = chef_environment
chef.environments_path = './environments'
chef.roles_path = './roles'
end
end
#################################
# CentOS 6.5 compute1 #
#################################
config.vm.define :centos65comp1 do |centos65comp1|
centos65comp1.vm.hostname = "centos65comp1"
centos65comp1.vm.box = "opscode-centos-6.5"
centos65comp1.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box"
centos65comp1.vm.network "private_network", ip: "192.168.3.61"
centos65comp1.vm.network "private_network", ip: "172.16.10.61"
centos65comp1.vm.provision :chef_zero do |chef|
chef.run_list = [ "role[os-compute-worker]" ]
chef.environment = chef_environment
chef.environments_path = './environments'
chef.roles_path = './roles'
end
end
end

28
aio-neutron.rb Normal file
View File

@ -0,0 +1,28 @@
require 'chef/provisioning'
controller_config = <<-ENDCONFIG
config.vm.network "forwarded_port", guest: 443, host: 9443
config.vm.network "forwarded_port", guest: 4002, host: 4002
config.vm.network "forwarded_port", guest: 5000, host: 5000
config.vm.network "forwarded_port", guest: 8773, host: 8773
config.vm.network "forwarded_port", guest: 8774, host: 8774
config.vm.network "forwarded_port", guest: 35357, host: 35357
config.vm.provider "virtualbox" do |v|
v.memory = 4096
v.cpus = 2
v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
config.vm.network "private_network", ip: "172.16.0.254"
ENDCONFIG
machine 'controller' do
add_machine_options vagrant_config: controller_config
role 'allinone-compute'
role 'os-image-upload'
recipe 'openstack-common::openrc'
chef_environment 'vagrant-aio-neutron'
file('/etc/chef/openstack_data_bag_secret',
"#{File.dirname(__FILE__)}/.chef/encrypted_data_bag_secret")
converge true
end

31
aio-nova.rb Normal file
View File

@ -0,0 +1,31 @@
require 'chef/provisioning'
controller_config = <<-ENDCONFIG
config.vm.network "forwarded_port", guest: 443, host: 9443
config.vm.network "forwarded_port", guest: 4002, host: 4002
config.vm.network "forwarded_port", guest: 5000, host: 5000
config.vm.network "forwarded_port", guest: 6080, host: 6080
config.vm.network "forwarded_port", guest: 8773, host: 8773
config.vm.network "forwarded_port", guest: 8774, host: 8774
config.vm.network "forwarded_port", guest: 35357, host: 35357
config.vm.provider "virtualbox" do |v|
v.memory = 8096
v.cpus = 2
v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
config.vm.network "private_network", ip: "192.168.100.60"
ENDCONFIG
machine 'controller' do
add_machine_options vagrant_config: controller_config
role 'allinone-compute'
role 'os-image-upload'
recipe 'openstack-common::openrc'
# if you would like to use centos7 you'll need to
# use 'vagrant-aio-centos7-nova' for the environment
chef_environment 'vagrant-aio-nova'
file('/etc/chef/openstack_data_bag_secret',
"#{File.dirname(__FILE__)}/.chef/encrypted_data_bag_secret")
converge true
end

9
bootstrap.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash -x
## This script is for installing all the needed packages on trusty to run the chef tests with 'chef exec rake'.
## It relies on the common bootstrap.sh from stackforge/cookbook-openstack-common for installing common dependencies.
curl https://raw.githubusercontent.com/stackforge/cookbook-openstack-common/master/bootstrap.sh \
--retry 3 \
--silent \
--show-error \
| /bin/bash -x

View File

@ -0,0 +1,9 @@
{
"id": "ceilometer",
"ceilometer": {
"encrypted_data": "NAJwrZJbTX7HxNH4rzGJMYnDeWQMz3dlskH1w1oK39c=\n",
"iv": "HQAYmxr9s/4T7wymjyOdkw==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "cinder",
"cinder": {
"encrypted_data": "xi4j48o5eQ2looCkeVgPl64DFUPR82XlzymgNDESo2o=\n",
"iv": "WqlxhMdS6OojDRzPBL7NXw==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "dash",
"dash": {
"encrypted_data": "KdZPRWYQhevFDZ+DtxVtef72GbHpuEihdpISvqhgc6k=\n",
"iv": "jk8RezVkUdYsrlf7HUrW/w==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "glance",
"glance": {
"encrypted_data": "cKEvY45RhENrlXhmJmB10L9JRCUGHo4Adug57T/YXQU=\n",
"iv": "iLGiFduEUtD/XMoETLujBQ==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "heat",
"heat": {
"encrypted_data": "zgl0ZuuOiJ0LpzDdKCX4M9n/l9bkcF4Z45gv4abyLng=\n",
"iv": "182xiFiVaERWG53LotL7Gg==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "horizon",
"horizon": {
"encrypted_data": "nVANvaIWmXkurWP8uvob5JEqj3bGqVyYVgr951Bt60A=\n",
"iv": "KB6c6u4esjMhpDsGQgTNqw==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "keystone",
"keystone": {
"encrypted_data": "CfV03PSfnMLUWghRS7HWt+vZccGVXyc1EN55SSujEq8=\n",
"iv": "PPPYxqEpwdXFVSaPitmbjA==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "neutron",
"neutron": {
"encrypted_data": "edZRMU5X79BDYryGz1Hl31Xm5pj5zPLvtTLEfFVxJIQ=\n",
"iv": "REvGeth2ZknDbbX7B1GVzQ==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "nova",
"nova": {
"encrypted_data": "HNKWBIqI97m4kKUzmJPMhFOs88674fiRoZJutZalsx4=\n",
"iv": "uZn6Fma8PxAJgyMnqEUk0A==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "dispersion_auth_key",
"dispersion_auth_key": {
"encrypted_data": "8RiBaL2YXqWkKznttD8tAIXujqjmrWnXPxOYxDrZ14s9aWAAf5ZXK1X9k+Os\nQ//9\n",
"iv": "sKbXkkEbSPPMTSLNw7W/Hg==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "dispersion_auth_user",
"dispersion_auth_user": {
"encrypted_data": "YwDA8/8/R+LDmSXuY68BZaRuL/RjYVJ4Wjzc9Ljgftq2/h5xybeX7JVq1oMF\nzsMJ\n",
"iv": "W19a/YbXhjn1+vPBlHWt/A==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "neutron_metadata_secret",
"neutron_metadata_secret": {
"encrypted_data": "9Rnug5CIx4gR71I4ir2wyyuZg6WfGSgwYkatGfrC7bo2rKYFY4anD4Rltxl+\nQVl/GxHIP7tjsbBDF99etSH1XQ==\n",
"iv": "s2U76jDYaJbklusq61zu5g==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "openstack_identity_bootstrap_token",
"openstack_identity_bootstrap_token": {
"encrypted_data": "X0U+JzfVi3Jf0aH3pxNBrG72GY8yo2YkxtAbcxj4RuV5TE3kARsisiXIV+Bd\nEZIQQG+fNZxQgNrlNyRAqq5aCw==\n",
"iv": "ph98S6eOxD/EVy/f2MoTiA==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "swift_authkey",
"swift_authkey": {
"encrypted_data": "it5ei2NN2bvT6nhS9D0bizNHQ1m/E0i0yR5i3a1rfv3GnqBEj0XSwYbC8EtG\njm+X\n",
"iv": "X7bGZy035eyagWkg2RLHuw==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "swift_hash_path_prefix",
"swift_hash_path_prefix": {
"encrypted_data": "XV4El7sNlm3UVl3dh7Wy5nAyl1ooiXquFJ+Hn18+OFbH0z1Vt97nJO4GPqgq\n91d5\n",
"iv": "/v6woWV+Aun9FbjV1WG/4A==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "swift_hash_path_suffix",
"swift_hash_path_suffix": {
"encrypted_data": "OV1/aLTF6fPxNco19u951J/AcDKpsNjnY8Xp4CLWNQeC0wHU4X0+rWCTLdY3\nfGhk\n",
"iv": "G72rzoiAi2L97VmfXg/gyg==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "openstack-block-storage",
"openstack-block-storage": {
"encrypted_data": "YdF234b5aNc1WeOGwpp1cr6fTSNTSABzD82YmUpyur0=\n",
"iv": "mBXAd1QNCtT25s+PfcQiQQ==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "openstack-compute",
"openstack-compute": {
"encrypted_data": "cAQ5NkN0QmxwaCJzjsSuCC8Jx0T8+QX0xzW+BA8SBs4=\n",
"iv": "YyNxLvFwWUOibDiNEqC2Fw==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "openstack-image",
"openstack-image": {
"encrypted_data": "uGu2Bo4/9l/TGYVNJHwp+fNfar47sq8FpXVY4auim2w=\n",
"iv": "ZgNflL1zoIl5gjMjiug9nw==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "openstack-network",
"openstack-network": {
"encrypted_data": "6PRSDau1ejZO4sPg4Veat9+IVwNQuymSngdlzbdE1dg=\n",
"iv": "rRd3JGflP2YKY98m4/VbmQ==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "openstack-object-storage",
"openstack-object-storage": {
"encrypted_data": "RShH8KMN9TFJ/+vD0vzoRZ4GCvGmttLvuN3nokwdYkw=\n",
"iv": "c428JDwUz6pT8VrN0vUSDA==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "openstack-orchestration",
"openstack-orchestration": {
"encrypted_data": "0HpyFflTF4UHGDtq3koSMGkLOZ7XAKrp0fw2D0rKSt0=\n",
"iv": "xRgADbFNtnNdPrRHGdI1vg==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "rbd",
"rbd": {
"encrypted_data": "bjXhcqcYeDLeg60nZQhX6XSsn/I77ACH5EqEWaDCc84=\n",
"iv": "dY6O+HHA0mBLgnvcjnLBGQ==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "admin",
"admin": {
"encrypted_data": "bD6yFwFKuR7q+KBgaahokPwTzWXX3qbng9E+y2Z2oUw=\n",
"iv": "0KcNNoGNenp2MwVPIie4Ag==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "guest",
"guest": {
"encrypted_data": "XnefHM1g5KXo7ULfR6rk36suDB2DFbo/JIwKLEr/zRA=\n",
"iv": "T3hRx6mHUBXBfAtrt0tRMw==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

View File

@ -0,0 +1,9 @@
{
"id": "mysqlroot",
"mysqlroot": {
"encrypted_data": "bD6yFwFKuR7q+KBgaahokPwTzWXX3qbng9E+y2Z2oUw=\n",
"iv": "0KcNNoGNenp2MwVPIie4Ag==\n",
"version": 1,
"cipher": "aes-256-cbc"
}
}

6
destroy_all.rb Normal file
View File

@ -0,0 +1,6 @@
require 'chef/provisioning'
machine_batch do
machines search(:node, '*:*').map(&:name)
action :destroy
end

3
doc/aio-neutron.md Normal file
View File

@ -0,0 +1,3 @@
# All in One with Neutron networking
The defaults in the aio-neutron.rb and the environments/vagrant-aio-neutron.json should work without any changes.

3
doc/aio-nova.md Normal file
View File

@ -0,0 +1,3 @@
# All in One with Nova networking
The defaults in the aio-nova.rb and the environments/vagrant-aio-nova.json should work without any changes.

44
doc/databags.md Normal file
View File

@ -0,0 +1,44 @@
# Databags
Some basic information about the use of databags within this repo.
```
# Show the list of databags
$ chef exec knife data bag list -z
db_passwords
secrets
service_passwords
user_passwords
# Show the list of databag items
$ chef exec knife data bag show db_passwords -z
ceilometer
cinder
dash
glance
heat
horizon
keystone
neutron
nova
# Show contents of databag item
$ chef exec knife data bag show db_passwords ceilometer -z
Encrypted data bag detected, decrypting with provided secret.
ceilometer: mypass
id: ceilometer
# Update contents of databag item
# set EDITOR env var to your editor, for powershell, I used nano
$ chef exec knife data bag edit secrets dispersion_auth_user -z
```
## Databag Default Values
db_passwords are set to "mypass"
secrets are set to "<key>_token"
service_passwords are set to "mypass"
user_passwords are set to "mypass"
## Default Databag Secret
The default secret is stored here .chef\encrypted_data_bag_secret
and referenced by .chef\knife.rb.

3
doc/multi-neutron.md Normal file
View File

@ -0,0 +1,3 @@
# Multi node with Nuetron networking
todo ...

23
doc/multi-nova.md Normal file
View File

@ -0,0 +1,23 @@
# Multi node with Nova networking
## Nodes
The multi-node environments will have four machines `controller`,`compute1`,`compute2`, and `compute3`.
## Networking setup
Changes need to be made to the multi-nova.rb and the environments\vagrant-multi-nova.json file.
### Bridge IP Address
The ip address used for the bridge should on the same network as your machine connects to the internet. Change the '172.16.100.' ip address in the multi-nova.rb and the environments\vagrant-multi-nova.json files.
For example, on my home network, my laptop as and ip of 192.168.1.xxx, so I set the bridge address to 192.168.1.60.
### Device interface
The device interface must be is specified by name in the multi-nova.rb file.
There are two places to change, look for `<put your interface device name here>`.
+ For Windows 7, open the Control Panel, Network and Internet, Network Connections. Look in the Connectivity column for a row with "Internet access", and use the "Device Name". For example, 'Intel(R) Centrino(R) Advanced-N 6205'.
+ For Mac, this works from some: 'en0: Wi-Fi (AirPort)'
+ For Linux, ...TODO...

View File

@ -0,0 +1,4 @@
{
"name": "_default",
"description": "The default Chef environment"
}

View File

@ -1,15 +0,0 @@
{
"name": "CHANGE_TO_YOUR_ENVIRONMENT_NAME",
"override_attributes": {
"mysql": {
"server_root_password": "ilikerandompasswords"
},
"openstack": {
"use_databags": false,
"endpoints": {
"host": "CHANGE_TO_YOUR_CONTROLLER_IP",
"bind-host": "0.0.0.0"
}
}
}
}

View File

@ -1,41 +1,45 @@
name "example"
description "Example environment defineing the network and database settings you're going to use with OpenStack. The networks will be used in the libraries provided by the osops-utils cookbook. This example is for FlatDHCP with 2 physical networks."
name 'example'
description('Example environment defineing the network and database ' \
"settings you're going to use with OpenStack. " \
'The networks will be used in the libraries provided by ' \
'the osops-utils cookbook. This example is for ' \
'FlatDHCP with 2 physical networks.')
override_attributes(
"mysql" => {
"allow_remote_root" => true,
"root_network_acl" => "%"
'mysql' => {
'allow_remote_root' => true,
'root_network_acl' => '%'
},
"openstack" => {
"developer_mode" => true
'openstack' => {
'developer_mode' => true
}
# "glance" => {
# "images" => ["precise","cirros"],
# "image" => {
# "cirros" => "http://hypnotoad/cirros-0.3.0-x86_64-disk.img",
# "precise" => "http://hypnotoad/precise-server-cloudimg-amd64.tar.gz"
# 'glance' => {
# 'images' => ['precise','cirros'],
# 'image' => {
# 'cirros' => 'http://hypnotoad/cirros-0.3.0-x86_64-disk.img',
# 'precise' => 'http://hypnotoad/precise-server-cloudimg-amd64.tar.gz'
# }
# },
# "osops_networks" => {
# "public" => "10.0.111.0/24",
# "management" => "10.0.111.0/24",
# "nova" => "10.0.111.0/24"
# 'osops_networks' => {
# 'public' => '10.0.111.0/24',
# 'management' => '10.0.111.0/24',
# 'nova' => '10.0.111.0/24'
# },
# "nova" => {
# "network" => {
# "fixed_range" => "192.168.100.0/24",
# "public_interface" => "eth0"
# 'nova' => {
# 'network' => {
# 'fixed_range' => '192.168.100.0/24',
# 'public_interface' => 'eth0'
# },
# "networks" => [
# 'networks' => [
# {
# "label" => "public",
# "ipv4_cidr" => "192.168.100.0/24",
# "num_networks" => "1",
# "network_size" => "255",
# "bridge" => "br100",
# "bridge_dev" => "eth0",
# "dns1" => "8.8.8.8",
# "dns2" => "8.8.4.4"
# 'label' => 'public',
# 'ipv4_cidr' => '192.168.100.0/24',
# 'num_networks' => '1',
# 'network_size' => '255',
# 'bridge' => 'br100',
# 'bridge_dev' => 'eth0',
# 'dns1' => '8.8.8.8',
# 'dns2' => '8.8.4.4'
# }
# ]
# }

View File

@ -1,268 +1,265 @@
name "testing"
description "Environment used in testing the upstream cookbooks and reference Chef repository"
name 'testing'
description 'Environment used in testing the upstream cookbooks and reference' \
' Chef repository'
override_attributes(
"mysql" => {
"server_root_password" => "root",
"server_debian_password" => "root",
"server_repl_password" => "root",
"allow_remote_root" => true,
"root_network_acl" => "%"
'mysql' => {
'server_root_password' => 'root',
'server_debian_password' => 'root',
'server_repl_password' => 'root',
'allow_remote_root' => true,
'root_network_acl' => '%'
},
"openstack" => {
"auth" => {
"validate_certs" => false
'openstack' => {
'auth' => {
'validate_certs' => false
},
"block-storage" => {
"syslog" => {
"use" => false
'block-storage' => {
'syslog' => {
'use' => false
},
"api" => {
"ratelimit" => "False"
'api' => {
'ratelimit' => 'False'
},
"debug" => true,
"image_api_chef_role" => "os-image",
"identity_service_chef_role" => "os-identity",
"rabbit_server_chef_role" => "os-ops-messaging"
'debug' => true,
'image_api_chef_role' => 'os-image',
'identity_service_chef_role' => 'os-identity',
'rabbit_server_chef_role' => 'os-ops-messaging'
},
"compute" => {
"syslog" => {
"use" => false
'compute' => {
'syslog' => {
'use' => false
},
"libvirt" => {
"bind_interface" => "eth0"
'libvirt' => {
'bind_interface' => 'eth0'
},
"novnc_proxy" => {
"bind_interface" => "eth0"
'novnc_proxy' => {
'bind_interface' => 'eth0'
},
"xvpvnc_proxy" => {
"bind_interface" => "eth0"
'xvpvnc_proxy' => {
'bind_interface' => 'eth0'
},
"image_api_chef_role" => "os-image",
"identity_service_chef_role" => "os-identity",
"nova_setup_chef_role" => "os-compute-api",
"rabbit_server_chef_role" => "os-ops-messaging",
"ratelimit" => { # Disable ratelimiting so Tempest doesn't have issues.
"api" => {
"enabled" => false
'image_api_chef_role' => 'os-image',
'identity_service_chef_role' => 'os-identity',
'nova_setup_chef_role' => 'os-compute-api',
'rabbit_server_chef_role' => 'os-ops-messaging',
'ratelimit' => { # Disable ratelimiting so Tempest doesn't have issues.
'api' => {
'enabled' => false
},
"volume" => {
"enabled" => false
'volume' => {
'enabled' => false
}
},
"network" => {
"fixed_range" => "10.0.0.0/8"
'network' => {
'fixed_range' => '10.0.0.0/8'
},
"networks" => [
'networks' => [
]
},
"db" => {
"bind_interface" => "eth0",
"compute" => {
"host" => "10.0.3.10"
'db' => {
'bind_interface' => 'eth0',
'compute' => {
'host' => '10.0.3.10'
},
"identity" => {
"host" => "10.0.3.10"
'identity' => {
'host' => '10.0.3.10'
},
"image" => {
"host" => "10.0.3.10"
'image' => {
'host' => '10.0.3.10'
},
"network" => {
"host" => "10.0.3.10"
'network' => {
'host' => '10.0.3.10'
},
"volume" => {
"host" => "10.0.3.10"
'volume' => {
'host' => '10.0.3.10'
},
"dashboard" => {
"host" => "10.0.3.10"
'dashboard' => {
'host' => '10.0.3.10'
},
"telemetry" => {
"host" => "10.0.3.10"
'telemetry' => {
'host' => '10.0.3.10'
},
"orchestration" => {
"host" => "10.0.3.10"
'orchestration' => {
'host' => '10.0.3.10'
}
},
"developer_mode" => true,
"endpoints" => {
"compute-api" => {
"host" => "10.0.3.11",
"scheme" => "http",
"port" => "8774",
"path" => "/v2/%(tenant_id)s"
'developer_mode' => true,
'endpoints' => {
'compute-api' => {
'host' => '10.0.3.11',
'scheme' => 'http',
'port' => '8774',
'path' => '/v2/%(tenant_id)s'
},
"compute-ec2-admin" => {
"host" => "10.0.3.11",
"scheme" => "http",
"port" => "8773",
"path" => "/services/Admin"
'compute-ec2-admin' => {
'host' => '10.0.3.11',
'scheme' => 'http',
'port' => '8773',
'path' => '/services/Admin'
},
"compute-ec2-api" => {
"host" => "10.0.3.11",
"scheme" => "http",
"port" => "8773",
"path" => "/services/Cloud"
'compute-ec2-api' => {
'host' => '10.0.3.11',
'scheme' => 'http',
'port' => '8773',
'path' => '/services/Cloud'
},
"compute-xvpvnc" => {
"host" => "10.0.3.11",
"scheme" => "http",
"port" => "6081",
"path" => "/console"
'compute-xvpvnc' => {
'host' => '10.0.3.11',
'scheme' => 'http',
'port' => '6081',
'path' => '/console'
},
"compute-novnc" => {
"host" => "10.0.3.11",
"scheme" => "http",
"port" => "6080",
"path" => "/vnc_auto.html"
'compute-novnc' => {
'host' => '10.0.3.11',
'scheme' => 'http',
'port' => '6080',
'path' => '/vnc_auto.html'
},
"image-api" => {
"host" => "10.0.3.11",
"scheme" => "http",
"port" => "9292",
"path" => "/v2"
'image-api' => {
'host' => '10.0.3.11',
'scheme' => 'http',
'port' => '9292',
'path' => '/v2'
},
"image-registry" => {
"host" => "10.0.3.11",
"scheme" => "http",
"port" => "9191",
"path" => "/v2"
'image-registry' => {
'host' => '10.0.3.11',
'scheme' => 'http',
'port' => '9191',
'path' => '/v2'
},
"identity-api" => {
"host" => "10.0.3.11",
"scheme" => "http",
"port" => "5000",
"path" => "/v2.0"
'identity-api' => {
'host' => '10.0.3.11',
'scheme' => 'http',
'port' => '5000',
'path' => '/v2.0'
},
"identity-admin" => {
"host" => "10.0.3.11",
"scheme" => "http",
"port" => "35357",
"path" => "/v2.0"
'identity-admin' => {
'host' => '10.0.3.11',
'scheme' => 'http',
'port' => '35357',
'path' => '/v2.0'
},
"volume-api" => {
"host" => "10.0.3.11",
"scheme" => "http",
"port" => "8776",
"path" => "/v1/%(tenant_id)s"
'volume-api' => {
'host' => '10.0.3.11',
'scheme' => 'http',
'port' => '8776',
'path' => '/v1/%(tenant_id)s'
},
"telemetry-api" => {
"host" => "10.0.3.11",
"scheme" => "http",
"port" => "8777",
"path" => "/v1"
'telemetry-api' => {
'host' => '10.0.3.11',
'scheme' => 'http',
'port' => '8777',
'path' => '/v1'
},
"network-api" => {
"host" => "10.0.3.11",
"scheme" => "http",
"port" => "9696",
"path" => "/v2"
'network-api' => {
'host' => '10.0.3.11',
'scheme' => 'http',
'port' => '9696',
'path' => '/v2'
},
"orchestration-api" => {
"host" => "10.0.3.11",
"scheme" => "http",
"port" => "8004",
"path" => "/v1/%(tenant_id)s"
'orchestration-api' => {
'host' => '10.0.3.11',
'scheme' => 'http',
'port' => '8004',
'path' => '/v1/%(tenant_id)s'
},
"orchestration-api-cfn" => {
"host" => "10.0.3.11",
"scheme" => "http",
"port" => "8000",
"path" => "/v1"
'orchestration-api-cfn' => {
'host' => '10.0.3.11',
'scheme' => 'http',
'port' => '8000',
'path' => '/v1'
}
},
"identity" => {
"admin_user" => "ksadmin",
"bind_interface" => "eth0",
"catalog" => {
"backend" => "templated"
'identity' => {
'admin_user' => 'ksadmin',
'bind_interface' => 'eth0',
'catalog' => {
'backend' => 'templated'
},
"debug" => true,
"rabbit_server_chef_role" => "os-ops-messaging",
"roles" => [
"admin",
"keystone_admin",
"keystone_service_admin",
"member",
"netadmin",
"sysadmin"
],
"syslog" => {
"use" => false
'debug' => true,
'rabbit_server_chef_role' => 'os-ops-messaging',
'roles' => %w(admin
keystone_admin
keystone_service_admin
member
netadmin
sysadmin),
'syslog' => {
'use' => false
},
"tenants" => [
"admin",
"service",
"demo"
],
"token" => {
"backend" => "memcache"
'tenants' => %w(admin service demo),
'token' => {
'backend' => 'memcache'
},
"users" => {
"ksadmin" => {
"password" => "ksadmin",
"default_tenant" => "admin",
"roles" => { # Each key is the role name, each value is a list of tenants
"admin" => [
"admin"
'users' => {
'ksadmin' => {
'password' => 'ksadmin',
'default_tenant' => 'admin',
'roles' => {
# Each key is the role name, each value is a list of tenants
'admin' => [
'admin'
],
"keystone_admin" => [
"admin"
'keystone_admin' => [
'admin'
],
"keystone_service_admin" => [
"admin"
'keystone_service_admin' => [
'admin'
]
}
},
"demo" => {
"password" => "demo",
"default_tenant" => "demo",
"roles" => { # Each key is the role name, each value is a list of tenants
"sysadmin" => [
"demo"
'demo' => {
'password' => 'demo',
'default_tenant' => 'demo',
'roles' => {
# Each key is the role name, each value is a list of tenants
'sysadmin' => [
'demo'
],
"netadmin" => [
"demo"
'netadmin' => [
'demo'
],
"member" => [
"demo"
'member' => [
'demo'
]
}
}
}
},
"image" => {
"api" => {
"bind_interface" => "eth0"
'image' => {
'api' => {
'bind_interface' => 'eth0'
},
"debug" => true,
"identity_service_chef_role" => "os-identity",
"rabbit_server_chef_role" => "os-ops-messaging",
"registry" => {
"bind_interface" => "eth0"
'debug' => true,
'identity_service_chef_role' => 'os-identity',
'rabbit_server_chef_role' => 'os-ops-messaging',
'registry' => {
'bind_interface' => 'eth0'
},
"syslog" => {
"use" => false
'syslog' => {
'use' => false
},
"upload_image" => {
"cirros" => "http://hypnotoad/cirros-0.3.0-x86_64-disk.img",
'upload_image' => {
'cirros' => 'http://hypnotoad/cirros-0.3.0-x86_64-disk.img'
},
"upload_images" => [
"cirros"
'upload_images' => [
'cirros'
]
},
"memcached_servers" => [
"10.0.3.10:11211"
'memcached_servers' => [
'10.0.3.10:11211'
],
"mq" => {
"bind_interface" => "eth0",
"host" => "10.0.3.10",
"user" => "guest",
"vhost" => "/nova"
'mq' => {
'bind_interface' => 'eth0',
'host' => '10.0.3.10',
'user' => 'guest',
'vhost' => '/nova'
}
},
"queue" => {
"host" => "10.0.3.10",
"user" => "guest",
"vhost" => "/nova"
'queue' => {
'host' => '10.0.3.10',
'user' => 'guest',
'vhost' => '/nova'
}
)

View File

@ -0,0 +1,56 @@
{
"name": "vagrant-aio-centos7-nova",
"description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-aio-nova vagrantfile. Defines the necessary attributes for a working all-in-one openstack deployment, using nova-network for the networking component",
"cookbook_versions": {
},
"json_class": "Chef::Environment",
"chef_type": "environment",
"default_attributes": {
},
"override_attributes": {
"openstack": {
"endpoints": {
"bind-host": "0.0.0.0",
"host": "0.0.0.0"
},
"image": {
"image_upload": true,
"upload_images": [
"cirros",
"ubuntu-trusty",
"fedora"
],
"upload_image": {
"cirros": "http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img",
"ubuntu-trusty": "http://uec-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img",
"fedora": "http://download.fedoraproject.org/pub/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.qcow2"
}
},
"compute": {
"network": {
"public_interface": "enp0s3",
"service_type": "nova"
},
"enabled_apis": "ec2,osapi_compute",
"config": {
"ram_allocation_ratio": 5.0
},
"libvirt": {
"virt_type": "qemu"
},
"networks": [
{
"label": "public",
"ipv4_cidr": "192.168.10.0/24",
"num_networks": "1",
"network_size": "255",
"bridge": "br100",
"bridge_dev": "enp0s8",
"dns1": "8.8.8.8",
"dns2": "8.8.4.4"
}
]
}
}
}
}

View File

@ -1,51 +1,71 @@
{
"name": "vagrant-aio-neutron",
"description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-aio-neutron vagrantfile. Defines the necessary attributes for a working all-in-one openstack deployment, using neutron for the networking component, and the openvswitch neutron plugin",
"cookbook_versions": {
},
"json_class": "Chef::Environment",
"chef_type": "environment",
"default_attributes": {
},
"override_attributes": {
"openstack": {
"developer_mode": true,
"identity": {
"catalog": {
"backend": "templated"
}
},
"endpoints": {
"identity-bind": {
"host": "0.0.0.0"
}
},
"network": {
"openvswitch": {
"local_ip_interface": "eth1"
}
},
"image": {
"image_upload": true,
"upload_images": [
"cirros"
],
"upload_image": {
"cirros": "https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img"
}
},
"compute": {
"network": {
"public_interface": "eth1",
"service_type": "neutron"
"name": "vagrant-aio-neutron",
"description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-aio-neutron vagrantfile. Defines the necessary attributes for a working all-in-one openstack deployment, using neutron for the networking component, and the openvswitch neutron plugin",
"cookbook_versions": {
},
"json_class": "Chef::Environment",
"chef_type": "environment",
"default_attributes": {
},
"override_attributes": {
"mysql": {
"allow_remote_root": true,
"root_network_acl": ["%"]
},
"config": {
"ram_allocation_ratio": 5.0
},
"libvirt": {
"virt_type": "qemu"
"openstack": {
"endpoints": {
"identity-bind": {
"host": "0.0.0.0"
},
"bind-host": "0.0.0.0"
},
"network": {
"service_plugins": [ "neutron.services.l3_router.l3_router_plugin.L3RouterPlugin" ],
"dhcp": {
"enable_isolated_metadata": "True"
},
"openvswitch": {
"tunnel_id_ranges": "1:1000",
"enable_tunneling": "True",
"tunnel_type": "gre",
"tenant_network_type": "gre"
},
"api": {
"bind_interface": "eth1"
},
"quota": {
"floatingip": "50"
},
"l3":{
"external_network_bridge_interface": "eth1"
}
},
"block-storage": {
"volume": {
"create_volume_group": true,
"default_volume_type": "lvm"
}
},
"image": {
"image_upload": true,
"upload_images": [
"cirros"
],
"upload_image": {
"cirros": "https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img"
}
},
"compute": {
"network": {
"service_type": "neutron"
},
"config": {
"ram_allocation_ratio": 5.0
},
"libvirt": {
"virt_type": "qemu"
}
}
}
}
}
}
}

View File

@ -1,58 +1,56 @@
{
"name": "vagrant-aio-nova",
"description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-aio-nova vagrantfile. Defines the necessary attributes for a working all-in-one openstack deployment, using nova-network for the networking component",
"cookbook_versions": {
},
"json_class": "Chef::Environment",
"chef_type": "environment",
"default_attributes": {
},
"override_attributes": {
"openstack": {
"developer_mode": true,
"identity": {
"catalog": {
"backend": "templated"
"name": "vagrant-aio-nova",
"description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-aio-nova vagrantfile. Defines the necessary attributes for a working all-in-one openstack deployment, using nova-network for the networking component",
"cookbook_versions": {
},
"json_class": "Chef::Environment",
"chef_type": "environment",
"default_attributes": {
},
"override_attributes": {
"openstack": {
"endpoints": {
"bind-host": "0.0.0.0",
"host": "0.0.0.0"
},
"image": {
"image_upload": true,
"upload_images": [
"cirros",
"ubuntu-trusty",
"fedora"
],
"upload_image": {
"cirros": "http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img",
"ubuntu-trusty": "http://uec-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img",
"fedora": "http://download.fedoraproject.org/pub/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.qcow2"
}
},
"compute": {
"network": {
"public_interface": "eth0",
"service_type": "nova"
},
"enabled_apis": "ec2,osapi_compute",
"config": {
"ram_allocation_ratio": 5.0
},
"libvirt": {
"virt_type": "qemu"
},
"networks": [
{
"label": "public",
"ipv4_cidr": "192.168.10.0/24",
"num_networks": "1",
"network_size": "255",
"bridge": "br100",
"bridge_dev": "eth1",
"dns1": "8.8.8.8",
"dns2": "8.8.4.4"
}
]
}
}
},
"endpoints": {
"identity-bind": {
"host": "0.0.0.0"
}
},
"image": {
"image_upload": true,
"upload_images": [
"cirros"
],
"upload_image": {
"cirros": "https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img"
}
},
"compute": {
"network": {
"public_interface": "eth1",
"service_type": "nova"
},
"config": {
"ram_allocation_ratio": 5.0
},
"libvirt": {
"virt_type": "qemu"
},
"networks": [
{
"label": "public",
"ipv4_cidr": "192.168.100.0/24",
"num_networks": "1",
"network_size": "255",
"bridge": "br100",
"bridge_dev": "eth1",
"dns1": "8.8.8.8",
"dns2": "8.8.4.4"
}
]
}
}
}
}

View File

@ -0,0 +1,92 @@
{
"name": "vagrant-multi-centos7-nova",
"description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-multi-neutron vagrantfile. Defines the necessary attributes for a working mutltinode (1 controller/n computes) openstack deployment, using neutron (with gre tunnels between hosts) for the networking component.",
"cookbook_versions": {
},
"json_class": "Chef::Environment",
"chef_type": "environment",
"default_attributes": {
},
"override_attributes": {
"yum": {
"repo": {
"baseurl": "https://repos.fedorapeople.org/repos/openstack/openstack-juno/epel-7"
},
"epel": {
"mirrorlist": "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-7&arch=$basearch",
"gpgkey": "http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7"
}
},
"mysql": {
"allow_remote_root": true,
"root_network_acl": ["%"]
},
"openstack": {
"yum": {
"uri": "https://repos.fedorapeople.org/repos/openstack/openstack-juno/epel-7"
},
"identity": {
"bind_interface": "enp0s8"
},
"endpoints": {
"bind-host": "10.0.1.60",
"host": "10.0.1.60",
"mq": {
"host": "10.0.1.60"
},
"db": {
"host": "10.0.1.60"
},
"compute-vnc-bind":{
"host": "0.0.0.0"
}
},
"image": {
"api": {
"bind_interface": "enp0s8"
},
"registry": {
"bind_interface": "enp0s8"
},
"image_upload": true,
"upload_images": [
"cirros",
"ubuntu-trusty",
"centos-7"
],
"upload_image": {
"cirros": "http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img",
"ubuntu-trusty": "https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img",
"centos-7": "http://cloud.centos.org/centos/7/devel/CentOS-7-x86_64-GenericCloud.qcow2"
}
},
"compute": {
"libvirt": {
"virt_type": "qemu"
},
"network": {
"public_interface": "enp0s3",
"service_type": "nova",
"multi_host": "true"
},
"enabled_apis": "ec2,osapi_compute",
"config": {
"ram_allocation_ratio": 5.0
},
"networks": [
{
"label": "public",
"ipv4_cidr": "10.0.1.0/24",
"num_networks": "1",
"network_size": "254",
"bridge": "br100",
"bridge_dev": "enp0s8",
"dns1": "8.8.8.8",
"dns2": "8.8.4.4",
"multi_host": "T"
}
]
}
}
}
}

View File

@ -1,84 +1,104 @@
{
"name": "vagrant-multi-neutron",
"description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-multi-neutron vagrantfile. Defines the necessary attributes for a working mutltinode (1 controller/n computes) openstack deployment, using neutron (with gre tunnels between hosts) for the networking component.",
"cookbook_versions": {
},
"json_class": "Chef::Environment",
"chef_type": "environment",
"default_attributes": {
},
"override_attributes": {
"mysql": {
"allow_remote_root": true,
"root_network_acl": "%"
"name": "vagrant-multi-neutron",
"description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-multi-neutron vagrantfile. Defines the necessary attributes for a working mutltinode (1 controller/n computes) openstack deployment, using neutron (with gre tunnels between hosts) for the networking component.",
"cookbook_versions": {
},
"openstack": {
"identity": {
"bind_interface": "eth1"
},
"endpoints": {
"host": "192.168.3.60",
"mq": {
"host": "192.168.3.60"
"json_class": "Chef::Environment",
"chef_type": "environment",
"default_attributes": {
},
"override_attributes": {
"mysql": {
"allow_remote_root": true,
"root_network_acl": ["%"]
},
"db": {
"host": "192.168.3.60"
},
"developer_mode": true,
"network": {
"debug": "True",
"dhcp": {
"enable_isolated_metadata": "True"
},
"metadata": {
"nova_metadata_ip": "192.168.3.60"
},
"openvswitch": {
"tunnel_id_ranges": "1:1000",
"enable_tunneling": "True",
"tenant_network_type": "gre",
"local_ip_interface": "eth2"
},
"api": {
"bind_interface": "eth1"
}
},
"image": {
"api": {
"bind_interface": "eth1"
},
"registry": {
"bind_interface": "eth1"
},
"image_upload": true,
"upload_images": [
"cirros",
"ubuntu"
],
"upload_image": {
"ubuntu": "http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img",
"cirros": "https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img"
}
},
"compute": {
"xvpvnc_proxy": {
"bind_interface": "eth1"
},
"novnc_proxy": {
"bind_interface": "eth1"
},
"libvirt": {
"virt_type": "qemu"
},
"network": {
"public_interface": "eth1",
"service_type": "neutron"
},
"config": {
"ram_allocation_ratio": 5.0
}
"openstack": {
"identity": {
"bind_interface": "eth1"
},
"endpoints": {
"host": "192.168.100.60",
"bind-host": "192.168.100.60",
"mq": {
"host": "192.168.100.60"
},
"db": {
"host": "192.168.100.60"
},
"image-api-bind":{
"host": "192.168.100.60"
},
"image-api":{
"host": "192.168.100.60"
},
"compute-vnc-bind":{
"host": "0.0.0.0",
"bind_interface": "eth1"
},
"compute-vnc":{
"host": "0.0.0.0",
"bind_interface": "eth1"
}
},
"network": {
"service_plugins": [ "neutron.services.l3_router.l3_router_plugin.L3RouterPlugin" ],
"dhcp": {
"enable_isolated_metadata": "True"
},
"openvswitch": {
"tunnel_id_ranges": "1:1000",
"enable_tunneling": "True",
"tunnel_type": "gre",
"tenant_network_type": "gre"
},
"api": {
"bind_interface": "eth1"
},
"quota": {
"floatingip": "50"
},
"l3":{
"external_network_bridge_interface": "eth1"
}
},
"block-storage": {
"volume": {
"create_volume_group": true,
"default_volume_type": "lvm"
}
},
"image": {
"api": {
"bind_interface": "eth1"
},
"registry": {
"bind_interface": "eth1"
},
"image_upload": true,
"upload_images": [
"cirros"
],
"upload_image": {
"cirros": "https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img"
}
},
"compute": {
"enabled_apis": "ec2,osapi_compute",
"novnc_proxy": {
"bind_interface": "eth1",
"bind_address": "0.0.0.0"
},
"libvirt": {
"virt_type": "qemu"
},
"network": {
"public_interface": "eth1",
"service_type": "neutron"
},
"config": {
"ram_allocation_ratio": 5.0
}
}
}
}
}
}
}

View File

@ -0,0 +1,92 @@
{
"name": "vagrant-multi-nova",
"description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-multi-neutron vagrantfile. Defines the necessary attributes for a working mutltinode (1 controller/n computes) openstack deployment, using neutron (with gre tunnels between hosts) for the networking component.",
"cookbook_versions": {
},
"json_class": "Chef::Environment",
"chef_type": "environment",
"default_attributes": {
},
"override_attributes": {
"yum": {
"repo": {
"baseurl": "https://repos.fedorapeople.org/repos/openstack/openstack-juno/epel-7"
},
"epel": {
"mirrorlist": "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-7&arch=$basearch",
"gpgkey": "http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7"
}
},
"mysql": {
"allow_remote_root": true,
"root_network_acl": ["%"]
},
"openstack": {
"yum": {
"uri": "https://repos.fedorapeople.org/repos/openstack/openstack-juno/epel-7"
},
"identity": {
"bind_interface": "eth1"
},
"endpoints": {
"bind-host": "172.16.100.60",
"host": "172.16.100.60",
"mq": {
"host": "172.16.100.60"
},
"db": {
"host": "172.16.100.60"
},
"compute-vnc-bind":{
"host": "0.0.0.0"
}
},
"image": {
"api": {
"bind_interface": "eth1"
},
"registry": {
"bind_interface": "eth1"
},
"image_upload": true,
"upload_images": [
"cirros",
"ubuntu-trusty",
"centos-7"
],
"upload_image": {
"cirros": "http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img",
"ubuntu-trusty": "https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img",
"centos-7": "http://cloud.centos.org/centos/7/devel/CentOS-7-x86_64-GenericCloud.qcow2"
}
},
"compute": {
"enabled_apis": "ec2,osapi_compute",
"libvirt": {
"virt_type": "qemu"
},
"network": {
"public_interface": "eth0",
"service_type": "nova",
"multi_host": "true"
},
"config": {
"ram_allocation_ratio": 5.0
},
"networks": [
{
"label": "public",
"ipv4_cidr": "172.16.100.0/24",
"num_networks": "1",
"network_size": "254",
"bridge": "br100",
"bridge_dev": "eth1",
"dns1": "8.8.8.8",
"dns2": "8.8.4.4",
"multi_host": "T"
}
]
}
}
}
}

View File

@ -1,11 +0,0 @@
{
"name": "zero-demo",
"override_attributes": {
"mysql": {
"server_root_password": "ilikerandompasswords"
},
"openstack": {
"developer_mode": true
}
}
}

View File

@ -5,11 +5,7 @@ cookbooks:
roles:
- allinone-compute:
- os-compute-single-controller:
- os-base:
- os-ops-caching:
- os-ops-messaging:
- os-ops-database:
- os-block-storage:
- os-block-storage-api:
- os-block-storage-scheduler:
@ -23,6 +19,8 @@ roles:
- os-compute-conductor:
- os-compute-scheduler:
- os-compute-setup:
- os-compute-single-controller:
- os-compute-single-controller-no-network:
- os-compute-vncproxy:
- os-compute-worker:
- os-dashboard:
@ -31,22 +29,34 @@ roles:
- os-image-api:
- os-image-registry:
- os-image-upload:
- os-telemetry-agent-central:
- os-telemetry-agent-compute:
- os-telemetry-api:
- os-telemetry-collector:
- os-network:
- os-network-server:
- os-network-l3-agent:
- os-network-dhcp-agent:
- os-network-l3-agent:
- os-network-metadata-agent:
- os-network-openvswitch:
- os-object-storage:
- os-network-server:
- os-object-storage-account:
- os-object-storage-container:
- os-object-storage-management:
- os-object-storage-object:
- os-object-storage-proxy:
- os-object-storage-setup:
- os-ops-caching:
- os-ops-database:
- os-ops-messaging:
- os-orchestration:
- os-orchestration-api:
- os-orchestration-api-cfn:
- os-orchestration-api-cloudwatch:
- os-orchestration-engine:
- os-telemetry:
- os-telemetry-agent-central:
- os-telemetry-agent-compute:
- os-telemetry-agent-notification:
- os-telemetry-alarm-evaluator:
- os-telemetry-alarm-notifier:
- os-telemetry-api:
- os-telemetry-collector:
environments:
- example:

57
multi-neutron.rb Normal file
View File

@ -0,0 +1,57 @@
require 'chef/provisioning'
controller_config = <<-ENDCONFIG
config.vm.network "forwarded_port", guest: 443, host: 9443 # dashboard-ssl
config.vm.network "forwarded_port", guest: 4002, host: 4002
config.vm.network "forwarded_port", guest: 5000, host: 5000
config.vm.network "forwarded_port", guest: 8773, host: 8773 # compute-ec2-api
config.vm.network "forwarded_port", guest: 8774, host: 8774 # compute-api
config.vm.network "forwarded_port", guest: 35357, host: 35357
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
v.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
config.vm.network "private_network", ip: "192.168.100.60"
config.vm.network "private_network", ip: "192.168.200.60"
ENDCONFIG
machine 'controller' do
add_machine_options vagrant_config: controller_config
role 'os-compute-single-controller-no-network'
recipe 'openstack-network::identity_registration'
role 'os-network-openvswitch'
role 'os-network-dhcp-agent'
role 'os-network-metadata-agent'
role 'os-network-server'
recipe 'openstack-common::openrc'
chef_environment 'vagrant-multi-neutron'
file('/etc/chef/openstack_data_bag_secret',
"#{File.dirname(__FILE__)}/.chef/encrypted_data_bag_secret")
converge true
end
machine_batch do
[%w(compute1 61), %w(compute2 62), %w(compute3 63)].each do |name, ip_suff|
machine name do
add_machine_options vagrant_config: <<-ENDCONFIG
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
v.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
config.vm.network "private_network", ip: "192.168.100.#{ip_suff}"
config.vm.network "private_network", ip: "192.168.200.#{ip_suff}"
ENDCONFIG
role 'os-compute-worker'
chef_environment 'vagrant-multi-neutron'
file('/etc/chef/openstack_data_bag_secret',
"#{File.dirname(__FILE__)}/.chef/encrypted_data_bag_secret")
converge true
end
end
end

61
multi-nova.rb Normal file
View File

@ -0,0 +1,61 @@
require 'chef/provisioning'
controller_config = <<-ENDCONFIG
config.vm.network "forwarded_port", guest: 443, host: 9443 # dashboard-ssl
config.vm.network "forwarded_port", guest: 4002, host: 4002
config.vm.network "forwarded_port", guest: 5000, host: 5000
config.vm.network "forwarded_port", guest: 6080, host: 6080
config.vm.network "forwarded_port", guest: 8773, host: 8773 # compute-ec2-api
config.vm.network "forwarded_port", guest: 8774, host: 8774 # compute-api
config.vm.network "forwarded_port", guest: 35357, host: 35357
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
v.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
config.vm.network "public_network", ip: "172.16.100.60",
bridge: '<put your interface device name here>'
ENDCONFIG
machine 'controller' do
add_machine_options vagrant_config: controller_config
role 'os-compute-single-controller'
recipe 'openstack-network::identity_registration'
role 'os-network-dhcp-agent'
role 'os-network-metadata-agent'
role 'os-network-server'
recipe 'openstack-common::openrc'
# if you would like to use centos7 you'll need to
# use 'vagrant-multi-centos7-nova' for the environment
chef_environment 'vagrant-multi-nova'
file('/etc/chef/openstack_data_bag_secret',
"#{File.dirname(__FILE__)}/.chef/encrypted_data_bag_secret")
converge true
end
machine_batch do
[%w(compute1 61), %w(compute2 62), %w(compute3 63)].each do |name, ip_suff|
machine name do
add_machine_options vagrant_config: <<-ENDCONFIG
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
v.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
config.vm.network "public_network", ip: "172.16.100.#{ip_suff}",
bridge: '<put your interface device name here>'
ENDCONFIG
role 'os-compute-worker'
# if you would like to use centos7 you'll need to
# use 'vagrant-multi-centos7-nova' for the environment
chef_environment 'vagrant-multi-nova'
file('/etc/chef/openstack_data_bag_secret',
"#{File.dirname(__FILE__)}/.chef/encrypted_data_bag_secret")
converge true
end
end
end

View File

@ -8,6 +8,8 @@
},
"chef_type": "role",
"run_list": [
"recipe[apt]",
"recipe[yum]",
"recipe[openstack-common]",
"recipe[openstack-common::logging]",
"recipe[openstack-common::set_endpoints_by_interface]",

View File

@ -0,0 +1,16 @@
{
"name": "os-object-storage-setup",
"description": "OpenStack object storage setup",
"json_class": "Chef::Role",
"default_attributes": {
},
"override_attributes": {
},
"chef_type": "role",
"run_list": [
"role[os-base]",
"recipe[openstack-object-storage::setup]"
],
"env_run_lists": {
}
}

View File

@ -1,20 +0,0 @@
{
"name": "os-object-storage",
"description": "OpenStack object storage roll-up role",
"json_class": "Chef::Role",
"default_attributes": {
},
"override_attributes": {
},
"chef_type": "role",
"run_list": [
"role[os-base]",
"role[os-object-storage-account]",
"role[os-object-storage-container]",
"role[os-object-storage-management]",
"role[os-object-storage-object]",
"role[os-object-storage-proxy]"
],
"env_run_lists": {
}
}

16
vagrant_linux.rb Normal file
View File

@ -0,0 +1,16 @@
require 'chef/provisioning/vagrant_driver'
vagrant_box 'centos7' do
url 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.0_chef-provisionerless.box'
end
vagrant_box 'ubuntu14' do
url 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box'
end
with_driver "vagrant:#{File.dirname(__FILE__)}/vms"
with_machine_options vagrant_options: {
# if you would like to use centos7 you'll need to
# update the chef_environment in the main recipe files (aio or multi _nova)
'vm.box' => 'ubuntu14'
}