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. -- 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/-/IcMoISXXqyAJ. 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.
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... On Thursday, March 29, 2012 10:01:55 AM UTC-3, mparrad wrote:> > 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. >-- 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-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
2012-Mar-29 17:29 UTC
Re: [Puppet Users] Re: File copy on puppet windows failed!
Hi Marco, On Thu, Mar 29, 2012 at 6:34 AM, mparrad <marco.parra.d@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 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... > > > > On Thursday, March 29, 2012 10:01:55 AM UTC-3, mparrad wrote: >> >> 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. >> > -- > 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-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. >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 -- 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
2012-Mar-29 17:40 UTC
Re: [Puppet Users] Re: File copy on puppet windows failed!
Hi Marco, On Thu, Mar 29, 2012 at 10:29 AM, Josh Cooper <josh@puppetlabs.com> wrote:> Hi Marco, > > On Thu, Mar 29, 2012 at 6:34 AM, mparrad <marco.parra.d@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 >See also http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html#files HTH, 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.
Marco Parra D.
2012-Mar-29 17:47 UTC
Re: [Puppet Users] Re: File copy on puppet windows failed!
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 On 29-03-2012 14:40, Josh Cooper wrote:> Hi Marco, > > On Thu, Mar 29, 2012 at 10:29 AM, Josh Cooper <josh@puppetlabs.com > <mailto:josh@puppetlabs.com>> wrote: > > Hi Marco, > > On Thu, Mar 29, 2012 at 6:34 AM, mparrad <marco.parra.d@gmail.com > <mailto:marco.parra.d@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 > > > See also > http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html#files > > HTH, > 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.-- 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 Thu, Mar 29, 2012 at 10:47 AM, Marco Parra D. <marco.parra.d@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 -- 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.
Marco Parra D.
2012-Mar-29 18:07 UTC
Re: [Puppet Users] Re: File copy on puppet windows failed!
Thank you so much.. Nan... I''ll try this..! Regards.. On 29-03-2012 14:52, Nan Liu wrote:> On Thu, Mar 29, 2012 at 10:47 AM, Marco Parra D. > <marco.parra.d@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 >-- 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.