Powershell Provider


#1

I’m running Chef 10.12.0 on Windows 2008 R2. Using the powershell cookbook
1.0.6 I get a failure complaining about umask being an undefined method. Any
guidance is appreciated.

[2012-06-21T16:10:54-07:00] INFO: Processing powershell[DiskPart] action run
(AN::DiskPart line /chef/cache/cookbooks/AN/recipes/DiskPart.rb)
[2012-06-21T16:10:54-07:00] ERROR: powershell[DiskPart] (AN::DiskPart line
/chef/cache/cookbooks/AN/recipes/DiskPart.rb) has had an error
[2012-06-21T16:10:54-07:00] ERROR: powershell[DiskPart]
(c:/chef/cache/cookbooks/AN/recipes/DiskPart.rb:21:in from_file') had an error:powershell[DiskPart] (AN::DiskPart line /chef/cache/cookbooks/AN/recipes/DiskPart.rb) had an error: NoMethodError: undefined methodumask’ for Chef::Resource::Powershell
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource.rb:148:in
method_missing' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/provider/execute.rb:51:inaction_run’
c:/chef/cache/cookbooks/powershell/libraries/core.rb:68:in action_run' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource.rb:454:inrun_action’
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:49:in
run_action' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:inblock (2 levels) in converge’
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:in
each' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:inblock in converge’


#2

Just looking at upgrading our nodes to the latest chef from around 0.10.6/8 somewhere and ran in to this.

My fix was to add:

attribute :umask, :kind_of => String

to powershell/resources/default.rb line 34.

This probably needs a fix in the powershell provider or chef, Seth would probably know best.

Cheers,
Dave.

-----Original Message-----
From: bryan.johnson@activenetwork.com [mailto:bryan.johnson@activenetwork.com]
Sent: Friday, 22 June 2012 11:15 a.m.
To: chef@lists.opscode.com
Subject: [chef] Powershell Provider

I’m running Chef 10.12.0 on Windows 2008 R2. Using the powershell cookbook
1.0.6 I get a failure complaining about umask being an undefined method. Any
guidance is appreciated.

[2012-06-21T16:10:54-07:00] INFO: Processing powershell[DiskPart] action run (AN::DiskPart line /chef/cache/cookbooks/AN/recipes/DiskPart.rb)
[2012-06-21T16:10:54-07:00] ERROR: powershell[DiskPart] (AN::DiskPart line
/chef/cache/cookbooks/AN/recipes/DiskPart.rb) has had an error [2012-06-21T16:10:54-07:00] ERROR: powershell[DiskPart] (c:/chef/cache/cookbooks/AN/recipes/DiskPart.rb:21:in from_file') had an error:powershell[DiskPart] (AN::DiskPart line /chef/cache/cookbooks/AN/recipes/DiskPart.rb) had an error: NoMethodError: undefined methodumask’ for Chef::Resource::Powershell C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource.rb:148:in
method_missing' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/provider/execute.rb:51:inaction_run’
c:/chef/cache/cookbooks/powershell/libraries/core.rb:68:in action_run' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource.rb:454:inrun_action’
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:49:in
run_action' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:inblock (2 levels) in converge’
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:in
each' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:inblock in converge’