Search code examples
puppetsplunk

Trouble Using Puppet Forge Module example42/splunk


I want to use https://forge.puppetlabs.com/example42/splunk to setup splunk on some of my systems.

So on my puppet master I did puppet module install example42-splunk.

I use the PE console so I added the class splunk and associated splunk with a group that has one of my nodes, my-mongo-1.

I logon to my-mongo-1 and execute ...

    [root@my-mongo-1 ~]# puppet agent -t
    ...
    Info: Caching catalog for my-mongo-1
    Info: Applying configuration version '1417030622'
    Notice: /Stage[main]/Splunk/Package[splunk]/ensure: created
    Notice: /Stage[main]/Splunk/Exec[splunk_create_service]/returns: executed successfully
    Notice: /Stage[main]/Splunk/File[splunk_change_admin_password]/ensure: created
    Info: /Stage[main]/Splunk/File[splunk_change_admin_password]: Scheduling refresh of Exec[splunk_change_admin_password]
    Notice: /Stage[main]/Splunk/Service[splunk]/ensure: ensure changed 'stopped' to 'running'
    Info: /Stage[main]/Splunk/Service[splunk]: Unscheduling refresh on Service[splunk]
    Notice: /Stage[main]/Splunk/Exec[splunk_change_admin_password]/returns: Could not look up HOME variable.  Auth tokens cannot be cached.
    Notice: /Stage[main]/Splunk/Exec[splunk_change_admin_password]/returns:
    Notice: /Stage[main]/Splunk/Exec[splunk_change_admin_password]/returns:  In handler 'users': The password cannot be set to the default password.
    Error: /Stage[main]/Splunk/Exec[splunk_change_admin_password]: Failed to call refresh: /opt/splunkforwarder/bin/puppet_change_admin_password returned 22 instead of one of [0]
    Error: /Stage[main]/Splunk/Exec[splunk_change_admin_password]: /opt/splunkforwarder/bin/puppet_change_admin_password returned 22 instead of one of [0]
    Notice: Finished catalog run in 11.03 seconds

So what am I doing wrong here?

Why do I get the Could not look up HOME variable. Auth tokens cannot be cached. error?


Solution

  • I saw you asked this on Ask Puppet, and gave it a quick test in Vagrant, and there are two solutions:

    1) Give a different password for Splunk in Puppet (as it's complaining about using the default password)

    class { "splunk":
      install => "server",
      admin_password => 'n3wP4assw0rd',
    }
    

    2) Upgrade the module to a newer version that doesn't have this issue:

    puppet module upgrade example42-splunk --force