Cannot install sensu client on windows using vagrant and chef


#1

Hi,

I am trying to install sensu client on Windows 2008 server using sensu-chef cookbook but I get this error:

Chef::Exceptions::Win32APIError

···

No mapping between account names and security IDs was done.

---- Begin Win32 API output ----

System Error Code: 1332

System Error Message: No mapping between account names and security IDs was done.

---- End Win32 API output ----

Resource Declaration:


In C:/tmp/vagrant-chef-1/chef-solo-1/cookbooks/sensu/recipes/default.rb

39: directory File.join(node.sensu.directory, “conf.d”) do

40: owner “sensu”

41: group “sensu”

42: recursive true

43: mode 0750

44: end

45:

This is the recipe I am using:

include_recipe ‘sensu::default’

sensu_client node.name do

address node[“ipaddress”]

subscriptions node[:sensu][:subscriptions]

end

log “Subscription list: #{node[:sensu][:subscriptions].inspect}”

case node[“platform”]

when “debian”, “ubuntu”

add dependency to run extconf.rb to build gems with native code

apt_package “ruby-dev” do

action :install

end

end

gem_package “sensu-plugin” do

action :install

end

include_recipe ‘sensu::client_service’

I think that the problem is that Windows need different user, group and permission than Linux, something like this:

resource "x.txt" do
  rights :read, "Everyone"
  rights :write, "domain\group"
  rights :full_control, "group_name_or_user_name"
  rights :full_control, "user_name", :applies_to_children => true
end

#2

the error is cause because in default recipe and in providers/json_file.rb the root user is specified, plus the sensu user does not exists on windows. I am now able to run the cookbook on windows (install the sensu client) but I need to refactor the code, then I will make a pull request

···

On Friday, 21 February 2014 15:48:19 UTC, Riccardo Tacconi wrote:

Hi,

I am trying to install sensu client on Windows 2008 server using sensu-chef cookbook but I get this error:

Chef::Exceptions::Win32APIError


No mapping between account names and security IDs was done.

---- Begin Win32 API output ----

System Error Code: 1332

System Error Message: No mapping between account names and security IDs was done.

---- End Win32 API output ----

Resource Declaration:


In C:/tmp/vagrant-chef-1/chef-solo-1/cookbooks/sensu/recipes/default.rb

39: directory File.join(node.sensu.directory, “conf.d”) do

40: owner “sensu”

41: group “sensu”

42: recursive true

43: mode 0750

44: end

45:

This is the recipe I am using:

include_recipe ‘sensu::default’

sensu_client node.name do

address node[“ipaddress”]

subscriptions node[:sensu][:subscriptions]

end

log “Subscription list: #{node[:sensu][:subscriptions].inspect}”

case node[“platform”]

when “debian”, “ubuntu”

add dependency to run extconf.rb to build gems with native code

apt_package “ruby-dev” do

action :install

end

end

gem_package “sensu-plugin” do

action :install

end

include_recipe ‘sensu::client_service’

I think that the problem is that Windows need different user, group and permission than Linux, something like this:

resource "x.txt" do
  rights :read, "Everyone"
  rights :write, "domain\group"
  rights :full_control, "group_name_or_user_name"
  rights :full_control, "user_name", :applies_to_children => true
end

#3