FAQ
Hi @all,

does anyone manage the NSClient++ deployment with puppet? I have the
strange behavior that I can distribute the installation package to the
target server and install the package with the MSI provider. The relevant
code is here:

if $windows {
file {
"c:/local/source":
ensure => directory, mode => 0770,
owner => "Administrators", group => "Administrators";

"c:/local/source/NSClient++-0.3.9-x64.msi":
ensure => present, mode => 0660,
owner => "Administrators", group => "Administrators",
require => File["c:/local/source"],
path => $::operatingsystem ? { default =>
"c:/local/source/NSClient++-0.3.9-x64.msi" },
source => "puppet:///modules/monitor/nagios/NSClient++-0.3.9-x64.msi";

"c:/local/nsclient/boot.ini":
ensure => present, mode => 0664,
owner => "Administrators", group => "SYSTEM",
require => Package["NSClientpp"],
notify => Service["NSClientpp"],
path => $::operatingsystem ? { default =>
"c:/local/nsclient/boot.ini" },
content => template("monitor/nagios/client/boot.ini.erb");

"c:/local/nsclient/nsc.ini":
ensure => present, mode => 0664,
owner => "Administrators", group => "SYSTEM",
require => Package["NSClientpp"],
notify => Service["NSClientpp"],
path => $::operatingsystem ? { default => "c:/local/nsclient/nsc.ini"
},
content => template("monitor/nagios/client/nsc.ini.erb");
}

package {
"NSClientpp":
ensure => installed,
provider => "msi",
source => 'c:\local\source\NSClient++-0.3.9-x64.msi',
install_options => {
'INSTALLLOCATION' => 'c:\local\nsclient',
'ADDLOCAL' => 'ALL',
'START_SERVICE_ON_EXIT' => '1'
};
}

service {
"NSClientpp":
name => $::operatingsystem ? { default => "NSClientpp" },
ensure => "running", enable => true,
require => Package["NSClientpp"];
}
}

Now to the strange thing, when the package is installed with the MSI
provider, the service entry from the NSClient++ disapear. When I manually
execute the installation package with option repair, it apears again ...
until the next puppet run where it disapear again. So calling the service
resource fail because of the missing service entry. The OS is a 2003SP2
x64, the puppet client has the version 2.7.19. 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.

Search Discussions

  • Josh Cooper at Oct 1, 2012 at 5:39 pm
    Hi Thomas,

    On Thu, Sep 27, 2012 at 12:59 PM, Thomas Bendler
    wrote:
    Hi @all,

    does anyone manage the NSClient++ deployment with puppet? I have the strange
    behavior that I can distribute the installation package to the target server
    and install the package with the MSI provider. The relevant code is here:

    if $windows {
    file {
    "c:/local/source":
    ensure => directory, mode => 0770,
    owner => "Administrators", group => "Administrators";

    "c:/local/source/NSClient++-0.3.9-x64.msi":
    ensure => present, mode => 0660,
    owner => "Administrators", group => "Administrators",
    require => File["c:/local/source"],
    path => $::operatingsystem ? { default =>
    "c:/local/source/NSClient++-0.3.9-x64.msi" },
    source => "puppet:///modules/monitor/nagios/NSClient++-0.3.9-x64.msi";
    This require shouldn't be necessary as the file will autorequire its
    ancestor directories.
    "c:/local/nsclient/boot.ini":
    ensure => present, mode => 0664,
    owner => "Administrators", group => "SYSTEM",
    require => Package["NSClientpp"],
    notify => Service["NSClientpp"],
    path => $::operatingsystem ? { default => "c:/local/nsclient/boot.ini"
    },
    content => template("monitor/nagios/client/boot.ini.erb");

    "c:/local/nsclient/nsc.ini":
    ensure => present, mode => 0664,
    owner => "Administrators", group => "SYSTEM",
    require => Package["NSClientpp"],
    notify => Service["NSClientpp"],
    path => $::operatingsystem ? { default => "c:/local/nsclient/nsc.ini"
    },
    content => template("monitor/nagios/client/nsc.ini.erb");
    }

    package {
    "NSClientpp":
    ensure => installed,
    provider => "msi",
    source => 'c:\local\source\NSClient++-0.3.9-x64.msi',
    install_options => {
    'INSTALLLOCATION' => 'c:\local\nsclient',
    'ADDLOCAL' => 'ALL',
    'START_SERVICE_ON_EXIT' => '1'
    };
    }

    service {
    "NSClientpp":
    name => $::operatingsystem ? { default => "NSClientpp" },
    ensure => "running", enable => true,
    require => Package["NSClientpp"];
    }
    }

    Now to the strange thing, when the package is installed with the MSI
    provider, the service entry from the NSClient++ disapear. When I manually
    execute the installation package with option repair, it apears again ...
    until the next puppet run where it disapear again. So calling the service
    resource fail because of the missing service entry. The OS is a 2003SP2 x64,
    the puppet client has the version 2.7.19. Any ideas?
    The name of the package needs to match the "DisplayName" as specified
    in the registry (and Add/Remove Programs). This used to be in the
    puppet wiki page, but I don't see it in the new documentation. I'll
    file a doc bug about this.

    For this package, it should be "NSClient++ (x64)", both in the package
    resource and the service resource that requires it.

    It appears what is occurring is that the second time puppet runs, it
    thinks the package is not installed, so it installs it again (really a
    repair). For some reason, the NSClient MSI gets confused and
    uninstalls the service during the repair.

    In any case, the second time you run puppet (with --debug), you should
    see something like:

    Debug: /Stage[main]//File[c:/local/nagios/NSClient++-0.3.9-x64.msi]/require:
    requires File[c:/local/nagios]
    Debug: /Stage[main]//Service[NSClientpp]/require: requires
    Package[NSClient++ (x64)]
    ...
    Debug: Prefetching msi resources for package
    Debug: Service[NSClientpp](provider=windows): Service NSClientpp is running
    Debug: Service[NSClientpp](provider=windows): Service NSClientpp start
    type is auto start

    But you should not see:

    Debug: Executing 'msiexec.exe /qn /norestart /i
    c:\local\nagios\NSClient++-0.3.9-x64.msi ADDLOCAL=ALL
    INSTALLLOCATION=c:\local\nsclient START_SERVICE_ON_EXIT=1'

    Josh

    --
    Josh Cooper
    Developer, Puppet Labs

    --
    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.
  • Josh Cooper at Oct 2, 2012 at 5:39 pm

    On Mon, Oct 1, 2012 at 10:39 AM, Josh Cooper wrote:
    Hi Thomas,

    On Thu, Sep 27, 2012 at 12:59 PM, Thomas Bendler
    wrote:
    Hi @all,

    does anyone manage the NSClient++ deployment with puppet? I have the strange
    behavior that I can distribute the installation package to the target server
    and install the package with the MSI provider. The relevant code is here:

    if $windows {
    file {
    "c:/local/source":
    ensure => directory, mode => 0770,
    owner => "Administrators", group => "Administrators";

    "c:/local/source/NSClient++-0.3.9-x64.msi":
    ensure => present, mode => 0660,
    owner => "Administrators", group => "Administrators",
    require => File["c:/local/source"],
    path => $::operatingsystem ? { default =>
    "c:/local/source/NSClient++-0.3.9-x64.msi" },
    source => "puppet:///modules/monitor/nagios/NSClient++-0.3.9-x64.msi";
    This require shouldn't be necessary as the file will autorequire its
    ancestor directories.
    "c:/local/nsclient/boot.ini":
    ensure => present, mode => 0664,
    owner => "Administrators", group => "SYSTEM",
    require => Package["NSClientpp"],
    notify => Service["NSClientpp"],
    path => $::operatingsystem ? { default => "c:/local/nsclient/boot.ini"
    },
    content => template("monitor/nagios/client/boot.ini.erb");

    "c:/local/nsclient/nsc.ini":
    ensure => present, mode => 0664,
    owner => "Administrators", group => "SYSTEM",
    require => Package["NSClientpp"],
    notify => Service["NSClientpp"],
    path => $::operatingsystem ? { default => "c:/local/nsclient/nsc.ini"
    },
    content => template("monitor/nagios/client/nsc.ini.erb");
    }

    package {
    "NSClientpp":
    ensure => installed,
    provider => "msi",
    source => 'c:\local\source\NSClient++-0.3.9-x64.msi',
    install_options => {
    'INSTALLLOCATION' => 'c:\local\nsclient',
    'ADDLOCAL' => 'ALL',
    'START_SERVICE_ON_EXIT' => '1'
    };
    }

    service {
    "NSClientpp":
    name => $::operatingsystem ? { default => "NSClientpp" },
    ensure => "running", enable => true,
    require => Package["NSClientpp"];
    }
    }

    Now to the strange thing, when the package is installed with the MSI
    provider, the service entry from the NSClient++ disapear. When I manually
    execute the installation package with option repair, it apears again ...
    until the next puppet run where it disapear again. So calling the service
    resource fail because of the missing service entry. The OS is a 2003SP2 x64,
    the puppet client has the version 2.7.19. Any ideas?
    The name of the package needs to match the "DisplayName" as specified
    in the registry (and Add/Remove Programs). This used to be in the
    puppet wiki page, but I don't see it in the new documentation. I'll
    file a doc bug about this.
    I submitted a pull request https://github.com/puppetlabs/puppet-docs/pull/107
    For this package, it should be "NSClient++ (x64)", both in the package
    resource and the service resource that requires it.

    It appears what is occurring is that the second time puppet runs, it
    thinks the package is not installed, so it installs it again (really a
    repair). For some reason, the NSClient MSI gets confused and
    uninstalls the service during the repair.

    In any case, the second time you run puppet (with --debug), you should
    see something like:

    Debug: /Stage[main]//File[c:/local/nagios/NSClient++-0.3.9-x64.msi]/require:
    requires File[c:/local/nagios]
    Debug: /Stage[main]//Service[NSClientpp]/require: requires
    Package[NSClient++ (x64)]
    ...
    Debug: Prefetching msi resources for package
    Debug: Service[NSClientpp](provider=windows): Service NSClientpp is running
    Debug: Service[NSClientpp](provider=windows): Service NSClientpp start
    type is auto start

    But you should not see:

    Debug: Executing 'msiexec.exe /qn /norestart /i
    c:\local\nagios\NSClient++-0.3.9-x64.msi ADDLOCAL=ALL
    INSTALLLOCATION=c:\local\nsclient START_SERVICE_ON_EXIT=1'

    Josh

    --
    Josh Cooper
    Developer, Puppet Labs
    Josh

    --
    Josh Cooper
    Developer, Puppet Labs

    --
    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.
  • Thomas Bendler at Oct 8, 2012 at 1:26 pm
    Hi Josh,

    2012/10/2 Josh Cooper <josh@puppetlabs.com>
    On Mon, Oct 1, 2012 at 10:39 AM, Josh Cooper wrote:
    [...]
    thanks for the answer and sorry for the late reply but I was on vacation. I
    will follow your recommendations as soon as possible but it won't be before
    next week (too much projects ;)).

    Reards, 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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedSep 27, '12 at 7:59p
activeOct 8, '12 at 1:26p
posts4
users2
websitepuppetlabs.com

2 users in discussion

Josh Cooper: 2 posts Thomas Bendler: 2 posts

People

Translate

site design / logo © 2022 Grokbase