Created
August 1, 2013 19:14
-
-
Save harlanbarnes/6134310 to your computer and use it in GitHub Desktop.
wat?
This file contains hidden or 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 | |
metadata | |
cookbook 'pgirepo', chef_api: :config | |
group :integration do | |
cookbook "minitest-handler" | |
end |
This file contains hidden or 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
$ bundle exec berks install | |
Using zabbix (0.1.0) | |
Using pgirepo (0.1.1) | |
Using minitest-handler (0.2.1) | |
Using yum (2.3.0) | |
Using chef_handler (1.1.4) | |
$ vagrant up --provider aws | |
Bringing machine 'default' up with 'aws' provider... | |
[Berkshelf] Updating Vagrant's berkshelf: '/var/lib/jenkins/.berkshelf/default/vagrant/berkshelf-20130801-28202-gk2pgf-default' | |
[Berkshelf] Using zabbix (0.1.0) | |
Berkshelf::CookbookNotFound: Cookbook 'pgirepo' not found in any of the default locations | |
This file contains hidden or 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
Vagrant.configure("2") do |config| | |
COOKBOOK = File.read('metadata.rb').match(/name\s+['"](.+)['"]/)[1] | |
config.vm.box = "dummy" | |
config.berkshelf.enabled = true | |
config.vm.provider :aws do |aws,override| | |
aws.access_key_id = ENV['AWS_ACCESS_KEY_ID'] | |
aws.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY'] | |
aws.ami = "ami-0d22b23d" | |
aws.region = "us-west-2" | |
aws.instance_type = "m1.small" | |
aws.keypair_name = "jenkins" | |
aws.security_groups = [ "ssh" ] | |
aws.tags = { | |
'Name' => "cookbook-#{COOKBOOK}-test-#{ENV['USER']}", | |
'Project' => "PGi" | |
} | |
override.ssh.username = "root" | |
override.ssh.private_key_path = "#{ENV['HOME']}/.ssh/id_rsa" | |
end | |
config.vm.provision :chef_solo do |chef| | |
chef.add_recipe COOKBOOK | |
chef.add_recipe "minitest-handler" | |
chef.json = { | |
"zabbix" => { | |
"servername" => "fakeserver", | |
"hostname" => "fakehost" | |
} | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment