[Puppet Users] Re: Is this a Facter 4 bug? (using custom facts in other custom facts.)

2022-01-25 Thread KevinR
t 12:48:14 PM UTC+1 KevinR wrote: > >> The cause for your issues is that there's code before the setcode do line, >> which will cause issues under Facter 4. >> Having code before setcode do was a bad coding practice but didn't break >> things in Facter 3. I

[Puppet Users] Re: Is this a Facter 4 bug? (using custom facts in other custom facts.)

2022-01-21 Thread KevinR
The cause for your issues is that there's code before the setcode do line, which will cause issues under Facter 4. Having code before setcode do was a bad coding practice but didn't break things in Facter 3. In Facter 4, it does break things. If you move the hostname=Facter.value(:networking)['h

[Puppet Users] Re: Calling a puppet function inside a ruby task

2021-02-04 Thread KevinR
your function in that folder, i.e.f /functions/func1.rb 3. Namespace the function according to your module name, for example mymodule::func1 4. You can now use the module in a Bolt Plan (under /plans) with mymodule::func1(args) - KevinR On Thursday, February 4, 2021 at 7:53:46 AM

[Puppet Users] Re: creating a subscription to registry creation on a windows machine

2020-12-21 Thread KevinR
Hi Raghuram, yes this is achieved with the subscribe meta parameter. For example: registry_value { 'disable_defender': ensure => present, type => dword, path => 'HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\DisableAntiSpyware', value => 1 } reboot { 'regkey_reboot':

Re: [Puppet Users] Installing an exe like VLC

2020-11-13 Thread KevinR
stall it on the next Puppet run. You can run the following command to output how Puppet detects this application after installation: puppet resource package 'VLC media player' On Friday, November 13, 2020 at 12:53:00 PM UTC+1 KevinR wrote: > Hi Jarod, > > the following Puppe

Re: [Puppet Users] Installing an exe like VLC

2020-11-13 Thread KevinR
Hi Jarod, the following Puppet code will do what you want to achieve: $file = 'vlc-3.0.11-win32.exe' $tmpdir = 'C:/Windows/Temp' file { 'VLC Player Download': ensure => present, path => "${$tmpdir}/${file}", source => "https://videolan.mirror.liteserver.nl/vlc/3.0.11/win32/${file}";

[Puppet Users] Re: Can we call a ruby function inside puppet plan (Inside same module)

2020-08-27 Thread KevinR
/myfunction.rb. Calling that function in your plan looks like this: plan module1::myplan( String $some_param ){ $result = module1::myfunction($some_param) } Kind regards, KevinR On Thursday, August 27, 2020 at 11:51:49 AM UTC+2 baisani...@gmail.com wrote: > Hi All, > > If we have a

[Puppet Users] Re: Unable to upgarde the puppet agents (windows) from 2019.1.0 to 2019.5.0

2020-07-21 Thread KevinR
trol repo's Puppetfile and add this declaration to a manifest that gets applied to all nodes (e.g. your baseline): class {'::puppet_agent': package_version => 'auto' } -KevinR On Tuesday, July 21, 2020 at 7:07:44 AM UTC+2 vina...@gmail.com wrote: > Hi All, > &

[Puppet Users] Re: Puppetserver performance plummeting a few hours after startup

2020-02-06 Thread KevinR
Hi Martijn, it sounds like you have a sub-optimal combination of: - The amount of JRubies - The total amount of java heap memory for puppetserver - The size of your code base This typically causes the kind of problems you're experiencing. What's happening in a nutshell is that puppet i

Re: [Puppet Users] Bolt: Running a ps-script making a web request with credentials

2019-11-25 Thread KevinR
Yep you've run into the second-hop problem as Glenn mentioned. I tried your script in a remote Powershell session and it has the same problem. Basically the issue is that the credential cache is empty on the remote machine (as a security precaution), which prevents you from use the DefaultCreden

[Puppet Users] Re: Puppet agent fails collect packages for puppet "Cannot collect packages for Puppet::Type::package::ProviderYum provider; Failed to list packages"

2019-10-17 Thread KevinR
I sometimes have this issue on one particular node, the cause is that the Yum database gets corrupted on that node sometimes. I've built this Puppet Task to repair the database when it happens: #!/bin/bash rm -f /var/lib/rpm/__db* rpm --rebuilddb yum clean all yum check-update if [ $? == 100 ];

[Puppet Users] Re: puppet bolt templates ??

2019-09-19 Thread KevinR
You do it as follows: plan puppet6::puppet_upgrade( TargetSpec $nodes, ) { $targets = get_targets($nodes) $targets.each |$target| { apply($nodes) { class { 'puppet6::upgrade': location => $target.vars['location'] } } } } -Kevin On Thursday, September 19, 2019 at 12:00:18

[Puppet Users] Re: puppet bolt templates ??

2019-09-18 Thread KevinR
Yes to all of the above :-) 1) Within Apply blocks, you can leverage Hiera data from the module. Simply put a hiera.yaml in the root of the module to define where Hiera data should be read from 2) While Hiera is nice, it might be even more powerful (depending on the use case) to leverage the n

[Puppet Users] Re: puppet bolt templates ??

2019-09-17 Thread KevinR
Yes that will work, there are a few erros in your code though: - $location should not be quoted when calling epp() - the name of the variable for epp should not begin with $ class profiles::upgrade ($location = undef) { file { '/root/my_file.txt': ensure => file, content => epp('my

[Puppet Users] Re: puppet bolt templates ??

2019-09-17 Thread KevinR
Hi Andy, you can do this with an Apply block in your plan: apply_prep($nodes) apply($nodes, '_run_as' => 'root'){ file { '/root/my_file.txt': ensure => file, content => epp('my_module/my_file.epp', { 'my_param' => 'my_value' }) } } For the above example, you'll need to create a dir

[Puppet Users] Re: bootstrap windows 2016 ami, puppet 6

2019-04-29 Thread KevinR
It could be either the Powershell ExecutionPolicy, or simply a failure to resolve the hostname of your Puppet server. Or it could be an SSL problem, if the hostname you're using for the Master doesn't appear in the list of Subject Alternative Names in the SSL cert on the master. Try this user_d

Re: [Puppet Users] Re: Pass parameters to the 'postgresql' module when instantiated as a dependency of the 'puppetdb' module

2018-10-18 Thread KevinR
Hi Eirik, I can't speak for those antique 2.x/3.x versions ;-) The automatic parameter lookup feature is available from Puppet 4.8 onwards, see the official description of it here . As you can see from the documentation, setting parameter

Re: [Puppet Users] Re: Pass parameters to the 'postgresql' module when instantiated as a dependency of the 'puppetdb' module

2018-10-18 Thread KevinR
Hi Eirik, the parameter behavior is actually the other way around: class foo:bar( $param1, # This enables you to provide 'param1' when instantiating the class, # and it enables auto-parameter-lookup for foo::bar::param1 in Hiera. # if no value is given

[Puppet Users] Re: New Deferred type and agent data lookups in Puppet 6

2018-08-31 Thread KevinR
-tenant network scenarios, where PE is on an isolated network, with agents on customers networks that use NAT to reach the PE master. -KevinR On Friday, August 31, 2018 at 1:33:02 PM UTC+2, bert hajee wrote: > > Lindsy, > > Is it just ment for this use case? I can think of other situation

[Puppet Users] Re: New Deferred type and agent data lookups in Puppet 6

2018-08-31 Thread KevinR
E is on an isolated network, with agents on customers networks that use NAT to reach the PE master. -KevinR On Friday, August 31, 2018 at 2:11:52 AM UTC+2, Lindsey Smith wrote: > > Hi all, > > We wanted to let you know about an upcoming capability, the Deferred type, > that is now pres