Issue with puppet windows

180 views
Skip to first unread message

mparrad

unread,
Mar 30, 2012, 3:07:14 PM3/30/12
to puppet...@googlegroups.com
Hi guys, I'm trying to create my module to install splunk forwarder on windows boxes, I have this init.pp file on my module manifests:

class splunk-mp()
{

file {'D:\Install':
        ensure => directory,
        mode => 0777,
        }

file {'D:\Install\Apps':
        ensure => directory,
        mode => 0777,
        source => 'puppet:///modules/splunk-mp/Apps',
        recurse => true,
        }

package {"Universal Forwarder":
    source => "d:\\Install\\Apps\\splunkforwarder-4.3-115073-x64-release.msi",
    ensure => installed,
    install_options => {
        "AGREETOLICENSE"         => 'Yes',
        "RECEIVING_INDEXER"      => "192.168.10.13:9997",
        "LAUNCHSPLUNK"           => "1",
        "SERVICESTARTTYPE"       => "auto",
        "WINEVENTLOG_APP_ENABLE" => "1",
        "WINEVENTLOG_SEC_ENABLE" => "1",
        "WINEVENTLOG_SYS_ENABLE" => "1",
        "WINEVENTLOG_FWD_ENABLE" => "1",
        "WINEVENTLOG_SET_ENABLE" => "1",
        "ENABLEADMON"            => "1",
        },
    require => File['D:\Install\Apps'],
    }

  service {"SplunkForwarder":
    ensure  => running,
    enable  => true,
    require => Package['Universal Forwarder'],
  }
}

This works fine the first time, and then never again works, I'm thinking the case somebody by error uninstall splunk forwarder on the windows box.

the second time after I uninstalled splunk forwarder and run puppet agent again, I got this message:

C:\Users\Administrator>puppet agent --test
notice: Ignoring --listen on onetime run
info: Retrieving plugin
info: Caching catalog for cscltest01.office.com
info: Applying configuration version '1333133419'
err: /Stage[main]/Splunk-mp/Service[SplunkForwarder]: Could not evaluate: Cannot get status of SplunkForwarder, error was: The specified service does not exist as an installed service.
notice: Finished catalog run in 2.05 seconds
notice: /File[C:/ProgramData/PuppetLabs/puppet/var/state/last_run_summary.yaml]/content:


Could you tell what it's wrong on here?

Regards..

Josh Cooper

unread,
Apr 2, 2012, 2:30:13 PM4/2/12
to puppet...@googlegroups.com
Hi Marco,

Did you uninstall splunk forwarder through add/remove programs? If so, then this is https://projects.puppetlabs.com/issues/11868. Puppet doesn't know if the program is uninstalled out from underneath it.

C:\Users\Administrator>puppet agent --test
notice: Ignoring --listen on onetime run
info: Retrieving plugin
info: Caching catalog for cscltest01.office.com
info: Applying configuration version '1333133419'
err: /Stage[main]/Splunk-mp/Service[SplunkForwarder]: Could not evaluate: Cannot get status of SplunkForwarder, error was: The specified service does not exist as an installed service.
notice: Finished catalog run in 2.05 seconds
notice: /File[C:/ProgramData/PuppetLabs/puppet/var/state/last_run_summary.yaml]/content:

If this wasn't removed through add/remove programs, can you run with --test --debug --trace?

Thanks,
Josh
--
Josh Cooper
Developer, Puppet Labs

Marco Parra D.

unread,
Apr 2, 2012, 4:17:59 PM4/2/12
to puppet...@googlegroups.com
HI Josh,

The program was uninstalled using Add /remove Feature, I found the file C:\ProgramData\PuppetLabs\puppet\var\db\package\msi\Universal Forwarder.yml on the windows agent side, when I removed the puppet agent install again the package perfect...

I'm thinking in the case that a user by error removes the application or package from the box, I testing If puppet can reinstall if the package is missing...  Is it possible do something like that using puppet?... or I must use another way to fix possible "uninstall" from users?...

Thank you again for your help...
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Josh Cooper

unread,
Apr 2, 2012, 5:24:48 PM4/2/12
to puppet...@googlegroups.com
Hi Marco,

On Mon, Apr 2, 2012 at 1:17 PM, Marco Parra D. <marco....@gmail.com> wrote:
HI Josh,

The program was uninstalled using Add /remove Feature, I found the file C:\ProgramData\PuppetLabs\puppet\var\db\package\msi\Universal Forwarder.yml on the windows agent side, when I removed the puppet agent install again the package perfect...

I'm thinking in the case that a user by error removes the application or package from the box, I testing If puppet can reinstall if the package is missing...  Is it possible do something like that using puppet?... or I must use another way to fix possible "uninstall" from users?...

Thank you again for your help...

You could rewrite the msi package provider to use the Windows Installer Automation interfaces, which will accurately tell you about the state of installed MSI's. I have more information here[1]. We'd gladly accept pull requests. Otherwise, it's something we hope to fix "soon".

Josh 

Marco Parra D.

unread,
Apr 3, 2012, 9:55:52 AM4/3/12
to puppet...@googlegroups.com
Hi Josh, I'll check that link,

Thank you again for your help...

Regards...
Reply all
Reply to author
Forward
0 new messages