Bootstrap Windows 2012

When bootstrapping windows server 2012, one of the cookbooks which gets pushed
is the Perftap cookbook which uses w32::service gem to check to PerfTap service
existing. This is called in the not_if block of powershell_script and is
failing to query the service.

The error on the run is:

SystemCallError

The specified resource type cannot be found in the image file. -
QueryServiceConfig2: The specified resource type cannot be found in the image
file.

The cookbook is trying to do the following:

not_if {
::Win32::Service.services.detect do |service
service.service_name == 'PerfTap’
end
}

This has been reported in Puppet but I cannot see anything in Chef for this
ruby gem. Link to puppet issue is here:

https://projects.puppetlabs.com/issues/16080

Any help much appreciated.

Thanks,

Hi,

No response to my issue? Surely I cannnot be the only one who is
experiencing this.

Regards,

Amit

On 13 August 2014 11:03, me@amitdattani.com wrote:

When bootstrapping windows server 2012, one of the cookbooks which gets
pushed
is the Perftap cookbook which uses w32::service gem to check to PerfTap
service
existing. This is called in the not_if block of powershell_script and is
failing to query the service.

The error on the run is:

SystemCallError

The specified resource type cannot be found in the image file. -
QueryServiceConfig2: The specified resource type cannot be found in the
image
file.

The cookbook is trying to do the following:

not_if {
::Win32::Service.services.detect do |service
service.service_name == 'PerfTap'
end
}

This has been reported in Puppet but I cannot see anything in Chef for this
ruby gem. Link to puppet issue is here:

https://projects.puppetlabs.com/issues/16080

Any help much appreciated.

Thanks,

Hi!

me@amitdattani.com writes:

When bootstrapping windows server 2012, one of the cookbooks which gets pushed
is the Perftap cookbook which uses w32::service gem to check to PerfTap service
existing. This is called in the not_if block of powershell_script and is
failing to query the service.

Is the code for this cookbook anywhere online? That might help.

The error on the run is:

SystemCallError

The specified resource type cannot be found in the image file. -
QueryServiceConfig2: The specified resource type cannot be found in the image
file.

The cookbook is trying to do the following:

not_if {
::Win32::Service.services.detect do |service
service.service_name == 'PerfTap'
end
}

Having not seen the rest of the code, I'm going to go out on a limb here
and say that this isn't really necessary anyway.

Because of this whole thing: http://docs.getchef.com/chef_why.html#idempotence

The 'service' resource is your friend and this type of checking and
not_if guard seems totally unneeded. I could could totally be wrong
though, it's your infrastructure.

This has been reported in Puppet but I cannot see anything in Chef for this
ruby gem. Link to puppet issue is here:

https://projects.puppetlabs.com/issues/16080

Seems like ultimately an issue with the gem. Again, see if you can
actually remove the need to even make this call.

Any help much appreciated.

Thanks,

--
-sean

Hi,

Apologies for late reply.

Link to git repo below:

Thanks,

Amit

On 15 August 2014 02:53, Sean Escriva sean.escriva@gmail.com wrote:

Hi!

me@amitdattani.com writes:

When bootstrapping windows server 2012, one of the cookbooks which gets
pushed
is the Perftap cookbook which uses w32::service gem to check to PerfTap
service
existing. This is called in the not_if block of powershell_script and is
failing to query the service.

Is the code for this cookbook anywhere online? That might help.

The error on the run is:

SystemCallError

The specified resource type cannot be found in the image file. -
QueryServiceConfig2: The specified resource type cannot be found in the
image
file.

The cookbook is trying to do the following:

not_if {
::Win32::Service.services.detect do |service
service.service_name == 'PerfTap'
end
}

Having not seen the rest of the code, I'm going to go out on a limb here
and say that this isn't really necessary anyway.

Because of this whole thing:
http://docs.getchef.com/chef_why.html#idempotence

The 'service' resource is your friend and this type of checking and
not_if guard seems totally unneeded. I could could totally be wrong
though, it's your infrastructure.

This has been reported in Puppet but I cannot see anything in Chef for
this
ruby gem. Link to puppet issue is here:

https://projects.puppetlabs.com/issues/16080

Seems like ultimately an issue with the gem. Again, see if you can
actually remove the need to even make this call.

Any help much appreciated.

Thanks,

--
-sean