[Puppet Users] Re: issue creating symlink

2016-05-09 Thread Peter Faller
Maybe all you need is: file { 'docroot': path => '/var/www/html', ensure=> link, force => true, target=> '/vagrant/public', } -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop

Re: [Puppet Users] Hiera Error 400 on SERVER: Could not find data item classes in any Hiera data file and no default supplied

2016-04-20 Thread Peter Faller
Ugo, I think you need: classes: - ntp ... instead of: classes: ntp ... to make 'classes' an array instead of a simple value. -- 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,

[Puppet Users] Re: puppet master status

2016-07-07 Thread Peter Faller
# netstat -ntap | grep 8140 ... will show what (if anything) is listening on port 8140. -- 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] Re: most idiomatic way to set resource defaults

2016-07-08 Thread Peter Faller
Are you using the create_resources function to instantiate the resources? It takes a third argument containing default values: $widgets = hiera('widgets', {}) $widget_defaults = hiera('widget_defaults', {}) create_resources(::widget, $widgets, $widget_defaults) -- You received this message

Re: [Puppet Users] Is it possible to gracefully exit the puppet agent run after sending facts?

2016-07-08 Thread Peter Faller
Would 'puppet agent --test --noop' be an option? -- 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

[Puppet Users] Re: Module Dependency Best Practices

2017-02-23 Thread Peter Faller
Have a look at virtual resources: https://docs.puppet.com/puppet/4.9/lang_virtual.html "Although virtual resources can only be *declared* once, they can be *realized* any number of times (much as a class can be included

[Puppet Users] Re: Error 500 on SERVER: Server Error: Not authorized to call find on /file_metadata/files/

2017-02-16 Thread Peter Faller
Where does the file 'nombre.sh' live on your Puppet master? Is it in the 'files/' directory in your module? In that case you should use 'puppet:///modules//nombre.sh' On Friday, 17 February 2017 02:31:57 UTC+2, Gustavo Moreno Fernández wrote: > > Hi, > > -- You received this message because

[Puppet Users] Re: Debugging confusion !?

2017-01-16 Thread Peter Faller
It looks like the installation of redis is failing because the user 'redis' already exists; and the directory /home/username/myapp-new/config does not exist or is not writeable ... On Friday, 13 January 2017 20:10:00 UTC+2, Steve Button wrote: > > Error: Execution of '/usr/bin/apt-get -q -y -o

[Puppet Users] Re: -Configuring 1000 servers to install software packages in one go.

2016-08-24 Thread Peter Faller
You can use wildcarded node names in the manifest, if you have many hosts that require the same configuration. -- 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] Re: Puppet hiera error

2016-09-26 Thread Peter Faller
Have you created any of the Hiera data files (common.yaml, site/*.yaml, etc.)? There does not appear to be a definition of which classes to include. If you change hiera_include('classes') to hiera_include('classes', []) the error message should go away (because [] provides a default empty

[Puppet Users] Re: Use a puppet or hiera variable in hiera

2016-09-30 Thread Peter Faller
Have you considered using an external node classifier instead? -- 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

Re: [Puppet Users] Order of removal of resources

2016-09-21 Thread Peter Faller
That was a contrived, simplified example. The real situation is much more complicated. -- 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

Re: [Puppet Users] Order of removal of resources

2016-09-21 Thread Peter Faller
Thanks Craig - that does work, but what it says in the documentation is true: "Note: Chained collectors can potentially cause huge dependency cycles and should be used carefully." This approach works fine

[Puppet Users] Order of removal of resources

2016-09-21 Thread Peter Faller
What is the effect of the 'require' metaparameter when ensure is set to absent, i.e. when a resource is removed? It seems that changes to the required resource are applied before changes to the requiring resource are applied - is that always the case? When one resource (R1) depends on another

[Puppet Users] Re: name resolver

2016-11-14 Thread Peter Faller
Hi Albert Here's a custom parser function that can resolve names: require "resolv" module Puppet::Parser::Functions newfunction( :name2ip, :type => :rvalue, :doc => "name2ip( hostname ) => ip_address" ) do |arguments| raise(Puppet::ParseError, "name2ip(): Wrong number of

[Puppet Users] Re: subscribe vs notify

2016-10-10 Thread Peter Faller
Hi Andrew 'subscribe' is not a type - it's a metaparameter, and it still exists. See: https://docs.puppet.com/puppet/4.7/reference/lang_relationships.html On Monday, 10 October 2016 04:57:42 UTC+2, Andrew wrote: > > > -- You received this message because you are subscribed to the Google

Re: [Puppet Users] Puppet Language Style Guide update

2017-01-12 Thread Peter Faller
Has the Gepetto auto-formatter been updated (or will it be updated) to match the style guide? Or is there another way of automatically formatting manifests to match the style guide? > > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To

[Puppet Users] Re: Augeas-1.5.0 to edit file using Puppet

2017-03-30 Thread Peter Faller
Is there any reason you're not using the built-in 'host' type? For example, this adds an entry to /etc/hosts: host {'north.xyz.com': ip => '192.168.100.2', host_aliases => [ 'north', 'main-switch' ], } On Thursday, 30 March 2017 09:55:33 UTC+2, Shrawan Bhagwat wrote: > >

[Puppet Users] Re: hiera_include('classes') fails with "undefined method `downcase' for nil:NilClass"

2017-04-21 Thread Peter Faller
First step would be to find where you're using 'downcase' ... Error while evaluating a Function Call, undefined method `downcase' for nil:NilClass ... and work from there. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from

[Puppet Users] Re: [ANN] Puppet Development Kit (pdk) 1.0

2017-08-16 Thread Peter Faller
Seems to be a hitch with the Windows install on Windows 8.1: I installed pdk-1.0.0.1-x64.msi; opened a new powershell window, and found that while pdk works, the PATH is wrong: modules> $env:path C:\Program Files\Puppet Labs\DevelopmentKit\\bin;%PATH% Any tips on how to correct this? On

[Puppet Users] Re: [ANN] Puppet Development Kit (pdk) 1.0

2017-08-16 Thread Peter Faller
BTW: changing line 3 in C:\Program Files\WindowsPowerShell\Modules\PuppetDevelopmentKit\PuppetDevelopmentKit.psm1 to: $env:PATH = "$($env:DEVKIT_BASEDIR)\bin;"+$env:PATH ... fixes it. On Wednesday, 16 August 2017 14:06:23 UTC+2, Peter Faller wrote: > > ... > &

[Puppet Users] PDK 1.0.0.1 on Windows

2017-08-17 Thread Peter Faller
While trying to use the PDK on Windows (instead of using a Linux VM for development), I've come across a few hitches: 1) 'rake' is not available as a command (it is accessible via $env:DEVKIT_BASEDIR/private/private\ruby\2.1.9\bin\rake though) 2) 'rspec' is not available as a command 3) errors

Re: [Puppet Users] PDK 1.0.0.1 on Windows

2017-08-17 Thread Peter Faller
Hi David Thanks for pointing out 'pdk bundle' - it does provide what I was looking for. It is however a bit noisy (but that's not a big deal): PS> pdk bundle exec -- rspec .\spec\classes\apg_base_spec.rb . Finished in 7.81 seconds (files took 1.85 seconds to load) 1 example, 0 failures

[Puppet Users] Re: facter details copy to central location

2017-07-25 Thread Peter Faller
Have you looked at Puppet DB? (There's also a record of facts in /var/lib/puppet/yaml/facts/ for Puppet 3.x - might be available in Puppet 4 and 5 too.) On Tuesday, 25 July 2017 16:59:31 UTC+2, Amber Mehra wrote: > > Hey Guys, > > I have certain requirement to get puppet client inventory like

[Puppet Users] Re: puppet agent running on same host as puppet server, possible cert issues

2017-07-04 Thread Peter Faller
Is the puppet agent running as the same user when run as a daemon and when run via 'puppet agent' from the command line? I've seen that make a difference. On Monday, 3 July 2017 15:49:06 UTC+2, aaron@gmail.com wrote: > > >>> >>> -- You received this message because you are subscribed to

[Puppet Users] Re: How to get remote node ip

2017-07-04 Thread Peter Faller
If you know what physical interface that address is on, you can use 'ipaddress_ens33' for example: # facter --puppet | fgrep interface interfaces => ens32,ens33,lo # facter --puppet | fgrep ip ipaddress => 192.168.51.106 ipaddress_ens32 => 192.168.51.106 ipaddress_ens33 => 192.168.53.106

Re: [Puppet Users] PDK 1.0.0.1 on Windows

2017-08-17 Thread Peter Faller
Hi David Reduced example manifest and test attached ... On Linux: [root@tstpuppet01 rimcdm]# rspec spec/defines/test_reduced_spec.rb . Finished in 0.79952 seconds (files took 2.66 seconds to load) 1 example, 0 failures On Windows: PS rimcdm> pdk bundle exec -- rspec

Re: [Puppet Users] PDK 1.0.0.1 on Windows

2017-08-18 Thread Peter Faller
Thanks David - the combination of rspec-puppet-facts and 'operatingsystem_support' in metadata.json makes it work. On Thursday, 17 August 2017 18:22:24 UTC+2, David Schmitt wrote: > > > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To

[Puppet Users] Re: running puppet apply during kickstart preseed in ubuntu

2017-06-12 Thread Peter Faller
A few questions ... : - does your kickstart successfully install the Puppet agent package? - are you running 'puppet apply' with the correct $PATH (or with a full path to the puppet executable)? - what errors are reported by your %post script? On Monday, 12 June 2017 14:55:45 UTC+2, Free4All

Re: [Puppet Users] Re: running puppet apply during kickstart preseed in ubuntu

2017-06-13 Thread Peter Faller
I've only used kickstart for RedHat and CentOS; but I believe it is almost the same for Ubuntu. What I would suggest is that you catch the output of the %post script like this: %post --log=/root/ks-post.log ... %end ... and then include lots of 'echo' commands to debug. By the time %post

[Puppet Users] Re: puppet agent running on same host as puppet server, possible cert issues

2017-06-19 Thread Peter Faller
You can specify which client certificate(s) to clean by means of: # puppet cert clean On Friday, 16 June 2017 00:31:57 UTC+2, aaron@gmail.com wrote: > > I'm running into an issue on one of our puppet4 servers where the agent > only works when run as 'puppet agent -t' but fails when run

[Puppet Users] Re: New puppet user

2017-06-19 Thread Peter Faller
If you're running without a master, Puppet won't automatically apply your manifests. You can put them anywhere; and then set up (for example, if you want the manifest applied periodically) a cron job to run 'puppet apply '. On Friday, 16 June 2017 00:32:05 UTC+2, Vladimir wrote: > > > > I

[Puppet Users] Re: running puppet apply during kickstart preseed in ubuntu

2017-06-13 Thread Peter Faller
Even if the puppet-agent package is installed, the location of the puppet executable won't be in the PATH environment variable. What you probably need is to change it to e.g.: /opt/puppetlabs/bin/puppet apply /cdrom/puppet/install.pp On Monday, 12 June 2017 16:23:38 UTC+2, Free4All User

[Puppet Users] Unable to diff catalogs - undefined method 'version'

2017-09-01 Thread Peter Faller
Even when trying to compare a minimal catalog ('node tstpuppet01.localdomain {}') to itself, I get an error: # puppet master --environment trunk_9_4_0_0 --compile tstpuppet01.localdomain > /tmp/tstpuppet01.localdomain.new.pson # puppet catalog diff --debug tstpuppet01.localdomain.new.pson

[Puppet Users] Re: Duplicate declaration error - what's the correct approach to avoid this?

2017-11-23 Thread Peter Faller
On Thursday, 23 November 2017 16:47:44 UTC+2, buoyant_puppy wrote: > > Why does this: > class mymodule { > notify { "booboo": } > notify { "booboo": } > > provoke the error: > Error while evaluating a Resource Statement, Duplicate declaration: > Notify[booboo] is already declared

[Puppet Users] Re: Set environment variable for Service resource

2017-11-07 Thread Peter Faller
In general, I'd say you would have to put the variables into a configuration file for the service (via a template, or an augeas resource), or if the service is managed by systemd, in the relevant '???.service' file. On Tuesday, 7 November 2017 16:27:39 UTC+2, Andrei wrote: > > Hello, > is there

[Puppet Users] Re: Conditional actions based on result of other actions?

2017-12-20 Thread Peter Faller
Puppet resources have metaparameters like 'notify', 'subscribe', 'before', 'require' that make it possible to make things happen in the desired sequence; so it is possible to have 'exec' resources that trigger on some conditions. It might be going a bit beyond the intention of Puppet; but you

[Puppet Users] PSON.load fails when string contains e.g. "\n"

2018-01-07 Thread Peter Faller
I'm trying to preprocess some version 3.x catalogs to eliminate some false positives reported by 'puppet catalog diff'. I copied some code from the catalog diff source, and have ended up with (extraneous details omitted): #! /usr/bin/env ruby require 'puppet/external/pson/pure' require

Re: [Puppet Users] PSON.load fails when string contains e.g. "\n"

2018-01-18 Thread Peter Faller
Thanks Josh - adding 'require 'puppet'' does solve it! (Still a bit mysterious as to why it makes a difference; but this is something I only need temporarily, so that's OK) On Thursday, 11 January 2018 21:33:21 UTC+2, Josh Cooper wrote: > > > -- You received this message because you are

[Puppet Users] Re: Customizing existing types / providers

2018-02-05 Thread Peter Faller
Are the errata available as YUM packages? In that case it might be simpler to create a separate repository (using createrepo) and a Puppet yumrepo resource. On Friday, 2 February 2018 18:05:26 UTC+2, Andrew Schofield wrote: > > Hi all, > > I'm trying to customize the existing package type by