Re: [Puppet Users] Help with provider inheritance of Josh Cooper's Exec PowerShell Provider
So for what it’s worth, I stopped inheriting the powershell provider and just utilized some of the code in the provider to build the powershell command method, write the file out to temp, return the native path, and call Puppet::Util::Execution.Execute() directly. Seems to achieve what I want and lets me remove all the extraneous extra parameters I don’t need. So in this case, provider inheritance wasn’t my friend. From: Jim Ficarra Sent: Thursday, January 22, 2015 6:26 PM To: puppet-users@googlegroups.com Subject: Re: [Puppet Users] Help with provider inheritance of Josh Cooper's Exec PowerShell Provider Ok – so it seems the the underlying base classes of my provider are expecting the parameters and their validations from the exec type instead of my new type – makes sense. I was able to test that theory out by adding the parameters (and in many cases copying the parameters from the exec type) being validated to my new type, but that’s not exactly what I was hoping for. I did get to the point where it’s writing out the temp ps1 file and executing, but now I have some challenges on the return output. I was trying to avoid direct execution of calling cmd.exe with powershell and re-inventing the wheel because it’s been done so well with the powershell provider, and it avoids some of the escape hell with double quotes if trying to pass them on the command line. I’m likely going about this the wrong way (e.g. going overboard) but if anyone wants to provide guidance from the realm of sanity, please feel free. From: Jim Ficarra Sent: Thursday, January 22, 2015 2:24 PM To: puppet-users@googlegroups.com Subject: [Puppet Users] Help with provider inheritance of Josh Cooper's Exec PowerShell Provider I'm as newbie as they come to both Ruby and custom provider development, so apologies if I'm missing the obvious up front. :) I want to write a custom type/provider to manage IIS Settings. I realize that there are at least 3 IIS modules in the forge already (and we are using one of them) but I am attempting to write my own because 1) I want to learn how to write custom providers and not just defined types in Puppet DSL and 2) The existing IIS modules don't hit all the granular configurations I need to manage so I have a bunch of execs I need to reign in. That said, the first type/provider I'm playing with is to simply enable and disable Logging in IIS at the server and site level. I am trying to inherit from Josh Cooper's Powershell provider because it executes PowerShell, does it well:) I sometimes see the temp powershell file being written to temp then disappear, but it seems I've hit a wall on the exists? method right out of the gate. When I do a puppet run, I get the error: Error: /Stage[main]/Test_tools/Iis_logging[TestLogging]: Could not evaluate: Invalid parameter cwd(:cwd) Any insight would be appreciated. Relevant code below. Running with --trace shows (partial stack trace): -=-=-=-=-=-=-=-=-=-=-=-=-= Error: /Stage[main]/Test_tools/Iis_logging[TestLogging]: Could not evaluate: Invalid parameter cwd(:cwd) C:/Tools/Puppet/puppet/lib/puppet/util/errors.rb:97:in `fail' C:/Tools/Puppet/puppet/lib/puppet/type.rb:618:in `[]' C:/ProgramData/PuppetLabs/puppet/var/lib/puppet/provider/iis_logging/iis_logging.rb:21:in `exists?' C:/Tools/Puppet/puppet/lib/puppet/property/ensure.rb:81:in `retrieve' C:/Tools/Puppet/puppet/lib/puppet/type.rb:1035:in `retrieve' C:/Tools/Puppet/puppet/lib/puppet/type.rb:1063:in `retrieve_resource' C:/Tools/Puppet/puppet/lib/puppet/transaction/resource_harness.rb:223:in `from_resource' C:/Tools/Puppet/puppet/lib/puppet/transaction/resource_harness.rb:19:in `evaluate' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:174:in `apply' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:187:in `eval_resource' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:117:in `call' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:117:in `block (2 levels) in evaluate' The resource would be called like this -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= iis_logging {'TestLogging': ensure = present, site = 'applicationhost' } Type I've Defined -=-=-=-=-=-=-=-=-= Puppet::Type.newtype(:iis_logging) do desc Puppet type to set the configuration of IIS Logging ensurable newparam(:site, :namevar = true) do desc ApplicationHost for server level or the name of the site munge do |value| value.downcase end end end Provider I've Defined (just showing the exists? method - that's the first hurdle) (I've defined (copied) command(:powershell) in this provider because of the lack of inheritance of the commands method, but I get the same error with or w/out it) (run method is already redefined in Josh's provider, which is inherited from the exec provider - didn't think I need to do antying else) -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Puppet::Type.type
Re: [Puppet Users] Help with provider inheritance of Josh Cooper's Exec PowerShell Provider
Ok – so it seems the the underlying base classes of my provider are expecting the parameters and their validations from the exec type instead of my new type – makes sense. I was able to test that theory out by adding the parameters (and in many cases copying the parameters from the exec type) being validated to my new type, but that’s not exactly what I was hoping for. I did get to the point where it’s writing out the temp ps1 file and executing, but now I have some challenges on the return output. I was trying to avoid direct execution of calling cmd.exe with powershell and re-inventing the wheel because it’s been done so well with the powershell provider, and it avoids some of the escape hell with double quotes if trying to pass them on the command line. I’m likely going about this the wrong way (e.g. going overboard) but if anyone wants to provide guidance from the realm of sanity, please feel free. From: Jim Ficarra Sent: Thursday, January 22, 2015 2:24 PM To: puppet-users@googlegroups.com Subject: [Puppet Users] Help with provider inheritance of Josh Cooper's Exec PowerShell Provider I'm as newbie as they come to both Ruby and custom provider development, so apologies if I'm missing the obvious up front. :) I want to write a custom type/provider to manage IIS Settings. I realize that there are at least 3 IIS modules in the forge already (and we are using one of them) but I am attempting to write my own because 1) I want to learn how to write custom providers and not just defined types in Puppet DSL and 2) The existing IIS modules don't hit all the granular configurations I need to manage so I have a bunch of execs I need to reign in. That said, the first type/provider I'm playing with is to simply enable and disable Logging in IIS at the server and site level. I am trying to inherit from Josh Cooper's Powershell provider because it executes PowerShell, does it well:) I sometimes see the temp powershell file being written to temp then disappear, but it seems I've hit a wall on the exists? method right out of the gate. When I do a puppet run, I get the error: Error: /Stage[main]/Test_tools/Iis_logging[TestLogging]: Could not evaluate: Invalid parameter cwd(:cwd) Any insight would be appreciated. Relevant code below. Running with --trace shows (partial stack trace): -=-=-=-=-=-=-=-=-=-=-=-=-= Error: /Stage[main]/Test_tools/Iis_logging[TestLogging]: Could not evaluate: Invalid parameter cwd(:cwd) C:/Tools/Puppet/puppet/lib/puppet/util/errors.rb:97:in `fail' C:/Tools/Puppet/puppet/lib/puppet/type.rb:618:in `[]' C:/ProgramData/PuppetLabs/puppet/var/lib/puppet/provider/iis_logging/iis_logging.rb:21:in `exists?' C:/Tools/Puppet/puppet/lib/puppet/property/ensure.rb:81:in `retrieve' C:/Tools/Puppet/puppet/lib/puppet/type.rb:1035:in `retrieve' C:/Tools/Puppet/puppet/lib/puppet/type.rb:1063:in `retrieve_resource' C:/Tools/Puppet/puppet/lib/puppet/transaction/resource_harness.rb:223:in `from_resource' C:/Tools/Puppet/puppet/lib/puppet/transaction/resource_harness.rb:19:in `evaluate' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:174:in `apply' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:187:in `eval_resource' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:117:in `call' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:117:in `block (2 levels) in evaluate' The resource would be called like this -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= iis_logging {'TestLogging': ensure = present, site = 'applicationhost' } Type I've Defined -=-=-=-=-=-=-=-=-= Puppet::Type.newtype(:iis_logging) do desc Puppet type to set the configuration of IIS Logging ensurable newparam(:site, :namevar = true) do desc ApplicationHost for server level or the name of the site munge do |value| value.downcase end end end Provider I've Defined (just showing the exists? method - that's the first hurdle) (I've defined (copied) command(:powershell) in this provider because of the lack of inheritance of the commands method, but I get the same error with or w/out it) (run method is already redefined in Josh's provider, which is inherited from the exec provider - didn't think I need to do antying else) -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Puppet::Type.type(:iis_logging).provide(:iis_logging, :parent = Puppet::Type.type(:exec).provider(:powershell)) do commands :powershell = if File.exists?(#{ENV['SYSTEMROOT']}\\sysnative\\WindowsPowershell\\v1.0\\powershell.exe) #{ENV['SYSTEMROOT']}\\sysnative\\WindowsPowershell\\v1.0\\powershell.exe elsif File.exists?(#{ENV['SYSTEMROOT']}\\system32\\WindowsPowershell\\v1.0\\powershell.exe) #{ENV['SYSTEMROOT']}\\system32\\WindowsPowershell\\v1.0\\powershell.exe else 'powershell.exe' end desc Uses the Exec resource's PowerShell provider to configure IIS Logging Parameters confine :operatingsystem
[Puppet Users] Help with provider inheritance of Josh Cooper's Exec PowerShell Provider
I'm as newbie as they come to both Ruby and custom provider development, so apologies if I'm missing the obvious up front. :) I want to write a custom type/provider to manage IIS Settings. I realize that there are at least 3 IIS modules in the forge already (and we are using one of them) but I am attempting to write my own because 1) I want to learn how to write custom providers and not just defined types in Puppet DSL and 2) The existing IIS modules don't hit all the granular configurations I need to manage so I have a bunch of execs I need to reign in. That said, the first type/provider I'm playing with is to simply enable and disable Logging in IIS at the server and site level. I am trying to inherit from Josh Cooper's Powershell provider because it executes PowerShell, does it well:) I sometimes see the temp powershell file being written to temp then disappear, but it seems I've hit a wall on the exists? method right out of the gate. When I do a puppet run, I get the error: Error: /Stage[main]/Test_tools/Iis_logging[TestLogging]: Could not evaluate: Invalid parameter cwd(:cwd) Any insight would be appreciated. Relevant code below. Running with --trace shows (partial stack trace): -=-=-=-=-=-=-=-=-=-=-=-=-= Error: /Stage[main]/Test_tools/Iis_logging[TestLogging]: Could not evaluate: Invalid parameter cwd(:cwd) C:/Tools/Puppet/puppet/lib/puppet/util/errors.rb:97:in `fail' C:/Tools/Puppet/puppet/lib/puppet/type.rb:618:in `[]' C:/ProgramData/PuppetLabs/puppet/var/lib/puppet/provider/iis_logging/iis_logging.rb:21:in `exists?' C:/Tools/Puppet/puppet/lib/puppet/property/ensure.rb:81:in `retrieve' C:/Tools/Puppet/puppet/lib/puppet/type.rb:1035:in `retrieve' C:/Tools/Puppet/puppet/lib/puppet/type.rb:1063:in `retrieve_resource' C:/Tools/Puppet/puppet/lib/puppet/transaction/resource_harness.rb:223:in `from_resource' C:/Tools/Puppet/puppet/lib/puppet/transaction/resource_harness.rb:19:in `evaluate' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:174:in `apply' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:187:in `eval_resource' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:117:in `call' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:117:in `block (2 levels) in evaluate' The resource would be called like this -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= iis_logging {'TestLogging': ensure = present, site = 'applicationhost' } Type I've Defined -=-=-=-=-=-=-=-=-= Puppet::Type.newtype(:iis_logging) do desc Puppet type to set the configuration of IIS Logging ensurable newparam(:site, :namevar = true) do desc ApplicationHost for server level or the name of the site munge do |value| value.downcase end end end Provider I've Defined (just showing the exists? method - that's the first hurdle) (I've defined (copied) command(:powershell) in this provider because of the lack of inheritance of the commands method, but I get the same error with or w/out it) (run method is already redefined in Josh's provider, which is inherited from the exec provider - didn't think I need to do antying else) -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Puppet::Type.type(:iis_logging).provide(:iis_logging, :parent = Puppet::Type.type(:exec).provider(:powershell)) do commands :powershell = if File.exists?(#{ENV['SYSTEMROOT']}\\sysnative\\WindowsPowershell\\v1.0\\powershell.exe) #{ENV['SYSTEMROOT']}\\sysnative\\WindowsPowershell\\v1.0\\powershell.exe elsif File.exists?(#{ENV['SYSTEMROOT']}\\system32\\WindowsPowershell\\v1.0\\powershell.exe) #{ENV['SYSTEMROOT']}\\system32\\WindowsPowershell\\v1.0\\powershell.exe else 'powershell.exe' end desc Uses the Exec resource's PowerShell provider to configure IIS Logging Parameters confine :operatingsystem = :windows def exists? check = false if resource[:site] == applicationhost pscommand = Import-Module WebAdministration;(Get-WebConfiguration /system.webServer/httpLogging -PSPath IIS:\\).dontLog -eq \$False output = run(pscommand, check) if output.downcase == true return true else return false end else pscommand = Import-Module WebAdministration;(Get-WebConfiguration /system.webServer/httpLogging -PSPath IIS:\\ -Location #{resource[:site]}).dontLog -eq \$False output = run(pscommand, check) if output.downcase == true return true else return false end end end -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/fc5c3f6f-481d-4f37-a898-ec3d504ecb23%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Best way to deploy the Puppet client to a large set of Windows servers?
In our organization, we created a chocolatey package for the puppet client hosted on our internal nuget server. We then created a powershell module that includes several tools for our environment, one of which remotely invokes the installation of chocolatey on windows systems in parallel, and another to invoke the installation of the chocolatey puppet package from our internal nuget server, also in parallel. The chocolatey package contains the majority of the MSI properties for configuration, and we leverage the installargs option to pass in the puppet environment we need to point to. The “meat” for this is just looping through a bunch of invoke-commands and running them as jobs after passing in one or more servers with a simple text file manifest. This avoids the “patch party” scenario. Of course the above depends on having WinRM configured as Rob mentioned. If you do have WinRM enabled, you can take out the chocolatey package pre-requisite as in our case (e.g. if you don’t have a nuget server setup), and then still build a simple PowerShell script to use invoke-command kick off the installation of the msi with parameters on multiple servers, as jobs, so they occur in parallel. You could have the msi hosted on a share to access during the installation. Do you have any tools such as Microsoft System Center to package and deploy? That would be another way to do this, or a myriad of other tools that can be used to deploy. For example, I’ve not used psexec for puppet, but you could try to use psexec from www.sysinternals.com to execute as well. It has an option (-c) to copy the the program to the remote system before it executes, so that can serve to ensure the MSI is available on the remote node. Note that psexec does create a windows service on the remote server – so there’s a trace left behind you may need to clean up (yuck). Hope this helps. -Jim From: Brian Morris Sent: Thursday, October 02, 2014 6:24 PM To: puppet-users@googlegroups.com Subject: Re: [Puppet Users] Best way to deploy the Puppet client to a large set of Windows servers? Thank you, Rob. I have a lot of reading to do. :) On Thu, Oct 2, 2014 at 3:12 PM, Rob Reynolds r...@puppetlabs.com wrote: On Wed, Oct 1, 2014 at 3:30 PM, Brian Morris nomadicextre...@gmail.com wrote: Hello all, There may come a need for me to perform a wide deployment of the Puppet client to Windows servers. I am curious to know how others have accomplished this. Concerns I have: - No other tools are in place that readily come to mind for pushing the client out. VCM is in play, but is difficult at best to deploy other applications with. The client could certainly be placed on a central file share, but pulling rather than pushing sounds like it will require direct Sysadmin involvement. - To ease the pain I could set the Puppet Master to auto-sign certificates for a small window of time, but am unsure if this would be worthwhile. - I can imagine a patch party where a bunch of Sysadmins each get a list of servers to go hand perform the installation on, but I am hoping for something much cleaner than this. I'm not sure yet if we have an official/recommended way of getting the agent installed. I believe we are working on making this process easier though. So now an alternative recommendation of going about it - Is WinRm configured on these servers? I'm guessing no b/c they are stock. If so you have a much easier time moving forward, but it is not configured by default. So the next option is Wmi calls. There is a really low level Wmi call you can make to Win32_Process.Create[1] that you can use to create a process to install the puppet agent if you have administrative privileges. You can do this remotely. This works with Windows OOTB. If one could connect, you could pass a command to msiexec to run the installer with a url to the agent msi. You would want to put it on a file share that all of these servers can access (or use the official download). Take a look at automated installation[2] and msi properties[3]. So you could set your call as msiexec and args /qn /i \\file\share\location\of\puppet.msi PUPPET_MASTER_SERVER=puppet.example.com You could run that command as fire and forget and wait for them to all finish up as they check in with the master. I did a little searching and found a couple of gems out there that are related to WMI[4][5]. Note: I once worked on a tool where we did something very similar to this. [1] http://msdn.microsoft.com/en-us/library/aa389388.aspx [2] https://docs.puppetlabs.com/guides/install_puppet/install_windows.html#automated-installation [3] https://docs.puppetlabs.com/guides/install_puppet/install_windows.html#msi-properties [4] https://rubygems.org/gems/ruby-wmi [5] https://rubygems.org/gems/wmi-lite -- You received this message because you are subscribed to the Google Groups Puppet
Re: [Puppet Users] windows mount points
Have you declared the folder before the file resource? Something like this: file {'c:/srv': ensure = 'directory', } file {'c:/srv/newfile': ensure= 'file', source= 'puppet:///modules/mymodule/myfile.txt', require= File['c:/srv'], } It's not clear what the source of your file is so as part of the example I arbitrarily specified it coming from the files folder from puppet. The key take-away item is to declare the folder and ensure that the file resource(s) are dependent on the folder being there regardless of your choice of chaining and ordering syntax you choose, variables, et. Hope that helps. -Jim -Original Message- From: Benjamin Priestman Sent: Monday, September 01, 2014 1:00 PM To: puppet-users@googlegroups.com Subject: [Puppet Users] windows mount points Hi, On windows hosts, I've taken to putting all my app data in c:\srv, mimicing the /srv location on Linux. Depending on the host, this may be a location on the system drive, or it is sometimes an additional disk mounted at that location. In the latter case, `puppet resource file ` shows this as a link whose target is the underlying volume. An attempt to define a file resource within this location fails with: 'Parent directory C:/srv does not exist' If I create subdirectories here by hand, the puppet run proceeds just fine. Has anyone else come across this behavior? I'm running puppet 3.4.2 at the moment. Happy to upgrade but I can't find any big reports that indicate this is a known issue. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/bc4867e4-4bf6-44a8-900c-1690512db21e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/7D69BADFB2484A869FA9439E60A6A256%40JimHPPavilionG6. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] windows mount points
whoops - disregard - I re-read and missed that the latter case was a linked location. -Original Message- From: Jim Ficarra Sent: Monday, September 01, 2014 2:59 PM To: puppet-users@googlegroups.com Subject: Re: [Puppet Users] windows mount points Have you declared the folder before the file resource? Something like this: file {'c:/srv': ensure = 'directory', } file {'c:/srv/newfile': ensure= 'file', source= 'puppet:///modules/mymodule/myfile.txt', require= File['c:/srv'], } It's not clear what the source of your file is so as part of the example I arbitrarily specified it coming from the files folder from puppet. The key take-away item is to declare the folder and ensure that the file resource(s) are dependent on the folder being there regardless of your choice of chaining and ordering syntax you choose, variables, et. Hope that helps. -Jim -Original Message- From: Benjamin Priestman Sent: Monday, September 01, 2014 1:00 PM To: puppet-users@googlegroups.com Subject: [Puppet Users] windows mount points Hi, On windows hosts, I've taken to putting all my app data in c:\srv, mimicing the /srv location on Linux. Depending on the host, this may be a location on the system drive, or it is sometimes an additional disk mounted at that location. In the latter case, `puppet resource file ` shows this as a link whose target is the underlying volume. An attempt to define a file resource within this location fails with: 'Parent directory C:/srv does not exist' If I create subdirectories here by hand, the puppet run proceeds just fine. Has anyone else come across this behavior? I'm running puppet 3.4.2 at the moment. Happy to upgrade but I can't find any big reports that indicate this is a known issue. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/bc4867e4-4bf6-44a8-900c-1690512db21e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/420E8EC5F392412FAD140B31DA3D711A%40JimHPPavilionG6. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] How can we satisfy goals of having all data in hiera and not modifying the module code?
You could setup setup the host-specific yaml as: vhost:“first.example.com” port: “80” priority:“10” docroot:“/var/www/first” Then your module: $vhost = hiera(‘vhost’) $port = hiera(‘port’) $priority = hiera(‘priority’) $docroot: = hiera(‘docroot’) apache::vhost { $vhost: port= $port, priority = $priority, docroot = $docroot, } This would allow you completely segregate the configuration from the data and not require modification of the module code unless something in the configuration changes. You could use common.yaml for configuration data that applies to all hosts. From: JeremyCampbell Sent: Monday, August 25, 2014 5:04 AM To: puppet-users@googlegroups.com Subject: [Puppet Users] How can we satisfy goals of having all data in hiera and not modifying the module code? We understand that all site specific data should be in Hiera. We also understand that modules shouldn't have to be modified when they are well designed e.g. the puppetlabs/apache module. However, how do I setup apache using this module with a virtual host without putting data into the manifest. E.g to create a vhost according to the docs we need to use: apache::vhost { 'first.example.com': port= '80', docroot = '/var/www/first', } As a define it would appear that we need to use create_resources() somewhere in the module and then create a hash in hiera e.g. apache::my_vhosts: host1: priority: 10 vhost_name: first.example.com port: 80 docroot: /var/www/first This means that we either need to put data into the manifest (e.g. first example) or to change the module code by implementing create_resources(). So how can we satisfy both goals of having all data in hiera and not modifying the module code? -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/6f9aaec5-0503-488c-b70a-30887af5b353%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/7F6002FD5CA14856A2B8F6025998126D%40JimHPPavilionG6. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] install windows package
If you mean installing a windows package (such as an MSI or EXE) – you should review the package resource type documentation https://docs.puppetlabs.com/puppet/latest/reference/resources_package_windows.html https://docs.puppetlabs.com/references/latest/type.html#package This works really well out of the box if your installer displays information in Control Panel/Installed Programs. If your installer doesn’t, you should look at using Rob Reynold’s Chocolatey packaging tool in conjunction with Josh Cooper’s Chocolatey Provider for the package resource type. -Jim From: huhm4n Sent: Monday, August 11, 2014 5:22 PM To: puppet-users@googlegroups.com Subject: [Puppet Users] install windows package is it possible to install the windows package using puppet? I know I can do it using the Powershell but I want to dry run it to ensure if it is installed first? -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/62c3ed1c-2dc4-4ac7-a605-d747de0083f8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/AA972CB808994769B2841136239CB859%40JimHPPavilionG6. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] installation of package to a different folder
Try the install_options attribute of the package type. You need to know what the install option is for the JDK itself to go to another folder, then use the install_options attribute in puppet. http://docs.puppetlabs.com/references/latest/type.html#package-attribute-install_options From: bobby38 Sent: Thursday, June 26, 2014 1:04 PM To: puppet-users@googlegroups.com Subject: [Puppet Users] installation of package to a different folder Hello All, I am trying to install jdk package to a different folder rather than the default folder. i am trying to install for instance to /operation/tools/jdk-1.7 is there anyway to do this in puppet? Thanks and regards Babak -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/fb472935-a473-42e3-bf73-fe9404da7088%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/7CD82A228E59449380028A4617A66069%40JimHPPavilionG6. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] installation of package to a different folder
You won’t find how to install the JDK on the puppet page describing the package resource. You need to first find out how you would install the JDK to an alternate path – that will be in the JDK documentation and not Puppet. Once you figure it out with the JDK you then specify the parameter in the puppet resource. I did a quick look but can’t find it on the linux platform (I’m primarily a Windows guy - maybe someone can chime in), but I believe you need to create a properties file with the options you want to set during installation, and I believe it’s the USER_INSTALL_DIR property you’ll want to set. So, find out how to do this silently first w/out puppet, and that will tell you what you need to tell puppet to install it where you want. Sorry I couldn’t be more help on finding the specific parameters on the linux platform – the ones for Windows seem easier to find. From: bobby38 Sent: Thursday, June 26, 2014 1:46 PM To: puppet-users@googlegroups.com Subject: Re: [Puppet Users] installation of package to a different folder Hi Jim, Thank you for your reply. i couldnt find anything related to JDK installation option in that page but I was thinking to do it this way ... class java_rpm::install { $version = 'jdk-7u25-linux-x64.rpm' package { $version: provider = rpm, exec {$version: install_options = ['-vh','--prefix=/operation/tools/jdk-1.7'], owner = operation, group = admin, mode = 0755, command = rpm -ivh --prefix=/operation/tools/jdk-1.7 jdk-7u25-linux-x64. rpm } source = /etc/puppetlabs/puppet/environments/development/modules/java_rpm/files/jdk-7u25-linux-x64 } Thanks, On Thursday, June 26, 2014 1:30:31 PM UTC-4, Jim Ficarra wrote: Try the install_options attribute of the package type. You need to know what the install option is for the JDK itself to go to another folder, then use the install_options attribute in puppet. http://docs.puppetlabs.com/references/latest/type.html#package-attribute-install_options From: bobby38 Sent: Thursday, June 26, 2014 1:04 PM To: puppet...@googlegroups.com Subject: [Puppet Users] installation of package to a different folder Hello All, I am trying to install jdk package to a different folder rather than the default folder. i am trying to install for instance to /operation/tools/jdk-1.7 is there anyway to do this in puppet? Thanks and regards Babak -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/fb472935-a473-42e3-bf73-fe9404da7088%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/b4d8b1cc-d999-472f-a0fc-aa9c0137e23c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/35C8105C6D464DEF99F0AF65385A8C48%40JimHPPavilionG6. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Chocolatey pre-fetch fails with Puppet - Could not prefetch package provider 'chocolatey': undefined method `each' for nil:NilClass
It was installed on our puppet master which I don't control, so I'm not 100% sure - however this issue has been identified and fixed. The issue boiled down to the PSModulePath system environment variable. It was missing a semicolon between the stock path (%SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\) and a new path I had put in earlier to point to a set of powershell modules. This got messed up in my ChocolateyUninstall.ps1 and instead of removing the ';c:\path\to\modules' I had added,the uninstall messed it up and just removed the semicolon. The puppet master admins ended up putting in some debug code in the chocolatey provider ruby code (execpipe where it fetches the list of installed chocolatey packages via the provider pre-fetch) and it dumped out a powershell error that it couldn't find split-path. The odd thing was that I could use split-path when opening up a powershell prompt while the PSModulePath was messed up. This was a bit of a tough one to crack as the underlying powershell errors were masked behind the ruby. On Mon, Jun 23, 2014 at 1:10 PM, Rob Reynolds r...@puppetlabs.com wrote: On Tue, Jun 17, 2014 at 3:55 PM, Jim Ficarra jimfica...@gmail.com wrote: Hey Rob, Thanks for the response! Yes – chocolatey version 0.9.8.23 is installed on both servers (found via choco version). They both respond to choco /?. This is a customized version that has had the install path modified and the default repository restricted to an internal Nuget repository. I can also install chocolatey packages manually on both servers – specifically this package that is failing by typing “cinst carbon”. Are you using the puppet-chocolatey module from the forge or from github? I am running puppet as a windows service and ran the service with debug/trace (sc start puppet –debug –trace) to pull the previous errors from the event log, though they were a bit segregated across event entries. It's also worth noting that there are 4 resource types ahead of the one that's failing. The 4 resourcs types (two files and two execs) are applied successfully. I ran the puppet agent –td –verbose –trace and received a lot of output, but essentially the same errors that don't appear to have any new information. The successful output shows that the 4 previous resource types ran. Included below is the start of when it begins to apply the package with the chocolatey provider: Notice: /Stage[main]/Copy_externalfacts/Exec[BuildStatusFacterFile_SetPerms]/returns: executed successfully Debug: /Stage[main]/Copy_externalfacts/Exec[BuildStatusFacterFile_SetPerms]: The container Class[Copy_externalfacts] will propagate my refresh event Debug: Class[Copy_externalfacts]: The container Stage[main] will propagate my refresh event Debug: Prefetching chocolatey resources for package Debug: Executing 'C:\Tools\Chocolatey\chocolateyInstall\chocolatey.cmd list -lo' Error: Could not prefetch package provider 'chocolatey': undefined method `each' for nil:NilClass C:/Tools/Puppet/puppet/lib/puppet/provider/package.rb:4:in `prefetch' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:277:in `prefetch' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:167:in `prefetch_if_necessary' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:67:in `block in evaluate' C:/Tools/Puppet/puppet/lib/puppet/graph/relationship_graph.rb:116:in `call' C:/Tools/Puppet/puppet/lib/puppet/graph/relationship_graph.rb:116:in `traverse' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:108:in `evaluate' C:/Tools/Puppet/puppet/lib/puppet/resource/catalog.rb:164:in `block in apply' C:/Tools/Puppet/puppet/lib/puppet/util/log.rb:149:in `with_destination' C:/Tools/Puppet/puppet/lib/puppet/transaction/report.rb:108:in `as_logging_destination' C:/Tools/Puppet/puppet/lib/puppet/resource/catalog.rb:163:in `apply' C:/Tools/Puppet/puppet/lib/puppet/configurer.rb:125:in `block in apply_catalog' C:/Tools/Puppet/puppet/lib/puppet/util.rb:161:in `block in benchmark' C:/Tools/Puppet/sys/ruby/lib/ruby/1.9.1/benchmark.rb:295:in `realtime' C:/Tools/Puppet/puppet/lib/puppet/util.rb:160:in `benchmark' C:/Tools/Puppet/puppet/lib/puppet/configurer.rb:124:in `apply_catalog' C:/Tools/Puppet/puppet/lib/puppet/configurer.rb:192:in `run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:44:in `block (4 levels) in run' C:/Tools/Puppet/puppet/lib/puppet/agent/locker.rb:20:in `lock' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:44:in `block (3 levels) in run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:114:in `with_client' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:41:in `block (2 levels) in run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:79:in `run_in_fork' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:40:in `block in run' C:/Tools/Puppet/puppet/lib/puppet/application.rb:179:in `call' C:/Tools/Puppet/puppet/lib/puppet/application.rb:179:in `controlled_run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:38:in `run' C:/Tools/Puppet/puppet
[Puppet Users] Chocolatey pre-fetch fails with Puppet - Could not prefetch package provider 'chocolatey': undefined method `each' for nil:NilClass
Chocolatey is installed as a shared module on the puppet master. Below is the specific part of the puppet code that uses the chocolatey provider to install a custom package. class install_carbon { package {'carbon': ensure = '1.7', provider = 'chocolatey', } } This class is part of a larger set of modules and classes that work together and execute completely and successfully on another host but fails on a second host with the error below. Same puppet client version (3.4.2 installed from an internal NuGet repo). Chocolatey is also customized to point to an internal repo. Any help/thoughts/insight would be appreciated. Thanks! Could not prefetch package provider 'chocolatey': undefined method `each' for nil:NilClass C:/Tools/Puppet/puppet/lib/puppet/provider/package.rb:4:in `prefetch' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:277:in `prefetch' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:167:in `prefetch_if_necessary' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:67:in `block in evaluate' C:/Tools/Puppet/puppet/lib/puppet/graph/relationship_graph.rb:116:in `call' C:/Tools/Puppet/puppet/lib/puppet/graph/relationship_graph.rb:116:in `traverse' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:108:in `evaluate' C:/Tools/Puppet/puppet/lib/puppet/resource/catalog.rb:164:in `block in apply' C:/Tools/Puppet/puppet/lib/puppet/util/log.rb:149:in `with_destination' C:/Tools/Puppet/puppet/lib/puppet/transaction/report.rb:108:in `as_logging_destination' C:/Tools/Puppet/puppet/lib/puppet/resource/catalog.rb:163:in `apply' C:/Tools/Puppet/puppet/lib/puppet/configurer.rb:125:in `block in apply_catalog' C:/Tools/Puppet/puppet/lib/puppet/util.rb:161:in `block in benchmark' C:/Tools/Puppet/sys/ruby/lib/ruby/1.9.1/benchmark.rb:295:in `realtime' C:/Tools/Puppet/puppet/lib/puppet/util.rb:160:in `benchmark' C:/Tools/Puppet/puppet/lib/puppet/configurer.rb:124:in `apply_catalog' C:/Tools/Puppet/puppet/lib/puppet/configurer.rb:192:in `run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:44:in `block (4 levels) in run' C:/Tools/Puppet/puppet/lib/puppet/agent/locker.rb:20:in `lock' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:44:in `block (3 levels) in run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:114:in `with_client' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:41:in `block (2 levels) in run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:79:in `run_in_fork' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:40:in `block in run' C:/Tools/Puppet/puppet/lib/puppet/application.rb:179:in `call' C:/Tools/Puppet/puppet/lib/puppet/application.rb:179:in `controlled_run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:38:in `run' C:/Tools/Puppet/puppet/lib/puppet/application/agent.rb:355:in `onetime' C:/Tools/Puppet/puppet/lib/puppet/application/agent.rb:321:in `run_command' C:/Tools/Puppet/puppet/lib/puppet/application.rb:364:in `block (2 levels) in run' C:/Tools/Puppet/puppet/lib/puppet/application.rb:470:in `plugin_hook' C:/Tools/Puppet/puppet/lib/puppet/application.rb:364:in `block in run' C:/Tools/Puppet/puppet/lib/puppet/util.rb:478:in `exit_on_fail' C:/Tools/Puppet/puppet/lib/puppet/application.rb:364:in `run' C:/Tools/Puppet/puppet/lib/puppet/util/command_line.rb:137:in `run' C:/Tools/Puppet/puppet/lib/puppet/util/command_line.rb:91:in `execute' C:/Tools/Puppet/puppet/bin/puppet:4:in `main' -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/ed1ffcb8-f3da-4079-ae8b-d115a08f9d5a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Chocolatey pre-fetch fails with Puppet - Could not prefetch package provider 'chocolatey': undefined method `each' for nil:NilClass
/resource_harness.rb:19:in `evaluate' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:174:in `apply' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:187:in `eval_resource' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:117:in `call' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:117:in `block (2 levels) in evaluate' C:/Tools/Puppet/puppet/lib/puppet/util.rb:327:in `block in thinmark' C:/Tools/Puppet/sys/ruby/lib/ruby/1.9.1/benchmark.rb:295:in `realtime' C:/Tools/Puppet/puppet/lib/puppet/util.rb:326:in `thinmark' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:117:in `block in evaluate' C:/Tools/Puppet/puppet/lib/puppet/graph/relationship_graph.rb:118:in `traverse' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:108:in `evaluate' C:/Tools/Puppet/puppet/lib/puppet/resource/catalog.rb:164:in `block in apply' C:/Tools/Puppet/puppet/lib/puppet/util/log.rb:149:in `with_destination' C:/Tools/Puppet/puppet/lib/puppet/transaction/report.rb:108:in `as_logging_destination' C:/Tools/Puppet/puppet/lib/puppet/resource/catalog.rb:163:in `apply' C:/Tools/Puppet/puppet/lib/puppet/configurer.rb:125:in `block in apply_catalog' C:/Tools/Puppet/puppet/lib/puppet/util.rb:161:in `block in benchmark' C:/Tools/Puppet/sys/ruby/lib/ruby/1.9.1/benchmark.rb:295:in `realtime' C:/Tools/Puppet/puppet/lib/puppet/util.rb:160:in `benchmark' C:/Tools/Puppet/puppet/lib/puppet/configurer.rb:124:in `apply_catalog' C:/Tools/Puppet/puppet/lib/puppet/configurer.rb:192:in `run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:44:in `block (4 levels) in run' C:/Tools/Puppet/puppet/lib/puppet/agent/locker.rb:20:in `lock' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:44:in `block (3 levels) in run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:114:in `with_client' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:41:in `block (2 levels) in run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:79:in `run_in_fork' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:40:in `block in run' C:/Tools/Puppet/puppet/lib/puppet/application.rb:179:in `call' C:/Tools/Puppet/puppet/lib/puppet/application.rb:179:in `controlled_run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:38:in `run' C:/Tools/Puppet/puppet/lib/puppet/application/agent.rb:355:in `onetime' C:/Tools/Puppet/puppet/lib/puppet/application/agent.rb:321:in `run_command' C:/Tools/Puppet/puppet/lib/puppet/application.rb:364:in `block (2 levels) in run' C:/Tools/Puppet/puppet/lib/puppet/application.rb:470:in `plugin_hook' C:/Tools/Puppet/puppet/lib/puppet/application.rb:364:in `block in run' C:/Tools/Puppet/puppet/lib/puppet/util.rb:478:in `exit_on_fail' C:/Tools/Puppet/puppet/lib/puppet/application.rb:364:in `run' C:/Tools/Puppet/puppet/lib/puppet/util/command_line.rb:137:in `run' C:/Tools/Puppet/puppet/lib/puppet/util/command_line.rb:91:in `execute' C:/Tools/Puppet/puppet/bin/puppet:4:in `main' Notice: /Stage[main]/Install_iis/Windowsfeature[IIS]/Exec[add-feature-IIS]: Dependency Package[carbon] has failures: true Warning: /Stage[main]/Install_iis/Windowsfeature[IIS]/Exec[add-feature-IIS]: Skipping because of failed dependencies (list of failed dependencies go on) On Tue, Jun 17, 2014 at 4:15 PM, Rob Reynolds r...@puppetlabs.com wrote: Let's make sure everything is set up correctly. Do you have chocolatey (the client tool) already installed on both of those servers? If so what versions of chocolatey? Do they both respond to output? (choco /?) Moving up the chain to the provider, let's execute puppet agent -td --verbose --trace This should really get us to what might be causing the error. On Tue, Jun 17, 2014 at 12:51 PM, Jim Ficarra jimfica...@gmail.com wrote: Chocolatey is installed as a shared module on the puppet master. Below is the specific part of the puppet code that uses the chocolatey provider to install a custom package. class install_carbon { package {'carbon': ensure = '1.7', provider = 'chocolatey', } } This class is part of a larger set of modules and classes that work together and execute completely and successfully on another host but fails on a second host with the error below. Same puppet client version (3.4.2 installed from an internal NuGet repo). Chocolatey is also customized to point to an internal repo. Any help/thoughts/insight would be appreciated. Thanks! Could not prefetch package provider 'chocolatey': undefined method `each' for nil:NilClass C:/Tools/Puppet/puppet/lib/puppet/provider/package.rb:4:in `prefetch' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:277:in `prefetch' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:167:in `prefetch_if_necessary' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:67:in `block in evaluate' C:/Tools/Puppet/puppet/lib/puppet/graph/relationship_graph.rb:116:in `call' C:/Tools/Puppet/puppet/lib/puppet/graph/relationship_graph.rb:116:in `traverse' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:108:in `evaluate' C:/Tools/Puppet/puppet/lib/puppet/resource/catalog.rb:164:in `block in apply' C:/Tools/Puppet
Re: [Puppet Users] Chocolatey pre-fetch fails with Puppet - Could not prefetch package provider 'chocolatey': undefined method `each' for nil:NilClass
/puppet/lib/puppet/type.rb:1063:in `retrieve_resource' C:/Tools/Puppet/puppet/lib/puppet/transaction/resource_harness.rb:223:in `from_resource' C:/Tools/Puppet/puppet/lib/puppet/transaction/resource_harness.rb:19:in `evaluate' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:174:in `apply' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:187:in `eval_resource' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:117:in `call' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:117:in `block (2 levels) in evaluate' C:/Tools/Puppet/puppet/lib/puppet/util.rb:327:in `block in thinmark' C:/Tools/Puppet/sys/ruby/lib/ruby/1.9.1/benchmark.rb:295:in `realtime' C:/Tools/Puppet/puppet/lib/puppet/util.rb:326:in `thinmark' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:117:in `block in evaluate' C:/Tools/Puppet/puppet/lib/puppet/graph/relationship_graph.rb:118:in `traverse' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:108:in `evaluate' C:/Tools/Puppet/puppet/lib/puppet/resource/catalog.rb:164:in `block in apply' C:/Tools/Puppet/puppet/lib/puppet/util/log.rb:149:in `with_destination' C:/Tools/Puppet/puppet/lib/puppet/transaction/report.rb:108:in `as_logging_destination' C:/Tools/Puppet/puppet/lib/puppet/resource/catalog.rb:163:in `apply' C:/Tools/Puppet/puppet/lib/puppet/configurer.rb:125:in `block in apply_catalog' C:/Tools/Puppet/puppet/lib/puppet/util.rb:161:in `block in benchmark' C:/Tools/Puppet/sys/ruby/lib/ruby/1.9.1/benchmark.rb:295:in `realtime' C:/Tools/Puppet/puppet/lib/puppet/util.rb:160:in `benchmark' C:/Tools/Puppet/puppet/lib/puppet/configurer.rb:124:in `apply_catalog' C:/Tools/Puppet/puppet/lib/puppet/configurer.rb:192:in `run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:44:in `block (4 levels) in run' C:/Tools/Puppet/puppet/lib/puppet/agent/locker.rb:20:in `lock' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:44:in `block (3 levels) in run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:114:in `with_client' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:41:in `block (2 levels) in run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:79:in `run_in_fork' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:40:in `block in run' C:/Tools/Puppet/puppet/lib/puppet/application.rb:179:in `call' C:/Tools/Puppet/puppet/lib/puppet/application.rb:179:in `controlled_run' C:/Tools/Puppet/puppet/lib/puppet/agent.rb:38:in `run' C:/Tools/Puppet/puppet/lib/puppet/application/agent.rb:355:in `onetime' C:/Tools/Puppet/puppet/lib/puppet/application/agent.rb:321:in `run_command' C:/Tools/Puppet/puppet/lib/puppet/application.rb:364:in `block (2 levels) in run' C:/Tools/Puppet/puppet/lib/puppet/application.rb:470:in `plugin_hook' C:/Tools/Puppet/puppet/lib/puppet/application.rb:364:in `block in run' C:/Tools/Puppet/puppet/lib/puppet/util.rb:478:in `exit_on_fail' C:/Tools/Puppet/puppet/lib/puppet/application.rb:364:in `run' C:/Tools/Puppet/puppet/lib/puppet/util/command_line.rb:137:in `run' C:/Tools/Puppet/puppet/lib/puppet/util/command_line.rb:91:in `execute' C:/Tools/Puppet/puppet/bin/puppet:4:in `main' Notice: /Stage[main]/Install_iis/Windowsfeature[IIS]/Exec[add-feature-IIS]: Dependency Package[carbon] has failures: true Warning: /Stage[main]/Install_iis/Windowsfeature[IIS]/Exec[add-feature-IIS]: Skipping because of failed dependencies (list of failed dependencies go on) On Tue, Jun 17, 2014 at 4:15 PM, Rob Reynolds r...@puppetlabs.com wrote: Let's make sure everything is set up correctly. Do you have chocolatey (the client tool) already installed on both of those servers? If so what versions of chocolatey? Do they both respond to output? (choco /?) Moving up the chain to the provider, let's execute puppet agent -td --verbose --trace This should really get us to what might be causing the error. On Tue, Jun 17, 2014 at 12:51 PM, Jim Ficarra jimfica...@gmail.com wrote: Chocolatey is installed as a shared module on the puppet master. Below is the specific part of the puppet code that uses the chocolatey provider to install a custom package. class install_carbon {package {'carbon':ensure = '1.7',provider = 'chocolatey',}} This class is part of a larger set of modules and classes that work together and execute completely and successfully on another host but fails on a second host with the error below. Same puppet client version (3.4.2 installed from an internal NuGet repo). Chocolatey is also customized to point to an internal repo. Any help/thoughts/insight would be appreciated. Thanks! Could not prefetch package provider 'chocolatey': undefined method `each' for nil:NilClass C:/Tools/Puppet/puppet/lib/puppet/provider/package.rb:4:in `prefetch' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:277:in `prefetch' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:167:in `prefetch_if_necessary' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:67:in `block in evaluate' C:/Tools/Puppet/puppet/lib/puppet/graph/relationship_graph.rb:116:in `call' C:/Tools/Puppet/puppet
Re: [Puppet Users] Chocolatey pre-fetch fails with Puppet - Could not prefetch package provider 'chocolatey': undefined method `each' for nil:NilClass
Sorry if this is a duplicate – I tried to send earlier but it didn’t seem to hit the distro. Also truncating it for readability = Hey Rob, Thanks for the response! Yes – chocolatey version 0.9.8.23 is installed on both servers (found via choco version). They both respond to choco /?. This is a customized version that has had the install path modified and the default repository restricted to an internal Nuget repository. I can also install chocolatey packages manually on both servers – specifically this package that is failing by typing “cinst carbon”. I am running puppet as a windows service and ran the service with debug/trace (sc start puppet –debug –trace) to pull the previous errors from the event log, though they were a bit segregated across event entries. It's also worth noting that there are 4 resource types ahead of the one that's failing. The 4 resourcs types (two files and two execs) are applied successfully. I ran the puppet agent –td –verbose –trace and received a lot of output, but essentially the same errors that don't appear to have any new information. The successful output shows that the 4 previous resource types ran. Included below is the start of when it begins to apply the package with the chocolatey provider: Notice: /Stage[main]/Copy_externalfacts/Exec[BuildStatusFacterFile_SetPerms]/returns: executed successfully Debug: /Stage[main]/Copy_externalfacts/Exec[BuildStatusFacterFile_SetPerms]: The container Class[Copy_externalfacts] will propagate my refresh event Debug: Class[Copy_externalfacts]: The container Stage[main] will propagate my refresh event Debug: Prefetching chocolatey resources for package Debug: Executing 'C:\Tools\Chocolatey\chocolateyInstall\chocolatey.cmd list -lo' Error: Could not prefetch package provider 'chocolatey': undefined method `each' for nil:NilClass C:/Tools/Puppet/puppet/lib/puppet/provider/package.rb:4:in `prefetch' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:277:in `prefetch' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:167:in `prefetch_if_necessary' truncated Debug: Executing 'C:\Tools\Chocolatey\chocolateyInstall\chocolatey.cmd list -lo' Error: /Stage[main]/Install_carbon/Package[carbon]: Could not evaluate: undefined method `each' for nil:NilClass C:/ProgramData/PuppetLabs/puppet/var/lib/puppet/provider/package/chocolatey.rb:66:in `query' C:/Tools/Puppet/puppet/lib/puppet/provider/package.rb:19:in `properties' C:/Tools/Puppet/puppet/lib/puppet/type/package.rb:178:in `retrieve' C:/Tools/Puppet/puppet/lib/puppet/type.rb:1035:in `retrieve' C:/Tools/Puppet/puppet/lib/puppet/type.rb:1063:in `retrieve_resource' truncated Notice: /Stage[main]/Install_iis/Windowsfeature[IIS]/Exec[add-feature-IIS]: Dependency Package[carbon] has failures: true Warning: /Stage[main]/Install_iis/Windowsfeature[IIS]/Exec[add-feature-IIS]: Skipping because of failed dependencies (list of failed dependencies go on) On Tue, Jun 17, 2014 at 4:15 PM, Rob Reynolds r...@puppetlabs.com wrote: Let's make sure everything is set up correctly. Do you have chocolatey (the client tool) already installed on both of those servers? If so what versions of chocolatey? Do they both respond to output? (choco /?) Moving up the chain to the provider, let's execute puppet agent -td --verbose --trace This should really get us to what might be causing the error. On Tue, Jun 17, 2014 at 12:51 PM, Jim Ficarra jimfica...@gmail.com wrote: Chocolatey is installed as a shared module on the puppet master. Below is the specific part of the puppet code that uses the chocolatey provider to install a custom package. class install_carbon {package {'carbon':ensure = '1.7',provider = 'chocolatey',}} This class is part of a larger set of modules and classes that work together and execute completely and successfully on another host but fails on a second host with the error below. Same puppet client version (3.4.2 installed from an internal NuGet repo). Chocolatey is also customized to point to an internal repo. Any help/thoughts/insight would be appreciated. Thanks! Could not prefetch package provider 'chocolatey': undefined method `each' for nil:NilClass C:/Tools/Puppet/puppet/lib/puppet/provider/package.rb:4:in `prefetch' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:277:in `prefetch' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:167:in `prefetch_if_necessary' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:67:in `block in evaluate' C:/Tools/Puppet/puppet/lib/puppet/graph/relationship_graph.rb:116:in `call' C:/Tools/Puppet/puppet/lib/puppet/graph/relationship_graph.rb:116:in `traverse' C:/Tools/Puppet/puppet/lib/puppet/transaction.rb:108:in `evaluate' C:/Tools/Puppet/puppet/lib/puppet/resource/catalog.rb:164:in `block in apply' C:/Tools/Puppet/puppet/lib/puppet/util/log.rb:149
Re: [Puppet Users] Ability to wait for dotnet to complete installation
Did you try using the package resource over the exec resource? I install .NET 4.0 using the package resource and it works just fine on Windows 2008 R2 Enterprise Standard, though I haven’t tried on Data Center but I’m not sure how different it would be. I’ve done something similar with .net 4.5. The package resource allows the installation of .NET to be idempotent as it is aware of packages installed/registered in Control Panel. Here is one I use for .NET 4.5.1, but it’s the same pattern for 4.0 (I can’t find the one I had for 4.0, but it was similar). Update the package name to match the description as it appears in Control Panel as well as the version. In my case I have a previous resource that I require that downloads the .exe to a temp folder for local execution(Download_file). I also ensure that IIS is installed (Windowsfeature) package { 'Microsoft .NET Framework 4.5.1': ensure = '4.5.50938', source = 'D:\temp\NDP451-KB2858728-x86-x64-AllOS-ENU.exe', install_options = ['/q','/norestart'], require = [Download_file['NDP451-KB2858728-x86-x64-AllOS-ENU.exe_download'],Windowsfeature['IIS']], } As I said I can’t find the 4.0 package def I had, but let here’s a crack at what I remember.You’ll need to ensure that the source is updated to where you have it. The source attribute works for local and UNC resources, but not http urls. We use the download_file puppet resource type (from puppet forge) to download files from an HTTP url. package { 'Microsoft .NET Framework Extended': ensure = '4.0.30319', source = 'D:\temp\dotNetFx40_full_x86_x64.exe', install_options = ['/q','/norestart'], } .NET 4.0 installs both extended and client profile. You *could* chain these together, but I haven’t tried. Puppet will check that these are installed and if they are, will not install them again. The first one would kick off and install both, then when the Client Profile was checked it would see it was installed. You could use this to ensure that both were installed – if someone uninstalled the client profile but not extended, it would kick off the installer again, but I’ve not tried a repair option. Perhaps .net would do a full refresh, but I don’t know for sure. package { 'Microsoft .NET Framework Extended': ensure = '4.0.30319', source = 'D:\temp\dotNetFx40_full_x86_x64.exe', install_options = ['/q','/norestart'], } - package { 'Microsoft .NET Framework Client Profile': ensure = '4.0.30319', source = 'D:\temp\dotNetFx40_full_x86_x64.exe', install_options = ['/q','/norestart'], } Hope this helps. -Jim From: Stephen Wallace Sent: Wednesday, June 04, 2014 2:15 AM To: puppet-users@googlegroups.com Subject: [Puppet Users] Ability to wait for dotnet to complete installation Hi all, Interesting timing challenge around installing dotnet on Windows 2008 R2 Data Cente. In essence, when we run the following command, it appears to complete in a few seconds. The reality is that it spawns multiple new msiexecs to install and configure itself over the next 5 mins or so. dotNetFx40_Full_x86_x64.exe /q /norestart This causes an obvious issue if we need to install a bit of software with dotnet as a dependancy, unless, we can wait until dotnet has finished it's 5 min dance. From command line, this issue is resolved by adding a start /wait to the above command. The next challenge is how to get the correct syntax for my exec statement; command = start /wait ${dotnet::params::deployment_root}\\dotNetFx40_Full_x86_x64.exe /q /norestart, Without the start /wait, the above command works. With the start /wait, it complains as follows... /Stage[main]//Dotnet[dotnet45]/Exec[install-dotnet-45]/returns: Error: start /wait C:\ProgramData\PuppetLabs\puppet\etc\modules\dotnet\files\dotNetFx40_Full_x86_x64.exe /q /norestart returned 1 instead of one of [0] Short of writing a new function called go for a cup of tea feeding it the required number of sleep seconds(!), does anybody have any experiences or ideas around this one?? -- Regs, Stephen J Wallace M +61 (0)415 306731 http://au.linkedin.com/in/stephenwallace -- You received this message because you are subscribed to the
Re: [Puppet Users] Windows exe fork
I’m not familiar with how the Reimann monitoring client runs – but if you run it at the command line and it runs within the shell and requires the command shell to run perpetually, you could try “start.exe reimannclient.exe” or whatever the name of the exe is. There are a # of command line switches that you can look at in the help by typing start /? at the command line. This would be a kludgey way to do it though to be honest. You won’t have a very good way to control it. Alternatively, it’s usually better to run these types of things within the service control manager as a service if they are supported which will give you more control over starting, stopping, and ensuring it starts up when the servers reboot, etc. Hopefully your tool is able to run natively as a service. if not, you can try to set up a service wrapper to run it as a service (Unfortunately you can’t just convert any exe natively into a Windows service). SrvAny (the wrapper) and InstSrv (sets up the SrvAny wrapper in the registry/service control manager) were tools available in the Windows 2003 Server Resource Kit. I’ve recently read that those 2003 tools still work in 2008, but keep in mind that they are not supported and your mileage may vary. If your client is available as something that can run as a service that would be much better. You could use puppet to ensure the components are installed properly and that the service is set to run all the time. From: Bill N Sent: Friday, May 30, 2014 12:27 PM To: puppet-users@googlegroups.com Subject: [Puppet Users] Windows exe fork Hi, Just wrote my first puppet module for Windows provisioning. All is working well except I am having a problem running a windows exe file in that Puppet appears to wait for the exe to complete. At least this is the case when I run Puppet agent --test from the Windows Server command line. What I want to do here is install a set of files for a Riemann monitoring client on several Windows Server 2008 R1 VMs. These files include an exe, which I want to start and run in perpetuity. I don't want Puppet to wait for this process to complete. It appears I could run the exe in a separate shell using cmd.exe, but when I try that on the command line I do not see the named process running in the Resource Monitor. I only see cmd.exe running. This is not very informative. My question is, what is the best way to run this executable via Puppet? Should I convert the exe to a Windows service, install that and run it as a service? Should I use shell cmd and live with the unhelpful Resource Monitor listing? Or should I use Power Shell to fork the process like I would in linux? Any help would be most appreciated. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c5d75b7c-531d-40d2-a027-f118910206af%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/1CEBC94EFF3A420684F90A61C5C65420%40JimHPPavilionG6. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Puppet for Windows - Problems with Oracle 11g client install
Sorry for not responding in a while – I moved on to automating other parts and now I’m back to this one. It happens if I run puppet apply or puppet agent – either way it’s running as a domain service account. I can run the installer perfectly fine outside of puppet with no user interaction whatsoever. I have the appropriate command line options and the response file simply provides the settings that would’ve been requested through the UI – but as I said, I have it working w/out a lick of interaction required. It’s just when I hit it in puppet this occurs. Puppet is running as a domain service account. Not sure what you mean by having an issue with the D: drive. D: is a local drive, not a mapped drive, so we’re not trying to use localsystem across to a network/mapped drive. Puppet has no issues install everything else from the same d:\build source – for example I’ve used it to install the MSDeploy MSI and a custom MSI to install some http modules in IIS. These installers reside in D:\Build as well. Also, the fact that it’s able to access the installer and unzip the files in the temp install directory is telling me that it has no issues accessing the files on D:. That said, I just tried to execute it as the puppet service account interactively – I see an issue (maybe THE issue) - the installer throws a java.lang.NullPointerException. I don’t get this when I run it as myself, so at least another lead with the specific user it’s executing under. I’ll update this thread when I find out more but if you have any other diagnostic tips let me know. Thanks! From: Josh Cooper Sent: Tuesday, May 20, 2014 1:32 AM To: puppet-users@googlegroups.com Subject: Re: [Puppet Users] Puppet for Windows - Problems with Oracle 11g client install On Mon, May 19, 2014 at 6:46 PM, Jim Ficarra jimfica...@gmail.com wrote: Thanks for replying, Josh. I just tried your suggestion but the same thing happens. install_options = ['-silent', '-waitforcompletion', '-noconsole'. '-responseFile', 'D:\Build\Ora11gclient.rsp'], It spawns several processes (javaw, oui, etc) and then it unzips the files (I see unzip.exe execute in task mgr, and I see the files expanded in the puppet users appdata/local/temp folder) then it hangs with the following processes hung (in the security context of the service account under which the puppet service is running) – 0% CPU utilization on these processes. conhost.exe (two of them), ruby.exe*32 (two of them), setup.exe*32, oui.exe*32, javaw.exe*32, cmd.exe*32 (two of them) hanging with 0 CPU utilization. I have turned on debugging and I get the following in the event log shortly before it hangs. Executing 'cmd.exe /c start puppet-install /w D:\Build\Oracle11gclient\setup.exe -silent -noconsole -waitforcompletion -responseFile D:\Build\Ora11gclient.rsp' It eventually times out. Any other thoughts? The odd thing is that I can install this from the command line with the same options, so I know I have the options correct. Are these processes getting orphaned? I’m guessing based on the behavior, but it looks like the install kicks off several processes, and after the unzip the other processes seem to be waiting for some signal that never happens. Any additional thoughts? Are you running `puppet apply` or `puppet agent` when the hang happens? In either case, I'd recommending using process explorer to find the child process that all of those are waiting on. As a first approximation, you can usually use procexp to see if one of the threads is calling MessageBoxA, e.g. a service that tries to display a message dialog on the service window station. Second, is D: a mapped drive? If so, then puppet running as LocalSystem won't be able to access it (as specified). Also, it would help if you could provide your response file with redacted passwords, etc. Thanks. -Jim From: Josh Cooper Sent: Monday, May 19, 2014 3:44 PM To: puppet-users@googlegroups.com Subject: Re: [Puppet Users] Puppet for Windows - Problems with Oracle 11g client install On Sun, May 18, 2014 at 10:57 AM, Jim Ficarra jimfica...@gmail.com wrote: Trying the following in both package and exec providers D:\Build\Oracle11gclient\setup.exe -silent -waitforcompletion -noconsole -responseFile D:\Build\Ora11gclient.rsp I can run this at the command line and install Oracle 11g client silently.Once I put it in a package or try to exec it, I get as far as the installer auto-unzipping the files needed for the install but then it just hangs and after 5 mins, puppet times out. The processes are just hung. I've tried the following two ways (I have a custom fact that determines if oracle is installed which works correctly - if I install oracle outside of puppet the fact correctly determines if it's installed). The files are placed in the source path by other statements that work as expected. Attempted providers
Re: [Puppet Users] Puppet for Windows - Problems with Oracle 11g client install
So I think I found the issue. Others are having the same issue – the service account used to execute puppet is prefaced with an exclamation mark: ‘!’ Seems that others are having similar issues with accounts that have ! in them. http://rprabu1984.wordpress.com/2014/02/03/java-lang-nullpointerexception-while-trying-to-install-oracle-software/ https://community.oracle.com/thread/1067522 Folks are indicating it’s a bug, but I haven’t found an official statement for Oracle indicating so – still this is pretty plausible given that others are having the same issue with accounts prefaced with ! and that in my case puppet has no issues installing other installers from the same location. Either way, I have what I think is the root cause and a direction to address it. Thanks for hanging through with this, Josh – much appreciated. Also, great work on the powershell provider – that has saved me more than you can imagine! If you have any additional thoughts, please feel free. -Jim From: Jim Ficarra Sent: Saturday, May 24, 2014 10:01 PM To: puppet-users@googlegroups.com Subject: Re: [Puppet Users] Puppet for Windows - Problems with Oracle 11g client install Sorry for not responding in a while – I moved on to automating other parts and now I’m back to this one. It happens if I run puppet apply or puppet agent – either way it’s running as a domain service account. I can run the installer perfectly fine outside of puppet with no user interaction whatsoever. I have the appropriate command line options and the response file simply provides the settings that would’ve been requested through the UI – but as I said, I have it working w/out a lick of interaction required. It’s just when I hit it in puppet this occurs. Puppet is running as a domain service account. Not sure what you mean by having an issue with the D: drive. D: is a local drive, not a mapped drive, so we’re not trying to use localsystem across to a network/mapped drive. Puppet has no issues install everything else from the same d:\build source – for example I’ve used it to install the MSDeploy MSI and a custom MSI to install some http modules in IIS. These installers reside in D:\Build as well. Also, the fact that it’s able to access the installer and unzip the files in the temp install directory is telling me that it has no issues accessing the files on D:. That said, I just tried to execute it as the puppet service account interactively – I see an issue (maybe THE issue) - the installer throws a java.lang.NullPointerException. I don’t get this when I run it as myself, so at least another lead with the specific user it’s executing under. I’ll update this thread when I find out more but if you have any other diagnostic tips let me know. Thanks! From: Josh Cooper Sent: Tuesday, May 20, 2014 1:32 AM To: puppet-users@googlegroups.com Subject: Re: [Puppet Users] Puppet for Windows - Problems with Oracle 11g client install On Mon, May 19, 2014 at 6:46 PM, Jim Ficarra jimfica...@gmail.com wrote: Thanks for replying, Josh. I just tried your suggestion but the same thing happens. install_options = ['-silent', '-waitforcompletion', '-noconsole'. '-responseFile', 'D:\Build\Ora11gclient.rsp'], It spawns several processes (javaw, oui, etc) and then it unzips the files (I see unzip.exe execute in task mgr, and I see the files expanded in the puppet users appdata/local/temp folder) then it hangs with the following processes hung (in the security context of the service account under which the puppet service is running) – 0% CPU utilization on these processes. conhost.exe (two of them), ruby.exe*32 (two of them), setup.exe*32, oui.exe*32, javaw.exe*32, cmd.exe*32 (two of them) hanging with 0 CPU utilization. I have turned on debugging and I get the following in the event log shortly before it hangs. Executing 'cmd.exe /c start puppet-install /w D:\Build\Oracle11gclient\setup.exe -silent -noconsole -waitforcompletion -responseFile D:\Build\Ora11gclient.rsp' It eventually times out. Any other thoughts? The odd thing is that I can install this from the command line with the same options, so I know I have the options correct. Are these processes getting orphaned? I’m guessing based on the behavior, but it looks like the install kicks off several processes, and after the unzip the other processes seem to be waiting for some signal that never happens. Any additional thoughts? Are you running `puppet apply` or `puppet agent` when the hang happens? In either case, I'd recommending using process explorer to find the child process that all of those are waiting on. As a first approximation, you can usually use procexp to see if one of the threads is calling MessageBoxA, e.g. a service that tries to display a message dialog on the service window station. Second, is D: a mapped drive? If so, then puppet running as LocalSystem won't be able to access
Re: [Puppet Users] Puppet for Windows - Problems with Oracle 11g client install
Thanks for replying, Josh. I just tried your suggestion but the same thing happens. install_options = ['-silent', '-waitforcompletion', '-noconsole'. '-responseFile', 'D:\Build\Ora11gclient.rsp'], It spawns several processes (javaw, oui, etc) and then it unzips the files (I see unzip.exe execute in task mgr, and I see the files expanded in the puppet users appdata/local/temp folder) then it hangs with the following processes hung (in the security context of the service account under which the puppet service is running) – 0% CPU utilization on these processes. conhost.exe (two of them), ruby.exe*32 (two of them), setup.exe*32, oui.exe*32, javaw.exe*32, cmd.exe*32 (two of them) hanging with 0 CPU utilization. I have turned on debugging and I get the following in the event log shortly before it hangs. Executing 'cmd.exe /c start puppet-install /w D:\Build\Oracle11gclient\setup.exe -silent -noconsole -waitforcompletion -responseFile D:\Build\Ora11gclient.rsp' It eventually times out. Any other thoughts? The odd thing is that I can install this from the command line with the same options, so I know I have the options correct. Are these processes getting orphaned? I’m guessing based on the behavior, but it looks like the install kicks off several processes, and after the unzip the other processes seem to be waiting for some signal that never happens. Any additional thoughts? Thanks. -Jim From: Josh Cooper Sent: Monday, May 19, 2014 3:44 PM To: puppet-users@googlegroups.com Subject: Re: [Puppet Users] Puppet for Windows - Problems with Oracle 11g client install On Sun, May 18, 2014 at 10:57 AM, Jim Ficarra jimfica...@gmail.com wrote: Trying the following in both package and exec providers D:\Build\Oracle11gclient\setup.exe -silent -waitforcompletion -noconsole -responseFile D:\Build\Ora11gclient.rsp I can run this at the command line and install Oracle 11g client silently.Once I put it in a package or try to exec it, I get as far as the installer auto-unzipping the files needed for the install but then it just hangs and after 5 mins, puppet times out. The processes are just hung. I've tried the following two ways (I have a custom fact that determines if oracle is installed which works correctly - if I install oracle outside of puppet the fact correctly determines if it's installed). The files are placed in the source path by other statements that work as expected. Attempted providers (unsuccessful) exec {'OracleInstall': command = 'D:\Build\Oracle11gclient\setup.exe -silent -waitforcompletion -noconsole -responseFile D:\Build\Ora11gclient.rsp', } exec {'OracleInstall': command = ' D:\Build\Oracle11gclient\setup.exe -silent -waitforcompletion -noconsole -responseFile D:\Build\Ora11gclient.rsp', provider = powershell, } #command = ' D:\Build\Oracle 11g client\setup.exe -silent -waitforcompletion -noconsole -responseFile D:\Build\Ora11gclient.rsp', package {'OracleInstall': source = 'D:\Build\Oracle11gclient\setup.exe', install_options = ['-silent', '-waitforcompletion', '-noconsole'. '-responseFile D:\Build\Ora11gclient.rsp'], Shouldn't that be: install_options = ['-silent', '-waitforcompletion', '-noconsole'. '-responseFile', 'D:\Build\Ora11gclient.rsp'], Otherwise puppet will think you're passing a single argument with spaces in it, and will quote it. } When either of these run, it kicks off - I see the unzip.exe kick off and it begins to unpack the files. I then see the java installer process and setup.exe in task manager but after a few seconds it stops and just hangs. The installActions file shows the following - which is not complete compared to when I run the puppet module locally on the box (puppet apply oracle_install.pp). Contents of installAction log - Using paramFile: D:\Build\Oracle11gclient\install\oraparam.ini The commandline for unzip: D:\Build\Oracle11gclient\install\unzip -qqqo ..\stage\Components\oracle.jdk\1.5.0.17.03\1\DataFiles/*.jar -d C:\Users\!CDCPU~1\AppData\Local\Temp\OraInstall2014-05-18_12-52-59PM - So, it seems it's getting as far as unzipping but then just hangs - I'm thinking something is getting orphaned somewhere but I can't figure it out. Hoping someone has some insight or suggestions. Thanks. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/99bee03b-e71d-40fb-9546-d60359c5af3d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Josh Cooper Developer
[Puppet Users] Puppet for Windows - Problems with Oracle 11g client install
Trying the following in both package and exec providers D:\Build\Oracle11gclient\setup.exe -silent -waitforcompletion -noconsole -responseFile D:\Build\Ora11gclient.rsp I can run this at the command line and install Oracle 11g client silently.Once I put it in a package or try to exec it, I get as far as the installer auto-unzipping the files needed for the install but then it just hangs and after 5 mins, puppet times out. The processes are just hung. I've tried the following two ways (I have a custom fact that determines if oracle is installed which works correctly - if I install oracle outside of puppet the fact correctly determines if it's installed). The files are placed in the source path by other statements that work as expected. Attempted providers (unsuccessful) exec {'OracleInstall': command = 'D:\Build\Oracle11gclient\setup.exe -silent -waitforcompletion -noconsole -responseFile D:\Build\Ora11gclient.rsp', } exec {'OracleInstall': command = ' D:\Build\Oracle11gclient\setup.exe -silent -waitforcompletion -noconsole -responseFile D:\Build\Ora11gclient.rsp', provider = powershell, } #command = ' D:\Build\Oracle 11g client\setup.exe -silent -waitforcompletion -noconsole -responseFile D:\Build\Ora11gclient.rsp', package {'OracleInstall': source = 'D:\Build\Oracle11gclient\setup.exe', install_options = ['-silent', '-waitforcompletion', '-noconsole'. '-responseFile D:\Build\Ora11gclient.rsp'], } When either of these run, it kicks off - I see the unzip.exe kick off and it begins to unpack the files. I then see the java installer process and setup.exe in task manager but after a few seconds it stops and just hangs. The installActions file shows the following - which is not complete compared to when I run the puppet module locally on the box (puppet apply oracle_install.pp). Contents of installAction log - Using paramFile: D:\Build\Oracle11gclient\install\oraparam.ini The commandline for unzip: D:\Build\Oracle11gclient\install\unzip -qqqo ..\stage\Components\oracle.jdk\1.5.0.17.03\1\DataFiles/*.jar -d C:\Users\!CDCPU~1\AppData\Local\Temp\OraInstall2014-05-18_12-52-59PM - So, it seems it's getting as far as unzipping but then just hangs - I'm thinking something is getting orphaned somewhere but I can't figure it out. Hoping someone has some insight or suggestions. Thanks. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/99bee03b-e71d-40fb-9546-d60359c5af3d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.