Last active
December 25, 2015 17:09
-
-
Save hhoover/7010788 to your computer and use it in GitHub Desktop.
Copy/paste for chef class
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
default['chefnovaclient']['username'] = "USERNAME" | |
default['chefnovaclient']['password'] = "APIKEY" |
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
site :opscode | |
cookbook 'apt' | |
cookbook 'build-essential' | |
cookbook 'python' | |
metadata |
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
include_recipe "apt" | |
include_recipe "python::pip" | |
%w{git python-dev build-essential}.each do |pkg| | |
package pkg do | |
action :install | |
end | |
end | |
python_pip "rackspace-novaclient" do | |
action :install | |
end | |
python_pip "git+git://github.com/major/supernova.git" do | |
action :install | |
end | |
template "/root/.supernova" do | |
source "supernova.erb" | |
mode 0600 | |
owner "root" | |
group "root" | |
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
[myaccount] | |
OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/ | |
OS_VERSION=2.0 | |
OS_AUTH_SYSTEM=rackspace | |
OS_REGION_NAME=DFW | |
OS_SERVICE_NAME=cloudserversOpenStack | |
OS_TENANT_NAME=<%= node['chefnovaclient']['username'] %> | |
OS_USERNAME=<%= node['chefnovaclient']['username'] %> | |
OS_PASSWORD=<%= node['chefnovaclient']['password'] %> | |
OS_NO_CACHE=1 | |
NOVA_VOLUME_SERVICE_NAME=cloudBlockStorage |
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
# Encoding: utf-8 | |
require_relative 'spec_helper' | |
describe 'chefnovaclient::default' do | |
before do | |
stub_command("/usr/bin/python -c 'import setuptools'").and_return(true) | |
end | |
describe 'ubuntu' do | |
let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) } | |
it 'creates a .supernova file' do | |
expect(chef_run).to create_template('/root/.supernova') | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment