Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from sc68cal/submodule_fix
Convert vagrant-openstack cookbook from submodule
- Loading branch information
Showing
12 changed files
with
228 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
[submodule "cookbooks/devstack"] | ||
path = cookbooks/devstack | ||
url = git://github.com/sc68cal/chef-devstack.git | ||
[submodule "cookbooks/vagrant-openstack"] | ||
path = cookbooks/vagrant-openstack | ||
url = git://github.com/osops/vagrant-openstack.git | ||
[submodule "cookbooks/apt"] | ||
path = cookbooks/apt | ||
url = git://github.com/opscode-cookbooks/apt.git |
Submodule vagrant-openstack
deleted from
e56863
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
default[:user] = "vagrant" | ||
default[:my_ip] = ipaddress | ||
default[:hostname] = "openstack" | ||
default[:cache][:dir] = "/home/vagrant/cache" | ||
default[:dotfiles][:repository] = "https://github.com/vishvananda/.dotfiles.git -b linux" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# | ||
# Cookbook Name:: nova | ||
# Attributes:: default | ||
# | ||
# Copyright 2008-2009, Opscode, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
::Chef::Node.send(:include, Opscode::OpenSSL::Password) | ||
|
||
default[:nova][:hostname] = "nova" | ||
default[:nova][:install_type] = "binary" | ||
default[:nova][:compute_connection_type] = "qemu" | ||
default[:nova][:creds][:user] = "nova" | ||
default[:nova][:creds][:group] = "nogroup" | ||
default[:nova][:creds][:dir] = "/var/lib/nova" | ||
default[:nova][:my_ip] = ipaddress | ||
default[:nova][:vlan_interface] = "eth1" | ||
default[:nova][:flatdhcp] = true | ||
default[:nova][:flat_interface] = "eth1" | ||
default[:nova][:public_interface] = "br100" | ||
default[:nova][:mysql] = true | ||
default[:nova][:images] = [] | ||
default[:nova][:floating_range] = "192.168.76.128/28" | ||
default[:nova][:fixed_range] = "10.0.0.0/8" | ||
default[:nova][:flat_dhcp_start] = "10.0.0.2" | ||
default[:nova][:num_networks] = 8 | ||
default[:nova][:network_size] = 32 | ||
default[:nova][:user] = "admin" | ||
default[:nova][:project] = "admin" | ||
set_unless[:nova][:access_key] = secure_password | ||
set_unless[:nova][:secret_key] = secure_password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
maintainer "Vishvananda Ishaya" | ||
maintainer_email "vishvananda@gmail.com" | ||
license "Apache 2.0" | ||
description "OpenStack vagrant helper scripts" | ||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc')) | ||
version "0.1" | ||
depends "apt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# | ||
# Cookbook Name:: vagrant-openstack | ||
# Recipe:: cache | ||
# | ||
# Copyright (c) 2012, OpenStack, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
d = node['cache']['dir'] | ||
u = node['user'] | ||
|
||
execute "rm -rf /var/cache/apt; mkdir -p #{d}/aptcache; ln -s #{d}/aptcache /var/cache/apt" | ||
|
||
execute "mkdir -p #{d}/pipcache; ln -s #{d}/pipcache /var/cache/pip" do | ||
not_if { File.directory?("/var/cache/pip") } | ||
end | ||
|
||
execute "ln -s /home/#{u}/.host-ssh/id_rsa /home/#{u}/.ssh/id_rsa" do | ||
user u | ||
group u | ||
not_if { File.exists?("/home/#{u}/.ssh/id_rsa") } | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# Cookbook Name:: vagrant-openstack | ||
# Recipe:: devstack-cache | ||
# | ||
# Copyright (c) 2012, OpenStack, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
include_recipe "apt" | ||
|
||
package 'rsync' | ||
|
||
d = node['cache']['dir'] | ||
u = node['user'] | ||
|
||
execute "mkdir -p #{d}/stack; rsync -vur --delete --exclude=stack/nova-volumes-backing-file --exclude=stack/glance/images/* #{d}/stack /opt; chown -R #{u} /opt/stack" |
26 changes: 26 additions & 0 deletions
26
cookbooks/vagrant-openstack/recipes/devstack-update-cache.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Cookbook Name:: vagrant-openstack | ||
# Recipe:: devstack-update-cache | ||
# | ||
# Copyright (c) 2012, OpenStack, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
include_recipe "apt" | ||
|
||
package 'rsync' | ||
|
||
d = node['cache']['dir'] | ||
|
||
execute "rsync -vur --delete --exclude=stack/nova-volumes-backing-file --exclude=stack/glance/images/* /opt/stack #{d}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# | ||
# Cookbook Name:: vagrant_devstack | ||
# Recipe:: dotfiles | ||
# | ||
# Copyright 2011, Anso Labs | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
include_recipe "apt" | ||
|
||
package "bzr" | ||
package "git" | ||
package "vim-gtk" | ||
package "screen" | ||
package "tmux" | ||
package "exuberant-ctags" | ||
|
||
u = node['user'] | ||
execute "git clone #{node['dotfiles']['repository']} /home/#{u}/.dotfiles/" do | ||
user u | ||
group u | ||
not_if { File.exists?("/home/#{u}/.dotfiles/") } | ||
end | ||
|
||
execute "cd /home/#{u} && .dotfiles/link.sh || true" do | ||
user u | ||
group u | ||
not_if { File.exists?("/home/#{u}/.bash_profile") } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# | ||
# Cookbook Name:: vagrant-openstack | ||
# Recipe:: hostname | ||
# | ||
# Copyright (c) 2012 OpenStack, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
unless Chef::Config[:solo] | ||
node[:nova][:hostname] = node.name | ||
end | ||
|
||
execute "/root/hostname.sh" do | ||
action :nothing | ||
end | ||
|
||
domain = node[:fqdn].split('.')[1..-1].join('.') | ||
|
||
template "/root/hostname.sh" do | ||
source "hostname.erb" | ||
owner "root" | ||
group "root" | ||
mode 0755 | ||
variables( | ||
:ip => node[:my_ip], | ||
:hostname => node[:hostname], | ||
:domain => domain | ||
) | ||
notifies :run, resources(:execute => "/root/hostname.sh"), :immediately | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
HOSTNAME="<%= @hostname %>" | ||
hostname $HOSTNAME | ||
echo $HOSTNAME > /etc/hostname | ||
sed -i "s/127.0.1.1.*/<%= @ip %> $HOSTNAME.<%= @domain %> $HOSTNAME/g" /etc/hosts |