chef-workflow-tasklib 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +12 -0
- data/lib/chef-workflow-tasklib/version.rb +1 -1
- data/lib/chef-workflow/tasks/chef/build.rb +2 -0
- data/lib/chef-workflow/tasks/chef/converge.rb +2 -0
- data/lib/chef-workflow/tasks/chef/cookbooks/foodcritic.rb +3 -1
- data/lib/chef-workflow/tasks/chef/cookbooks/upload.rb +3 -1
- data/lib/chef-workflow/tasks/chef/destroy.rb +19 -0
- data/lib/chef-workflow/tasks/chef/init.rb +7 -0
- data/lib/chef-workflow/tasks/chef_server.rb +2 -2
- data/lib/chef-workflow/tasks/default.rb +2 -0
- metadata +4 -2
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
* 0.2.2 March 12, 2012
|
2
|
+
* New tasks:
|
3
|
+
* `chef:init` creates a chef server and fills it with your chef repository.
|
4
|
+
Shorthand for `chef_server:create chef:upload`.
|
5
|
+
* `chef:destroy` is the inverse of `chef:build` and can be used to snipe
|
6
|
+
server groups. Requires a role/group name and deprovisions them through
|
7
|
+
the common path.
|
8
|
+
* When cookbook resolvers were used and exited non-zero, the exit got
|
9
|
+
swallowed and processing continued. They now abort like they should.
|
10
|
+
* `chef:build`, `chef:converge`, and `chef:destroy` are now repeatable tasks,
|
11
|
+
so you can do things like this: `be rake chef:build[foo] chef:build[bar]`
|
12
|
+
and it does what you expect it to do.
|
1
13
|
* 0.2.1 February 11, 2012
|
2
14
|
* A few common situations would cause cookbook resolvers to not work if they
|
3
15
|
were integrated.
|
@@ -4,6 +4,8 @@ require 'chef-workflow/support/vm/helpers/knife'
|
|
4
4
|
namespace :chef do
|
5
5
|
desc "build and bootstrap a machine with a role in the run_list"
|
6
6
|
task :build, :role_name, :number_of_machines do |task, args|
|
7
|
+
task.reenable
|
8
|
+
|
7
9
|
unless args[:role_name]
|
8
10
|
raise 'You must supply a role name to chef:build'
|
9
11
|
end
|
@@ -7,7 +7,9 @@ namespace :chef do
|
|
7
7
|
namespace :cookbooks do
|
8
8
|
desc "Run the cookbooks through foodcritic"
|
9
9
|
task :foodcritic do
|
10
|
-
Rake::Task["chef:cookbooks:resolve"]
|
10
|
+
resolve_task = Rake::Task["chef:cookbooks:resolve"] rescue nil
|
11
|
+
resolve_task.invoke if resolve_task
|
12
|
+
|
11
13
|
if File.directory?(ChefWorkflow::KnifeSupport.fc_cookbooks_path)
|
12
14
|
Bundler.with_clean_env do
|
13
15
|
sh "foodcritic #{ChefWorkflow::KnifeSupport.fc_cookbooks_path} #{ChefWorkflow::KnifeSupport.fc_options.join(" ")}"
|
@@ -5,7 +5,9 @@ namespace :chef do
|
|
5
5
|
namespace :cookbooks do
|
6
6
|
desc "Upload your cookbooks to the chef server"
|
7
7
|
task :upload => [ "bootstrap:knife" ] do
|
8
|
-
Rake::Task["chef:cookbooks:resolve"]
|
8
|
+
resolve_task = Rake::Task["chef:cookbooks:resolve"] rescue nil
|
9
|
+
resolve_task.invoke if resolve_task
|
10
|
+
|
9
11
|
result = knife %W[cookbook upload -a]
|
10
12
|
fail if result != 0
|
11
13
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'chef-workflow/task-helpers/with_scheduler'
|
2
|
+
require 'chef-workflow/support/vm/helpers/knife'
|
3
|
+
|
4
|
+
namespace :chef do
|
5
|
+
desc "Tear down a server group"
|
6
|
+
task :destroy, :role_name do |task, args|
|
7
|
+
task.reenable
|
8
|
+
|
9
|
+
unless args[:role_name]
|
10
|
+
raise 'You must supply a role name to chef:destroy'
|
11
|
+
end
|
12
|
+
|
13
|
+
role_name = args[:role_name]
|
14
|
+
|
15
|
+
with_scheduler do |s|
|
16
|
+
s.teardown_group(role_name)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -14,9 +14,9 @@ namespace :chef_server do
|
|
14
14
|
with_scheduler do |s|
|
15
15
|
s.serial = true
|
16
16
|
s.schedule_provision(
|
17
|
-
'chef-server',
|
17
|
+
'chef-server',
|
18
18
|
[
|
19
|
-
ChefWorkflow::GeneralSupport.machine_provisioner.new('chef-server', 1),
|
19
|
+
ChefWorkflow::GeneralSupport.machine_provisioner.new('chef-server', 1),
|
20
20
|
ChefWorkflow::VM::ChefServerProvisioner.new
|
21
21
|
],
|
22
22
|
[]
|
@@ -1,8 +1,10 @@
|
|
1
1
|
chef_workflow_task 'chef_server'
|
2
|
+
chef_workflow_task 'chef/init'
|
2
3
|
chef_workflow_task 'chef/cookbooks/upload'
|
3
4
|
chef_workflow_task 'chef/upload'
|
4
5
|
chef_workflow_task 'chef/clean'
|
5
6
|
chef_workflow_task 'chef/build'
|
7
|
+
chef_workflow_task 'chef/destroy'
|
6
8
|
chef_workflow_task 'chef/converge'
|
7
9
|
chef_workflow_task 'chef/info'
|
8
10
|
chef_workflow_task 'test/build'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-workflow-tasklib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef-workflow
|
@@ -107,8 +107,10 @@ files:
|
|
107
107
|
- lib/chef-workflow/tasks/chef/cookbooks/resolve/librarian.rb
|
108
108
|
- lib/chef-workflow/tasks/chef/cookbooks/upload.rb
|
109
109
|
- lib/chef-workflow/tasks/chef/data_bags.rb
|
110
|
+
- lib/chef-workflow/tasks/chef/destroy.rb
|
110
111
|
- lib/chef-workflow/tasks/chef/environments.rb
|
111
112
|
- lib/chef-workflow/tasks/chef/info.rb
|
113
|
+
- lib/chef-workflow/tasks/chef/init.rb
|
112
114
|
- lib/chef-workflow/tasks/chef/roles.rb
|
113
115
|
- lib/chef-workflow/tasks/chef/upload.rb
|
114
116
|
- lib/chef-workflow/tasks/chef_server.rb
|