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 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.
@@ -1,5 +1,5 @@
1
1
  module ChefWorkflow
2
2
  module Tasklib
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
@@ -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
@@ -3,6 +3,8 @@ require 'chef-workflow/task-helpers/ssh'
3
3
  namespace :chef do
4
4
  desc "run chef-client on a group of machines"
5
5
  task :converge, :role_name do |task, args|
6
+ task.reenable
7
+
6
8
  unless args[:role_name]
7
9
  raise "You must supply a node name to converge"
8
10
  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"].invoke rescue nil
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"].invoke rescue nil
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
@@ -0,0 +1,7 @@
1
+ chef_workflow_task 'chef_server'
2
+ chef_workflow_task 'chef/upload'
3
+
4
+ namespace :chef do
5
+ desc "Create a new chef server and fill it with the chef repository."
6
+ task :init => %w[chef_server:create chef:upload]
7
+ 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.1
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-02-11 00:00:00.000000000 Z
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