File copy on puppet windows failed!

985 views
Skip to first unread message

mparrad

unread,
Mar 29, 2012, 9:01:55 AM3/29/12
to puppet...@googlegroups.com
Hi guys, I'm trying to use puppet to run and install splunk on a Windows Box, I have created a module called splunk, and I try to get the powershell script and the files from the puppet master, everything is almost right but the file with the msi package couldn't copied to the windows box, What am I doing wrong?, could you help me please? Is it possible? copying files from the master to a windows client box?...

This is my module init.pp file:

class splunk()
{
file {'D:\Powershell-Scripts':
        ensure => directory,
        mode => 0777,
        }

file {'D:\Powershell-Scripts\libs':
        ensure => directory,
        mode => 0777,
        }

file {'D:\Powershell-Scripts\Apps':
        ensure => directory,
        mode => 0777,
        }

file {"D:/Powershell-Scripts/install-splunkforwarder.ps1":
        ensure => 'file',
        content => template("/etc/puppet/modules/splunk/templates/install-splunkforwarder.ps1"),
}

file {"D:/Powershell-Scripts/libs/MainFunctions.ps1":
        ensure => 'file',
        content => template("/etc/puppet/modules/splunk/templates/libs/MainFunctions.ps1"),
}


And this is what I got on windows puppet agent when I ran:

C:\Users\Administrator>puppet agent --test
notice: Ignoring --listen on onetime run
info: Retrieving plugin
info: Caching catalog for cscltest01.office.comscore.com
info: Applying configuration version '1333025700'
err: /Stage[main]/Splunk/File[D:/Powershell-Scripts/Apps/splunkforwarder-4.3-115073-x64-release.msi]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/splunk/files/splunkforwarder-4.3-115073-x64-release.msi at /etc/puppet/modules/splunk/manifests/init.pp:31
notice: Finished catalog run in 0.33 seconds
notice: /File[C:/ProgramData/PuppetLabs/puppet/var/state/last_run_summary.yaml]/content:

Regards.

mparrad

unread,
Mar 29, 2012, 9:34:38 AM3/29/12
to puppet...@googlegroups.com
Hi guys, I check my fileserver.conf file, and I see that /etc/puppet/files was allowed to serve files, and also modules,

I tried changing my init.pp file to from this:

file {"D:/Powershell-Scripts/Apps/splunkforwarder-4.3-115073-x64-release.msi":
        mode => 0777,
        source => 'puppet:///modules/splunk/files/splunkforwarder-4.3-115073-x64-release.msi',
}

to this, and this works,
file {"D:/Powershell-Scripts/Apps/splunkforwarder-4.3-115073-x64-release.msi":
        mode => 0777,
        source => 'puppet:///files/splunkforwarder-4.3-115073-x64-release.msi',
}

What is missing to fileserver works with modules directories?, I want to have a order on my modules and his files,....

this is my fileserver.conf:

[files]
   path /etc/puppet/files
   allow *

[modules]
   allow *

[plugins]
   allow *

Regards...

Josh Cooper

unread,
Mar 29, 2012, 1:29:00 PM3/29/12
to puppet...@googlegroups.com
Hi Marco,

On Thu, Mar 29, 2012 at 6:34 AM, mparrad <marco....@gmail.com> wrote:
Hi guys, I check my fileserver.conf file, and I see that /etc/puppet/files was allowed to serve files, and also modules,

I tried changing my init.pp file to from this:

file {"D:/Powershell-Scripts/Apps/splunkforwarder-4.3-115073-x64-release.msi":
        mode => 0777,
        source => 'puppet:///modules/splunk/files/splunkforwarder-4.3-115073-x64-release.msi',
}


This should be:

   source => 'puppet:///modules/splunk/splunkforwarder-4.3-115073-x64-release.msi',

Note there's no 'files' component in the URI

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/sEiaIEQxNeYJ.

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.


Also I recommend checking out Dan Hogland's splunk module on the forge: http://forge.puppetlabs.com/dhogland/splunk

Josh

--
Josh Cooper
Developer, Puppet Labs

Josh Cooper

unread,
Mar 29, 2012, 1:40:41 PM3/29/12
to puppet...@googlegroups.com
Hi Marco,

On Thu, Mar 29, 2012 at 10:29 AM, Josh Cooper <jo...@puppetlabs.com> wrote:
Hi Marco,

On Thu, Mar 29, 2012 at 6:34 AM, mparrad <marco....@gmail.com> wrote:
Hi guys, I check my fileserver.conf file, and I see that /etc/puppet/files was allowed to serve files, and also modules,

I tried changing my init.pp file to from this:

file {"D:/Powershell-Scripts/Apps/splunkforwarder-4.3-115073-x64-release.msi":
        mode => 0777,
        source => 'puppet:///modules/splunk/files/splunkforwarder-4.3-115073-x64-release.msi',
}


This should be:

   source => 'puppet:///modules/splunk/splunkforwarder-4.3-115073-x64-release.msi',

Note there's no 'files' component in the URI

Marco Parra D.

unread,
Mar 29, 2012, 1:47:39 PM3/29/12
to puppet...@googlegroups.com
Hi Josh,
I re-read this page, and then I saw my mistake....

http://askubuntu.com/questions/61080/how-to-copy-file-to-all-clients-using-puppet

Thank you josh for your answer...!

I have another question, Is it possible to copy several files at once?, for example, *.msi files to the agent?

or can I copy all the files that I put on modules/sample1/files?..

Or always I have to declare each file or binarie on /etc/puppet/files or /etc/puppet/modules/sample1/files?

Regards
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.

Nan Liu

unread,
Mar 29, 2012, 1:52:49 PM3/29/12
to puppet...@googlegroups.com
On Thu, Mar 29, 2012 at 10:47 AM, Marco Parra D.
<marco....@gmail.com> wrote:
> Hi Josh,
> I re-read this page, and then I saw my mistake....
>
> http://askubuntu.com/questions/61080/how-to-copy-file-to-all-clients-using-puppet
>
> Thank you josh for your answer...!
>
> I have another question, Is it possible to copy several files at once?, for
> example, *.msi files to the agent?
>
> or can I copy all the files that I put on modules/sample1/files?..
>
> Or always I have to declare each file or binarie on /etc/puppet/files or
> /etc/puppet/modules/sample1/files?

You can use recurse => true to copy a directory.

Nan

Marco Parra D.

unread,
Mar 29, 2012, 2:07:21 PM3/29/12
to puppet...@googlegroups.com
Thank you so much.. Nan... I'll try this..!

Regards..

Reply all
Reply to author
Forward
0 new messages