Hi @all,
I still have a problem with Puppet in conjunction with Windows. My goal in
the first step is to deploy Nagios agents on Windows servers. Therefore I
extended my current class with a Windows specific part:
# Class: nagios::client
# [...]
#
class monitor::nagios::client inherits monitor::params {
[...]
$windows = $::operatingsystem ? {
windows => true,
default => false
}
[...]
if $windows {
file {
''c:/local/source'':
ensure => directory,
mode => 0770,
owner => ''Administrator'',
group => ''Administrators'';
''c:/local/source/NSClient++-0.3.9-x64.msi'':
ensure => present,
mode => 0770,
owner => ''Administrator'',
group => ''Administrators'',
require => File[''c:/local/source''],
path => $::operatingsystem ? {
default =>
''c:/local/source/NSClient++-0.3.9-x64.msi''
},
source =>
''puppet:///modules/nagios/client/NSClient++-0.3.9-x64.msi'';
''c:/local/nsclient/boot.ini'':
ensure => present,
mode => 0770,
owner => ''Administrator'',
group => ''Administrators'',
require => Package[''NSClientpp''],
notify => Service[''NSClientpp''],
path => $::operatingsystem ? {
default => ''c:/local/nsclient/boot.ini''
},
content => template(''nagios/client/boot.ini.erb'');
''c:/local/nsclient/nsc.ini'':
ensure => present,
mode => 0770,
owner => ''Administrator'',
group => ''Administrators'',
require => Package[''NSClientpp''],
notify => Service[''NSClientpp''],
path => $::operatingsystem ? {
default => ''c:/local/nsclient/nsc.ini''
},
content => template(''nagios/client/nsc.ini.erb'');
}
package { ''NSClientpp'':
ensure => installed,
provider => ''windows'',
source =>
''c:\local\source\NSClient++-0.3.9-x64.msi'',
install_options => [
{
''INSTALLLOCATION'' =>
''c:\local\nsclient''
}
],
require =>
File[''c:/local/source/NSClient++-0.3.9-x64.msi''];
}
service { ''NSClientpp'':
ensure => ''running'',
name => $::operatingsystem ? {
default => ''NSClientpp''
},
enable => true,
require => Package[''NSClientpp''];
}
}
}
So far, so good. The first time I run the manifest, the Nagios client is
downloaded from the Puppet Server and stored localy. The local msi get
installed on the server, the configuration is deployed and the service is
up and running. Unfortunately, if I try to run the manifest again, the
package provider try to install the client again and the service is deleted
from the service list:
Level Date and Time Source Event ID Task Category
Information 21.01.2013 18:59:16 Puppet 1 None Finished catalog run in 5.59
seconds
Error 21.01.2013 18:59:16 Puppet 3 None
/Stage[main]/Nagios::Client/Service[NSClientpp]:
Could not evaluate: Cannot get status of NSClientpp, error was: The
specified service does not exist as an installed service.
Information 21.01.2013 18:59:16 Puppet 1 None
/Stage[main]/Nagios::Client/Package[NSClientpp]/ensure:
created
Information 21.01.2013 18:59:15 MsiInstaller 1042 None Ending a Windows
Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client
Process Id: 10316.
Information 21.01.2013 18:59:15 MsiInstaller 1035 None Windows Installer
reconfigured the product. Product Name: NSClient++ (x64). Product Version:
0.3.9.328. Product Language: 1033. Reconfiguration success or error status:
0.
Information 21.01.2013 18:59:15 MsiInstaller 11728 None Product: NSClient++
(x64) -- Configuration completed successfully.
Information 21.01.2013 18:59:13 MsiInstaller 1040 None Beginning a Windows
Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client
Process Id: 10316.
Information 21.01.2013 18:29:06 Puppet 1 None Finished catalog run in 4.30
seconds
Error 21.01.2013 18:29:05 Puppet 3 None
/Stage[main]/Nagios::Client/Service[NSClientpp]:
Could not evaluate: Cannot get status of NSClientpp, error was: The
specified service does not exist as an installed service.
Information 21.01.2013 18:29:05 Puppet 1 None
/Stage[main]/Nagios::Client/Package[NSClientpp]/ensure:
created
Information 21.01.2013 18:29:05 MsiInstaller 1042 None Ending a Windows
Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client
Process Id: 14800.
Information 21.01.2013 18:29:05 MsiInstaller 1035 None Windows Installer
reconfigured the product. Product Name: NSClient++ (x64). Product Version:
0.3.9.328. Product Language: 1033. Reconfiguration success or error status:
0.
Information 21.01.2013 18:29:05 MsiInstaller 11728 None Product: NSClient++
(x64) -- Configuration completed successfully.
Information 21.01.2013 18:29:03 MsiInstaller 1040 None Beginning a Windows
Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client
Process Id: 14800.
Information 21.01.2013 17:59:05 Puppet 1 None Finished catalog run in 6.20
seconds
Error 21.01.2013 17:59:04 Puppet 3 None
/Stage[main]/Nagios::Client/Service[NSClientpp]:
Could not evaluate: Cannot get status of NSClientpp, error was: The
specified service does not exist as an installed service.
Information 21.01.2013 17:59:04 Puppet 1 None
/Stage[main]/Nagios::Client/Package[NSClientpp]/ensure:
created
Information 21.01.2013 17:59:03 MsiInstaller 1042 None Ending a Windows
Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client
Process Id: 10944.
Information 21.01.2013 17:59:03 MsiInstaller 1035 None Windows Installer
reconfigured the product. Product Name: NSClient++ (x64). Product Version:
0.3.9.328. Product Language: 1033. Reconfiguration success or error status:
0.
Information 21.01.2013 17:59:03 MsiInstaller 11728 None Product: NSClient++
(x64) -- Configuration completed successfully.
Information 21.01.2013 17:59:00 MsiInstaller 1040 None Beginning a Windows
Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client
Process Id: 10944.
Information 21.01.2013 17:57:34 Puppet 1 None Finished catalog run in 16.76
seconds
Information 21.01.2013 17:57:34 Puppet 1 None
/Stage[main]/Nagios::Client/Service[NSClientpp]:
Triggered ''refresh'' from 5 events
Information 21.01.2013 17:57:28 Puppet 1 None
/Stage[main]/Nagios::Client/Service[NSClientpp]/ensure:
ensure changed ''stopped'' to ''running''
Information 21.01.2013 17:57:25 Puppet 1 None
/Stage[main]/Nagios::Client/File[c:/local/nsclient/boot.ini]:
Scheduling refresh of Service[NSClientpp]
Information 21.01.2013 17:57:25 Puppet 1 None
/Stage[main]/Nagios::Client/File[c:/local/nsclient/boot.ini]/ensure:
created
Information 21.01.2013 17:57:25 Puppet 1 None
/Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]:
Scheduling refresh of Service[NSClientpp]
Information 21.01.2013 17:57:25 Puppet 1 None
/Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]:
Scheduling refresh of Service[NSClientpp]
Information 21.01.2013 17:57:25 Puppet 1 None
/Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]:
Scheduling refresh of Service[NSClientpp]
Information 21.01.2013 17:57:25 Puppet 1 None
/Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]:
Scheduling refresh of Service[NSClientpp]
Information 21.01.2013 17:57:25 Puppet 1 None
/Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]/mode:
mode changed ''2000770'' to ''0770''
Information 21.01.2013 17:57:25 Puppet 1 None
/Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]/group:
group changed ''NT AUTHORITY\SYSTEM'' to
''BUILTIN\Administrators''
Information 21.01.2013 17:57:25 Puppet 1 None
/Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]/owner:
owner changed ''NT AUTHORITY\SYSTEM'' to
''CED\Administrator''
Information 21.01.2013 17:57:25 Puppet 1 None
/Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]/content:
content changed ''{md5}cdf48ac49d61099bd6051f98016c419d'' to
''{md5}c4e0cb5190d2a5ac2cfcf1520701f1c8''
Information 21.01.2013 17:57:25 Puppet 1 None
/Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]:
Filebucketed c:/local/nsclient/nsc.ini to puppet with sum
cdf48ac49d61099bd6051f98016c419d
Information 21.01.2013 17:57:25 Puppet 1 None FileBucket adding
{md5}cdf48ac49d61099bd6051f98016c419d
Information 21.01.2013 17:57:24 Puppet 1 None
/Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]/content:
Information 21.01.2013 17:57:24 Puppet 1 None
/Stage[main]/Nagios::Client/Package[NSClientpp]/ensure:
created
Information 21.01.2013 17:57:24 MsiInstaller 1042 None Ending a Windows
Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client
Process Id: 9252.
Information 21.01.2013 17:57:24 MsiInstaller 1033 None Windows Installer
installed the product. Product Name: NSClient++ (x64). Product Version:
0.3.9.328. Product Language: 1033. Installation success or error status: 0.
Information 21.01.2013 17:57:24 MsiInstaller 11707 None Product: NSClient++
(x64) -- Installation completed successfully.
Information 21.01.2013 17:57:19 MsiInstaller 1040 None Beginning a Windows
Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client
Process Id: 9252.
Information 21.01.2013 17:57:18 Puppet 1 None Applying configuration
version ''1358787434''
Information 21.01.2013 17:57:17 Puppet 1 None Caching catalog for
ced.example.com
Information 21.01.2013 17:57:09 Puppet 1 None Loading facts in
C:/ProgramData/PuppetLabs/puppet/var/lib/facter/root_home.rb
Information 21.01.2013 17:57:09 Puppet 1 None Loading facts in
C:/ProgramData/PuppetLabs/puppet/var/lib/facter/puppet_vardir.rb
Information 21.01.2013 17:57:09 Puppet 1 None Loading facts in
C:/ProgramData/PuppetLabs/puppet/var/lib/facter/facter_dot_d.rb
Information 21.01.2013 17:57:00 Puppet 1 None Retrieving plugin
It look like that the puppet msi package provider didn''t recognize an
already installed package. I''ve tested the manifest on W2K3 and W2K8
with
the same result. Puppet agent is version 3.0.2. Any ideas?
Regards, Thomas
--
Linux ... enjoy the ride!
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
On Jan 21, 2013, at 10:13 AM, Thomas Bendler <thomas.bendler@gmail.com> wrote:> Hi @all, > > I still have a problem with Puppet in conjunction with Windows. My goal in the first step is to deploy Nagios agents on Windows servers. Therefore I extended my current class with a Windows specific part: > > # Class: nagios::client > # [...] > # > class monitor::nagios::client inherits monitor::params { > [...] > $windows = $::operatingsystem ? { > windows => true, > default => false > } > [...] > if $windows { > file { > ''c:/local/source'': > ensure => directory, > mode => 0770, > owner => ''Administrator'', > group => ''Administrators''; > > ''c:/local/source/NSClient++-0.3.9-x64.msi'': > ensure => present, > mode => 0770, > owner => ''Administrator'', > group => ''Administrators'', > require => File[''c:/local/source''], > path => $::operatingsystem ? { > default => ''c:/local/source/NSClient++-0.3.9-x64.msi'' > }, > source => ''puppet:///modules/nagios/client/NSClient++-0.3.9-x64.msi''; > > ''c:/local/nsclient/boot.ini'': > ensure => present, > mode => 0770, > owner => ''Administrator'', > group => ''Administrators'', > require => Package[''NSClientpp''], > notify => Service[''NSClientpp''], > path => $::operatingsystem ? { > default => ''c:/local/nsclient/boot.ini'' > }, > content => template(''nagios/client/boot.ini.erb''); > > ''c:/local/nsclient/nsc.ini'': > ensure => present, > mode => 0770, > owner => ''Administrator'', > group => ''Administrators'', > require => Package[''NSClientpp''], > notify => Service[''NSClientpp''], > path => $::operatingsystem ? { > default => ''c:/local/nsclient/nsc.ini'' > }, > content => template(''nagios/client/nsc.ini.erb''); > } > > package { ''NSClientpp'': > ensure => installed, > provider => ''windows'', > source => ''c:\local\source\NSClient++-0.3.9-x64.msi'', > install_options => [ > { > ''INSTALLLOCATION'' => ''c:\local\nsclient'' > } > ], > require => File[''c:/local/source/NSClient++-0.3.9-x64.msi'']; > } > > service { ''NSClientpp'': > ensure => ''running'', > name => $::operatingsystem ? { > default => ''NSClientpp'' > }, > enable => true, > require => Package[''NSClientpp'']; > } > } > } > > So far, so good. The first time I run the manifest, the Nagios client is downloaded from the Puppet Server and stored localy. The local msi get installed on the server, the configuration is deployed and the service is up and running. Unfortunately, if I try to run the manifest again, the package provider try to install the client again and the service is deleted from the service list: > > Level Date and Time Source Event ID Task Category > Information 21.01.2013 18:59:16 Puppet 1 None Finished catalog run in 5.59 seconds > Error 21.01.2013 18:59:16 Puppet 3 None /Stage[main]/Nagios::Client/Service[NSClientpp]: Could not evaluate: Cannot get status of NSClientpp, error was: The specified service does not exist as an installed service. > Information 21.01.2013 18:59:16 Puppet 1 None /Stage[main]/Nagios::Client/Package[NSClientpp]/ensure: created > Information 21.01.2013 18:59:15 MsiInstaller 1042 None Ending a Windows Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client Process Id: 10316. > Information 21.01.2013 18:59:15 MsiInstaller 1035 None Windows Installer reconfigured the product. Product Name: NSClient++ (x64). Product Version: 0.3.9.328. Product Language: 1033. Reconfiguration success or error status: 0. > Information 21.01.2013 18:59:15 MsiInstaller 11728 None Product: NSClient++ (x64) -- Configuration completed successfully. > Information 21.01.2013 18:59:13 MsiInstaller 1040 None Beginning a Windows Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client Process Id: 10316. > Information 21.01.2013 18:29:06 Puppet 1 None Finished catalog run in 4.30 seconds > Error 21.01.2013 18:29:05 Puppet 3 None /Stage[main]/Nagios::Client/Service[NSClientpp]: Could not evaluate: Cannot get status of NSClientpp, error was: The specified service does not exist as an installed service. > Information 21.01.2013 18:29:05 Puppet 1 None /Stage[main]/Nagios::Client/Package[NSClientpp]/ensure: created > Information 21.01.2013 18:29:05 MsiInstaller 1042 None Ending a Windows Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client Process Id: 14800. > Information 21.01.2013 18:29:05 MsiInstaller 1035 None Windows Installer reconfigured the product. Product Name: NSClient++ (x64). Product Version: 0.3.9.328. Product Language: 1033. Reconfiguration success or error status: 0. > Information 21.01.2013 18:29:05 MsiInstaller 11728 None Product: NSClient++ (x64) -- Configuration completed successfully. > Information 21.01.2013 18:29:03 MsiInstaller 1040 None Beginning a Windows Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client Process Id: 14800. > Information 21.01.2013 17:59:05 Puppet 1 None Finished catalog run in 6.20 seconds > Error 21.01.2013 17:59:04 Puppet 3 None /Stage[main]/Nagios::Client/Service[NSClientpp]: Could not evaluate: Cannot get status of NSClientpp, error was: The specified service does not exist as an installed service. > Information 21.01.2013 17:59:04 Puppet 1 None /Stage[main]/Nagios::Client/Package[NSClientpp]/ensure: created > Information 21.01.2013 17:59:03 MsiInstaller 1042 None Ending a Windows Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client Process Id: 10944. > Information 21.01.2013 17:59:03 MsiInstaller 1035 None Windows Installer reconfigured the product. Product Name: NSClient++ (x64). Product Version: 0.3.9.328. Product Language: 1033. Reconfiguration success or error status: 0. > Information 21.01.2013 17:59:03 MsiInstaller 11728 None Product: NSClient++ (x64) -- Configuration completed successfully. > Information 21.01.2013 17:59:00 MsiInstaller 1040 None Beginning a Windows Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client Process Id: 10944. > Information 21.01.2013 17:57:34 Puppet 1 None Finished catalog run in 16.76 seconds > Information 21.01.2013 17:57:34 Puppet 1 None /Stage[main]/Nagios::Client/Service[NSClientpp]: Triggered ''refresh'' from 5 events > Information 21.01.2013 17:57:28 Puppet 1 None /Stage[main]/Nagios::Client/Service[NSClientpp]/ensure: ensure changed ''stopped'' to ''running'' > Information 21.01.2013 17:57:25 Puppet 1 None /Stage[main]/Nagios::Client/File[c:/local/nsclient/boot.ini]: Scheduling refresh of Service[NSClientpp] > Information 21.01.2013 17:57:25 Puppet 1 None /Stage[main]/Nagios::Client/File[c:/local/nsclient/boot.ini]/ensure: created > Information 21.01.2013 17:57:25 Puppet 1 None /Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]: Scheduling refresh of Service[NSClientpp] > Information 21.01.2013 17:57:25 Puppet 1 None /Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]: Scheduling refresh of Service[NSClientpp] > Information 21.01.2013 17:57:25 Puppet 1 None /Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]: Scheduling refresh of Service[NSClientpp] > Information 21.01.2013 17:57:25 Puppet 1 None /Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]: Scheduling refresh of Service[NSClientpp] > Information 21.01.2013 17:57:25 Puppet 1 None /Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]/mode: mode changed ''2000770'' to ''0770'' > Information 21.01.2013 17:57:25 Puppet 1 None /Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]/group: group changed ''NT AUTHORITY\SYSTEM'' to ''BUILTIN\Administrators'' > Information 21.01.2013 17:57:25 Puppet 1 None /Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]/owner: owner changed ''NT AUTHORITY\SYSTEM'' to ''CED\Administrator'' > Information 21.01.2013 17:57:25 Puppet 1 None /Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]/content: content changed ''{md5}cdf48ac49d61099bd6051f98016c419d'' to ''{md5}c4e0cb5190d2a5ac2cfcf1520701f1c8'' > Information 21.01.2013 17:57:25 Puppet 1 None /Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]: Filebucketed c:/local/nsclient/nsc.ini to puppet with sum cdf48ac49d61099bd6051f98016c419d > Information 21.01.2013 17:57:25 Puppet 1 None FileBucket adding {md5}cdf48ac49d61099bd6051f98016c419d > Information 21.01.2013 17:57:24 Puppet 1 None /Stage[main]/Nagios::Client/File[c:/local/nsclient/nsc.ini]/content: > > Information 21.01.2013 17:57:24 Puppet 1 None /Stage[main]/Nagios::Client/Package[NSClientpp]/ensure: created > Information 21.01.2013 17:57:24 MsiInstaller 1042 None Ending a Windows Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client Process Id: 9252. > Information 21.01.2013 17:57:24 MsiInstaller 1033 None Windows Installer installed the product. Product Name: NSClient++ (x64). Product Version: 0.3.9.328. Product Language: 1033. Installation success or error status: 0. > Information 21.01.2013 17:57:24 MsiInstaller 11707 None Product: NSClient++ (x64) -- Installation completed successfully. > Information 21.01.2013 17:57:19 MsiInstaller 1040 None Beginning a Windows Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. Client Process Id: 9252. > Information 21.01.2013 17:57:18 Puppet 1 None Applying configuration version ''1358787434'' > Information 21.01.2013 17:57:17 Puppet 1 None Caching catalog for ced.example.com > Information 21.01.2013 17:57:09 Puppet 1 None Loading facts in C:/ProgramData/PuppetLabs/puppet/var/lib/facter/root_home.rb > Information 21.01.2013 17:57:09 Puppet 1 None Loading facts in C:/ProgramData/PuppetLabs/puppet/var/lib/facter/puppet_vardir.rb > Information 21.01.2013 17:57:09 Puppet 1 None Loading facts in C:/ProgramData/PuppetLabs/puppet/var/lib/facter/facter_dot_d.rb > Information 21.01.2013 17:57:00 Puppet 1 None Retrieving plugin > > It look like that the puppet msi package provider didn''t recognize an already installed package. I''ve tested the manifest on W2K3 and W2K8 with the same result. Puppet agent is version 3.0.2. Any ideas? > > Regards, Thomas > -- > Linux ... enjoy the ride! > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.The name of the package in your manifest> package { ''NSClientpp'':needs to match the name that is displayed in Add/Remove Programs. Josh -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
2013/1/21 Josh Cooper <josh@puppetlabs.com>> [...] > The name of the package in your manifest > > package { ''NSClientpp'': > > needs to match the name that is displayed in Add/Remove Programs. >Life could be so easy ... ;) Now it''s working as expected, thanks for the help! Regards, Thomas -- Linux ... enjoy the ride! -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.