[Puppet Users] facter external fact tips?

2015-01-08 Thread Christopher Wood
(As background, I am attempting to create an is/oos toggle, for servers, in 
facter. Before I file bugs on two oddities, maybe somebody here could tell me 
if I'm misunderstanding something. I am using facter 2.3.0 from the puppetlabs 
apt/yum repositories, required from an external ruby script. I have confirmed 
no rvm/gem/etc. in my $PATH.)


1) how do I get booleans out of external facts?

With a custom fact I can use an unquoted true to get a TrueFalse, or quote the 
"true" to get a String. With an external fact the true is always a string. Is 
there some way to get a boolean from an external fact without turning a 
true/false/on/off string into a boolean in my script code?

(It's a bug if facter is supposed to do magic with external fact values, but 
that magic concept sounds a bit fishy.)

Example:

root@cwl:~# cat /var/lib/puppet/lib/facter/truefalseone.rb
Facter.add(:truefalseone) do
  setcode do
this="true"
  end
end
root@cwl:~# cat /etc/facter/facts.d/truefalsetwo.txt 
truefalsetwo=true
root@cwl:~# cat /tmp/cw2.rb 
#!/usr/bin/env ruby

require 'facter'

# https://groups.google.com/forum/#!topic/puppet-users/DV_tzOvPRSw
ENV['FACTERLIB'] = "/var/lib/puppet/lib/facter"

puts 'class of truefalseone custom fact: ' + 
Facter.value(:truefalseone).class.to_s
puts 'class of truefalsetwo external fact: ' + 
Facter.value(:truefalsetwo).class.to_s

root@cwl:~# ruby /tmp/cw2.rb 
class of truefalseone custom fact: String
class of truefalsetwo external fact: String


2) command line facter doesn't understand pluginsync'ed external facts

It's fine if I specify --external-dir on the command line, but not otherwise. 
Example:


root@cwl:~# cat /etc/facter/facts.d/truefalsetwo.txt 
truefalsetwo=true
root@cwl:~# facter truefalsetwo
true
root@cwl:~# mv /etc/facter/facts.d/truefalsetwo.txt /var/lib/puppet/facts.d/
root@cwl:~# facter truefalsetwo

root@cwl:~# facter -p truefalsetwo

root@cwl:~# facter --external-dir /var/lib/puppet/facts.d truefalsetwo
true

It looks like in 
https://github.com/puppetlabs/facter/blob/master/lib/facter/util/config.rb the 
@external_facts_dirs needs another entry?

Maybe there's an EXTFACTERLIB sort of dir to work like FACTERLIB? (Couldn't 
find one.)

-- 
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/20150108220257.GA18201%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Vagrant Puppetmaster Cert

2015-01-08 Thread Drew
Yep, that's exactly what I'm saying.  Like I said, it's weird.  Maybe 
something with the time?

Thanks!

On Tuesday, January 6, 2015 6:21:14 PM UTC-5, Felix.Frank wrote:
>
> Hi, 
>
> so are you saying that after SSL breaks, you can fix it by restarting 
> the service? 
>
> On 01/02/2015 08:39 PM, Drew wrote: 
> > Hey, 
> > 
> > I hope someone here can point me in the right direction.  I've been 
> > struggling with this for a few days and I can't seem to figure out 
> > what the issue is.  It's really strange.  I have a vagrant 
> > configuration that spins up a puppetmaster and a target machine that 
> > runs the agent.  When I initially do the 'vagrant up' all comes up and 
> > the agent is configured.  If I halt the puppetmaster and bring it back 
> > up, the agent fails to connect to the puppetmaster due to a 
> > certificate error.  If I simply restart the puppetmaster service, it 
> > connects without 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/810e0639-7b6e-4b5f-a941-10a1550ed650%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: many agents connecting at same time and 100+ nodes failed.

2015-01-08 Thread Christopher Wood
Yes it does, and that's something that you would configure to not happen at the 
same time (with fqdn_rand, or better, remote syslog).

https://docs.puppetlabs.com/references/latest/function.html#fqdnrand

I found some irritating hitches with running through a cut-down environment 
using mcollective (plugin re-sync, usual hiccoughs with mcollective in our 
environment), plus popular opinion here did not support adding to our lengthy 
list of cron jobs. Long story short, we are still running the puppet agent as a 
daemon. Which you would pick still depends on what criteria you are aiming for.

On Thu, Jan 08, 2015 at 04:40:05AM -0800, Suresh P wrote:
>Hi All,
> 
>I have found one more issue.   
>When we install puppet agent, it creates logrotate which will kill the
>puppet and restart it.   We have configured logroate for all the nodes at
>1st minute of everday(00:01).   Because of that all the node's puppet
>agent get reloaded at 00:01 minutes so all agents trying to connect the
>puppet masters at same polling interval.
> 
>Regards,
>Suresh.
> 
>On Tuesday, 11 November 2014 21:18:42 UTC+5:30, Christopher Wood wrote:
> 
>  Following up to myself since it turned out that running puppet agents
>  via cron was better for us due to one important feature...
> 
>  [cwood@client ~]$ mcod puppet runonce --environment=puppetupgrades
>  --no-splay -F hostname=puppetmasterlab
>  running: mco puppet -c /home/cwood/.mcollective.dev runonce
>  --environment=puppetupgrades --no-splay -F hostname=puppetmasterlab
> 
>   * [ > ] 1 /
>  1
> 
>  [1]puppetmasterlab.domain.com            Request Aborted
>     Cannot specify any custom puppet options when the daemon is running
> 
>  ...I can do agent runs using other environments with mcollective.
> 
>  It's interesting how things work out over time.
> 
>  On Thu, Nov 06, 2014 at 12:22:04PM -0500, Christopher Wood wrote:
>  > On Thu, Nov 06, 2014 at 09:28:32AM +0100, Felix Frank wrote:
>  > > On 11/06/2014 09:25 AM, [2]james.e...@fasthosts.com wrote:
>  > > >
>  > > > If that fails, you could try running the puppet agent from a cron
>  job
>  > > > instead with randomised start times as per the below link.
>  > >
>  > > +1
>  > >
>  > > I have yet to see a disadvantage of cron vs. the background agent.
>  >
>  > (Apparently I enjoy splitting tiny hairs in a thread branch. Possibly
>  rhubarbing on, but here goes.)
>  >
>  > Cultural...
>  >
>  > In my experience, it is easier to tell people that any host where an
>  agent is running is a puppetized host. I don't understand why it's more
>  difficult to read /etc/motd or grep root's crontab but that's probably
>  my view of things and not shared elsewhere. (This is more for the
>  transition period as everything goes under puppet management.)
>  >
>  > And then a manager might go and tell everybody that a host with an
>  agent running is a puppetized host and it's hard to go and change puppet
>  methods without requiring retraining. Your puzzlement at the difficulty
>  level of changing from agent to cron likely matches mine.
>  >
>  > Technological...
>  >
>  > The fqdn_rand() function doesn't necessarily spread things as evenly
>  as we might expect given randomness over large ranges. To illustrate,
>  fictional example:
>  >
>  > $ for x in `seq 1 1`; do echo "notice(fqdn_rand(60,
>  'host${x}.[3]cwood.com'))"; done >/tmp/xx.pp
>  > $ puppet apply --color=false /tmp/xx.pp | grep Scope | awk '{print
>  $3}' | sort | uniq -c | sort -rn >/tmp/yy
>  > $ head -5 /tmp/yy
>  >     199 1
>  >     195 51
>  >     188 52
>  >     184 55
>  >     184 48
>  > $ tail -5 /tmp/yy
>  >     151 9
>  >     150 46
>  >     145 5
>  >     144 2
>  >     141 19
>  >
>  > Obviously using cron I might choose something different than
>  run-on-a-random-minute, but I will still be a bit suspicious about this.
>  >
>  > Also, cron isn't necessarily good at running things intermittently
>  over less clock-friendly periods. If I'd like something to run every 47
>  minutes, just to pick, that's going to bit a bit harder to express with
>  cron.
>  >
>  >
>  >
>  > > --
>  > > 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 [4]puppet-users...@googlegroups.com.
>  > > To view this discussion on the web visit
>  
> [5]https://groups.google.com/d/msgid/puppet-users/545B3130.90007%40alumni.tu-berlin.de.
>  > > For more options, visit [6]https://groups.google.com/d/optout.
>  >
>  > --
>  

[Puppet Users] Re: Puppet master on Windows

2015-01-08 Thread Alejandro del Castillo
Hi Chris,

Before I saw your answer, I went ahead and installed puppet agent on 
Windows, thinking that it should get me most of the pieces needed for 
puppet master installed. I was pleasantly surprised to discover that puppet 
has a single entry point for master, agent, cert, etc, which means that the 
Windows installer already installed everything I needed to run puppet 
master.  To get the master running, I had to disable the Windows check that 
errors out if you try to run the master on Windows. I also had to bypass 
(make it a warning instead of an error), the check that tries to change the 
group of the puppet service. I then modified puppet.conf with windows 
values for ssldir and voila, that was it, puppet master launched correctly 
on windows. 

I was then able to connect a Linux agent, sign its certificate, and apply a 
simple manifest to it (write a file with the IP). I got a few errors about 
the agent not being able to retrieve pluginfacts and plugins, but the 
operation succeeded. 

This was a very simple proof of concept, but it did give me confidence that 
the main parts of puppet master work on Windows (signing certificates, 
compiling manifests, etc). There is still a ton of work to get everything 
working reliably, but is good to know that the main pieces are in place. I 
will definitely follow up with you if we decide to go this route.

Thanks for the help,

Alejandro del Castillo

On Monday, January 5, 2015 11:56:00 AM UTC-6, Chris Price wrote:
>
> On Monday, December 29, 2014 1:52:41 PM UTC-8, Alejandro del Castillo 
> wrote:
>>
>> Hello,
>>
>> We are looking at the different options out there to build a System 
>> Management solution for embedded systems. I am encouraged by the fact that 
>> puppet support opkg and it's already in use by OpenWRT (we build our own 
>> distribution, but it's opkg-based). Digging/experimenting around with 
>> puppet, it looks like it can do most of what we want. We would need to 
>> write several modules, custom UI, etc, but it looks doable. The only 
>> problem is that we absolutely must have Windows support for the host. That 
>> is a deal breaker requirement, as many of our customers (unfortunately) 
>> will expect Windows on the server side. As I am looking at options, I would 
>> like to understand what would be the effort for the Windows port of the 
>> server side components (at least puppet master, hiera, possibly puppetDB). 
>> I do get that this is not a priority for the community and do understand 
>> that if we take this approach, we would be maintaining the Windows server 
>> side, which is something that is on the table for us. 
>>
>>
>  Alejandro,
>
> Puppet Server and PuppetDB both run on the JVM, so, theoretically they 
> might "Just Work" on Windows.  We don't provide packaging, so you'd 
> probably need to just try running them from source. 
>
> Both projects have docs on how to run from source:
>
> https://docs.puppetlabs.com/puppetserver/1.0/dev_running_from_source.html
> https://docs.puppetlabs.com/puppetdb/latest/install_from_source.html
>
> Hiera, to some degree, is a kind of plugin that runs inside the server, so 
> it should work fine with Puppet Server.
>
> I'm not aware of any efforts to run these apps on Windows, so, your 
> mileage may vary... and I'm not aware of it being on our product roadmap to 
> provide official support for Windows on the server-side.  That said, I'm 
> not aware of any reason why it *shouldn't* work, so would be interested to 
> hear about your results if you decide to try it.
>

-- 
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/44dc1ace-30e3-4f21-b392-55224b365c8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Hiera doesn t behave as expected or as written in doc

2015-01-08 Thread Raphael
Got it !

Thx for these explanation :D

Le jeudi 8 janvier 2015 17:17:06 UTC+1, Martin Alfke a écrit :
>
>
> On 08 Jan 2015, at 17:12, Raphael > 
> wrote: 
>
> > Hi Martin, 
> > thx for this quick answer :] 
> > 
> > When in puppet you use hiera_hash, the behaviour is the same as the -h 
> option in cli ? 
>
> Yes. 
> CLI <-> Puppet: 
>
> hiera -a <-> hiera_array(…) 
> hiera -h <-> hiser_hash(…) 
> hiera <-> hiera(…) 
>
> > 
> > Le jeudi 8 janvier 2015 17:09:32 UTC+1, Martin Alfke a écrit : 
> > When using cli you want to tell hiera to look up all hashes: 
> > 
> > hiera -h site_users fqdn=myhost 
> > 
> > On 08 Jan 2015, at 17:02, Raphael  wrote: 
> > 
> > > Oh yeah ! Sorry for this noise ! The manifest on my nodes applyed 
> properly ... and I've got the the proper output from cli with the facts 
> provided. 
> > > 
> > > Regarding the lookup, here what I have : 
> > > 
> > > Based on https://docs.puppetlabs.com/hiera/1/lookup_types.html 
> > > 
> > > hiera site_users 
> > > {"bob"=>{"uid"=>501, "shell"=>"/bin/bash"}, 
> > >  "ash"=>{"uid"=>502, "shell"=>"/bin/zsh", "group"=>"common"}} 
> > > 
> > > 
> > > hiera site_users ::fqdn=myhost 
> > > {"jen"=>{"uid"=>503, "shell"=>"/bin/zsh", "group"=>"deglitch"}, 
> > >  "bob"=>{"uid"=>1000, "group"=>"deglitch"}} 
> > > 
> > > My hiera.yaml settings : 
> > > 
> > > :hierarchy: 
> > > 
> > >   - "node/%{::fqdn}" 
> > >   - common 
> > > 
> > > :merge_behavior: deeper 
> > > 
> > > What did I miss ? 
> > > 
> > > 
> > > 
> > > Le jeudi 8 janvier 2015 15:23:10 UTC+1, Johan De Wit a écrit : 
> > > Hi Raphael, 
> > > hiera smtpserver domain=example.com 
> > > 
> > > 
> > > That should work.  If using hiera from CLI, you need to provide the 
> facts etc also. 
> > > 
> > > See the docs : 
> > > https://docs.puppetlabs.com/hiera/1/command_line.html 
> > > 
> > > hth 
> > > 
> > > johan 
> > > 
> > > 
> > > On 08/01/15 09:52, Raphael wrote: 
> > >> Hi, 
> > >> I have a working puppetmaster installed from package on an ubuntu 
> server 14.04 64bits. 
> > >> I've been struggeling for a while now with hiera to achieve what it 
> is written in the doc ; 
> > >> 
> > >> My hiera version is 1.3.0 
> > >> Puppetmaster version 3.4.3 
> > >> 
> > >> My hierachy settings is quite simple, with a common file and a 
> specific file for host : 
> > >> 
> > >> --- 
> > >> :backends: 
> > >>   - yaml 
> > >>   - json 
> > >> :yaml: 
> > >>   :datadir: /etc/puppet/hieradata 
> > >> :json: 
> > >>   :datadir: /etc/puppet/hieradata 
> > >> :hierarchy: 
> > >> 
> > >>   - common 
> > >>   - "node/%{::fqdn}" 
> > >> 
> > >> :merge_behavior: deeper 
> > >> 
> > >> This file is in /etc/puppet/ and linked to /etc/hiera.yaml 
> > >> 
> > >> In the common.yaml, I'm trying to use a variable based on facts (like 
> in the example on the official documentation) : 
> > >> 
> > >> 
> > >> smtpserver: "mail.%{::domain}" 
> > >> 
> > >> When I issue hiera smtpserver, I have this output : 
> > >> 
> > >> 
> > >> mail. 
> > >> 
> > >> Even the lookup type (deeper here in my config) doesn t provide the 
> same output as the example ... 
> > >> 
> > >> Any idea ? version issue ? 
> > >> 
> > >> Thx a lot for your advice / answer. 
> > >> 
> > >> -- 
> > >> 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/3590c684-299f-4775-a12a-f241ab06f75d%40googlegroups.com.
>  
>
> > >> For more options, visit https://groups.google.com/d/optout. 
> > > 
> > > 
> > > -- 
> > > Johan De Wit 
> > > 
> > > Open Source Consultant 
> > > 
> > > Red Hat Certified Engineer  (805008667232363) 
> > > Puppet Certified Professional 2013/2014 (PCP006) 
> > > blog : 
> > > http://johan.koewacht.net/ 
> > > 
> > > __ 
> > > ___ 
> > >   
> > > Open-Future Phone +32 (0)2/255 70 70 
> > > Zavelstraat 72  Fax   +32 (0)2/255 70 71 
> > > 3071 KORTENBERG Mobile+32 (0)474/42 40 73 
> > > BELGIUM 
> > > http://www.open-future.be 
> > > 
> > > __ 
> > > ___ 
> > >   
> > > 
> > > 
> > > Upcoming Events: 
> > > 
> > > Zabbix Certified Specialist | 
> http://www.open-future.be/zabbix-certified-professional-training-8th-till-9th-janaury
>  
> > > 
> > > Zabbix Certified Professional | 
> http://www.open-future.be/zabbix-certified-professional-training-8th-till-9th-janaury
>  
> > > 
> > > Bacula Administrator 1 | 
> http://www.open-future.be/bacula-administrator-i-training-13th-till-15th-january
>  
> > > 
> > > Puppet Fundamentals | 
> http://www.open-future.be/puppet-fundamentals-training-26th-till-28th-january 
> > > 
> > > Puppet Architect | 
> http://www.open-future.be/puppet-arc

Re: [Puppet Users] Hiera doesn t behave as expected or as written in doc

2015-01-08 Thread Martin Alfke

On 08 Jan 2015, at 17:12, Raphael  wrote:

> Hi Martin,
> thx for this quick answer :]
> 
> When in puppet you use hiera_hash, the behaviour is the same as the -h option 
> in cli ?

Yes.
CLI <-> Puppet:

hiera -a <-> hiera_array(…)
hiera -h <-> hiser_hash(…)
hiera <-> hiera(…)

> 
> Le jeudi 8 janvier 2015 17:09:32 UTC+1, Martin Alfke a écrit :
> When using cli you want to tell hiera to look up all hashes: 
> 
> hiera -h site_users fqdn=myhost 
> 
> On 08 Jan 2015, at 17:02, Raphael  wrote: 
> 
> > Oh yeah ! Sorry for this noise ! The manifest on my nodes applyed properly 
> > ... and I've got the the proper output from cli with the facts provided. 
> > 
> > Regarding the lookup, here what I have : 
> > 
> > Based on https://docs.puppetlabs.com/hiera/1/lookup_types.html 
> > 
> > hiera site_users 
> > {"bob"=>{"uid"=>501, "shell"=>"/bin/bash"}, 
> >  "ash"=>{"uid"=>502, "shell"=>"/bin/zsh", "group"=>"common"}} 
> > 
> > 
> > hiera site_users ::fqdn=myhost 
> > {"jen"=>{"uid"=>503, "shell"=>"/bin/zsh", "group"=>"deglitch"}, 
> >  "bob"=>{"uid"=>1000, "group"=>"deglitch"}} 
> > 
> > My hiera.yaml settings : 
> > 
> > :hierarchy: 
> > 
> >   - "node/%{::fqdn}" 
> >   - common 
> > 
> > :merge_behavior: deeper 
> > 
> > What did I miss ? 
> > 
> > 
> > 
> > Le jeudi 8 janvier 2015 15:23:10 UTC+1, Johan De Wit a écrit : 
> > Hi Raphael, 
> > hiera smtpserver domain=example.com 
> > 
> > 
> > That should work.  If using hiera from CLI, you need to provide the facts 
> > etc also. 
> > 
> > See the docs : 
> > https://docs.puppetlabs.com/hiera/1/command_line.html 
> > 
> > hth 
> > 
> > johan 
> > 
> > 
> > On 08/01/15 09:52, Raphael wrote: 
> >> Hi, 
> >> I have a working puppetmaster installed from package on an ubuntu server 
> >> 14.04 64bits. 
> >> I've been struggeling for a while now with hiera to achieve what it is 
> >> written in the doc ; 
> >> 
> >> My hiera version is 1.3.0 
> >> Puppetmaster version 3.4.3 
> >> 
> >> My hierachy settings is quite simple, with a common file and a specific 
> >> file for host : 
> >> 
> >> --- 
> >> :backends: 
> >>   - yaml 
> >>   - json 
> >> :yaml: 
> >>   :datadir: /etc/puppet/hieradata 
> >> :json: 
> >>   :datadir: /etc/puppet/hieradata 
> >> :hierarchy: 
> >> 
> >>   - common 
> >>   - "node/%{::fqdn}" 
> >> 
> >> :merge_behavior: deeper 
> >> 
> >> This file is in /etc/puppet/ and linked to /etc/hiera.yaml 
> >> 
> >> In the common.yaml, I'm trying to use a variable based on facts (like in 
> >> the example on the official documentation) : 
> >> 
> >> 
> >> smtpserver: "mail.%{::domain}" 
> >> 
> >> When I issue hiera smtpserver, I have this output : 
> >> 
> >> 
> >> mail. 
> >> 
> >> Even the lookup type (deeper here in my config) doesn t provide the same 
> >> output as the example ... 
> >> 
> >> Any idea ? version issue ? 
> >> 
> >> Thx a lot for your advice / answer. 
> >> 
> >> -- 
> >> 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/3590c684-299f-4775-a12a-f241ab06f75d%40googlegroups.com.
> >>  
> >> For more options, visit https://groups.google.com/d/optout. 
> > 
> > 
> > -- 
> > Johan De Wit 
> > 
> > Open Source Consultant 
> > 
> > Red Hat Certified Engineer  (805008667232363) 
> > Puppet Certified Professional 2013/2014 (PCP006) 
> > blog : 
> > http://johan.koewacht.net/ 
> > 
> > __ 
> > ___ 
> >   
> > Open-Future Phone +32 (0)2/255 70 70 
> > Zavelstraat 72  Fax   +32 (0)2/255 70 71 
> > 3071 KORTENBERG Mobile+32 (0)474/42 40 73 
> > BELGIUM 
> > http://www.open-future.be 
> > 
> > __ 
> > ___ 
> >   
> > 
> > 
> > Upcoming Events: 
> > 
> > Zabbix Certified Specialist | 
> > http://www.open-future.be/zabbix-certified-professional-training-8th-till-9th-janaury
> >  
> > 
> > Zabbix Certified Professional | 
> > http://www.open-future.be/zabbix-certified-professional-training-8th-till-9th-janaury
> >  
> > 
> > Bacula Administrator 1 | 
> > http://www.open-future.be/bacula-administrator-i-training-13th-till-15th-january
> >  
> > 
> > Puppet Fundamentals | 
> > http://www.open-future.be/puppet-fundamentals-training-26th-till-28th-january
> >  
> > 
> > Puppet Architect | 
> > http://www.open-future.be/puppet-architect-training-29th-till-30th-january 
> > 
> > Subscribe to our newsletter: http://eepurl.com/BUG8H 
> > 
> > 
> > 
> > -- 
> > 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 vie

Re: [Puppet Users] Hiera doesn t behave as expected or as written in doc

2015-01-08 Thread Raphael
Hi Martin,
thx for this quick answer :]

When in puppet you use hiera_hash, the behaviour is the same as the -h 
option in cli ?

Le jeudi 8 janvier 2015 17:09:32 UTC+1, Martin Alfke a écrit :
>
> When using cli you want to tell hiera to look up all hashes: 
>
> hiera -h site_users fqdn=myhost 
>
> On 08 Jan 2015, at 17:02, Raphael > 
> wrote: 
>
> > Oh yeah ! Sorry for this noise ! The manifest on my nodes applyed 
> properly ... and I've got the the proper output from cli with the facts 
> provided. 
> > 
> > Regarding the lookup, here what I have : 
> > 
> > Based on https://docs.puppetlabs.com/hiera/1/lookup_types.html 
> > 
> > hiera site_users 
> > {"bob"=>{"uid"=>501, "shell"=>"/bin/bash"}, 
> >  "ash"=>{"uid"=>502, "shell"=>"/bin/zsh", "group"=>"common"}} 
> > 
> > 
> > hiera site_users ::fqdn=myhost 
> > {"jen"=>{"uid"=>503, "shell"=>"/bin/zsh", "group"=>"deglitch"}, 
> >  "bob"=>{"uid"=>1000, "group"=>"deglitch"}} 
> > 
> > My hiera.yaml settings : 
> > 
> > :hierarchy: 
> > 
> >   - "node/%{::fqdn}" 
> >   - common 
> > 
> > :merge_behavior: deeper 
> > 
> > What did I miss ? 
> > 
> > 
> > 
> > Le jeudi 8 janvier 2015 15:23:10 UTC+1, Johan De Wit a écrit : 
> > Hi Raphael, 
> > hiera smtpserver domain=example.com 
> > 
> > 
> > That should work.  If using hiera from CLI, you need to provide the 
> facts etc also. 
> > 
> > See the docs : 
> > https://docs.puppetlabs.com/hiera/1/command_line.html 
> > 
> > hth 
> > 
> > johan 
> > 
> > 
> > On 08/01/15 09:52, Raphael wrote: 
> >> Hi, 
> >> I have a working puppetmaster installed from package on an ubuntu 
> server 14.04 64bits. 
> >> I've been struggeling for a while now with hiera to achieve what it is 
> written in the doc ; 
> >> 
> >> My hiera version is 1.3.0 
> >> Puppetmaster version 3.4.3 
> >> 
> >> My hierachy settings is quite simple, with a common file and a specific 
> file for host : 
> >> 
> >> --- 
> >> :backends: 
> >>   - yaml 
> >>   - json 
> >> :yaml: 
> >>   :datadir: /etc/puppet/hieradata 
> >> :json: 
> >>   :datadir: /etc/puppet/hieradata 
> >> :hierarchy: 
> >> 
> >>   - common 
> >>   - "node/%{::fqdn}" 
> >> 
> >> :merge_behavior: deeper 
> >> 
> >> This file is in /etc/puppet/ and linked to /etc/hiera.yaml 
> >> 
> >> In the common.yaml, I'm trying to use a variable based on facts (like 
> in the example on the official documentation) : 
> >> 
> >> 
> >> smtpserver: "mail.%{::domain}" 
> >> 
> >> When I issue hiera smtpserver, I have this output : 
> >> 
> >> 
> >> mail. 
> >> 
> >> Even the lookup type (deeper here in my config) doesn t provide the 
> same output as the example ... 
> >> 
> >> Any idea ? version issue ? 
> >> 
> >> Thx a lot for your advice / answer. 
> >> 
> >> -- 
> >> 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/3590c684-299f-4775-a12a-f241ab06f75d%40googlegroups.com.
>  
>
> >> For more options, visit https://groups.google.com/d/optout. 
> > 
> > 
> > -- 
> > Johan De Wit 
> > 
> > Open Source Consultant 
> > 
> > Red Hat Certified Engineer  (805008667232363) 
> > Puppet Certified Professional 2013/2014 (PCP006) 
> > blog : 
> > http://johan.koewacht.net/ 
> > 
> > __ 
> > ___ 
> >   
> > Open-Future Phone +32 (0)2/255 70 70 
> > Zavelstraat 72  Fax   +32 (0)2/255 70 71 
> > 3071 KORTENBERG Mobile+32 (0)474/42 40 73 
> > BELGIUM 
> > http://www.open-future.be 
> > 
> > __ 
> > ___ 
> >   
> > 
> > 
> > Upcoming Events: 
> > 
> > Zabbix Certified Specialist | 
> http://www.open-future.be/zabbix-certified-professional-training-8th-till-9th-janaury
>  
> > 
> > Zabbix Certified Professional | 
> http://www.open-future.be/zabbix-certified-professional-training-8th-till-9th-janaury
>  
> > 
> > Bacula Administrator 1 | 
> http://www.open-future.be/bacula-administrator-i-training-13th-till-15th-january
>  
> > 
> > Puppet Fundamentals | 
> http://www.open-future.be/puppet-fundamentals-training-26th-till-28th-january 
> > 
> > Puppet Architect | 
> http://www.open-future.be/puppet-architect-training-29th-till-30th-january 
> > 
> > Subscribe to our newsletter: http://eepurl.com/BUG8H 
> > 
> > 
> > 
> > -- 
> > 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/1f7b7077-33bd-4511-bb81-39696c2b%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d

Re: [Puppet Users] Hiera doesn t behave as expected or as written in doc

2015-01-08 Thread Martin Alfke
When using cli you want to tell hiera to look up all hashes:

hiera -h site_users fqdn=myhost

On 08 Jan 2015, at 17:02, Raphael  wrote:

> Oh yeah ! Sorry for this noise ! The manifest on my nodes applyed properly 
> ... and I've got the the proper output from cli with the facts provided.
> 
> Regarding the lookup, here what I have :
> 
> Based on https://docs.puppetlabs.com/hiera/1/lookup_types.html
> 
> hiera site_users
> {"bob"=>{"uid"=>501, "shell"=>"/bin/bash"},
>  "ash"=>{"uid"=>502, "shell"=>"/bin/zsh", "group"=>"common"}}
> 
> 
> hiera site_users ::fqdn=myhost
> {"jen"=>{"uid"=>503, "shell"=>"/bin/zsh", "group"=>"deglitch"},
>  "bob"=>{"uid"=>1000, "group"=>"deglitch"}}
> 
> My hiera.yaml settings :
> 
> :hierarchy:
> 
>   - "node/%{::fqdn}"
>   - common
> 
> :merge_behavior: deeper
> 
> What did I miss ?
> 
> 
> 
> Le jeudi 8 janvier 2015 15:23:10 UTC+1, Johan De Wit a écrit :
> Hi Raphael, 
> hiera smtpserver domain=example.com
> 
> 
> That should work.  If using hiera from CLI, you need to provide the facts etc 
> also.
> 
> See the docs : 
> https://docs.puppetlabs.com/hiera/1/command_line.html
> 
> hth 
> 
> johan
> 
> 
> On 08/01/15 09:52, Raphael wrote:
>> Hi,
>> I have a working puppetmaster installed from package on an ubuntu server 
>> 14.04 64bits.
>> I've been struggeling for a while now with hiera to achieve what it is 
>> written in the doc ;
>> 
>> My hiera version is 1.3.0
>> Puppetmaster version 3.4.3
>> 
>> My hierachy settings is quite simple, with a common file and a specific file 
>> for host : 
>> 
>> ---
>> :backends:
>>   - yaml
>>   - json
>> :yaml:
>>   :datadir: /etc/puppet/hieradata
>> :json:
>>   :datadir: /etc/puppet/hieradata
>> :hierarchy:
>> 
>>   - common
>>   - "node/%{::fqdn}"
>> 
>> :merge_behavior: deeper
>> 
>> This file is in /etc/puppet/ and linked to /etc/hiera.yaml
>> 
>> In the common.yaml, I'm trying to use a variable based on facts (like in the 
>> example on the official documentation) :
>> 
>> 
>> smtpserver: "mail.%{::domain}"
>> 
>> When I issue hiera smtpserver, I have this output :
>> 
>> 
>> mail.
>> 
>> Even the lookup type (deeper here in my config) doesn t provide the same 
>> output as the example ...
>> 
>> Any idea ? version issue ?
>> 
>> Thx a lot for your advice / answer.
>> 
>> -- 
>> 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/3590c684-299f-4775-a12a-f241ab06f75d%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> Johan De Wit
> 
> Open Source Consultant
> 
> Red Hat Certified Engineer  (805008667232363)
> Puppet Certified Professional 2013/2014 (PCP006)
> blog : 
> http://johan.koewacht.net/
> 
> __
> ___
>  
> Open-Future Phone +32 (0)2/255 70 70
> Zavelstraat 72  Fax   +32 (0)2/255 70 71
> 3071 KORTENBERG Mobile+32 (0)474/42 40 73
> BELGIUM 
> http://www.open-future.be
> 
> __
> ___
>  
> 
> 
> Upcoming Events:
> 
> Zabbix Certified Specialist | 
> http://www.open-future.be/zabbix-certified-professional-training-8th-till-9th-janaury
> 
> Zabbix Certified Professional | 
> http://www.open-future.be/zabbix-certified-professional-training-8th-till-9th-janaury
> 
> Bacula Administrator 1 | 
> http://www.open-future.be/bacula-administrator-i-training-13th-till-15th-january
> 
> Puppet Fundamentals | 
> http://www.open-future.be/puppet-fundamentals-training-26th-till-28th-january
> 
> Puppet Architect | 
> http://www.open-future.be/puppet-architect-training-29th-till-30th-january
> 
> Subscribe to our newsletter: http://eepurl.com/BUG8H
> 
> 
> 
> -- 
> 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/1f7b7077-33bd-4511-bb81-39696c2b%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/8F175A26-EF5B-4D75-A16A-D704B9A6F7F9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Hiera doesn t behave as expected or as written in doc

2015-01-08 Thread Raphael
Oh yeah ! Sorry for this noise ! The manifest on my nodes applyed properly 
... and I've got the the proper output from cli with the facts provided.

Regarding the lookup, here what I have :

Based on https://docs.puppetlabs.com/hiera/1/lookup_types.html

hiera site_users
{"bob"=>{"uid"=>501, "shell"=>"/bin/bash"},
 "ash"=>{"uid"=>502, "shell"=>"/bin/zsh", "group"=>"common"}}


hiera site_users ::fqdn=myhost
{"jen"=>{"uid"=>503, "shell"=>"/bin/zsh", "group"=>"deglitch"},
 "bob"=>{"uid"=>1000, "group"=>"deglitch"}}

My hiera.yaml settings :

:hierarchy:

  - "node/%{::fqdn}"
  - common

:merge_behavior: deeper

What did I miss ?



Le jeudi 8 janvier 2015 15:23:10 UTC+1, Johan De Wit a écrit :
>
>  Hi Raphael, 
>
> hiera smtpserver domain=example.com
>
> That should work.  If using hiera from CLI, you need to provide the facts etc 
> also.
>
> See the docs : https://docs.puppetlabs.com/hiera/1/command_line.html
>
>
> hth 
>
> johan
>
>
> On 08/01/15 09:52, Raphael wrote:
>  
> Hi,
> I have a working puppetmaster installed from package on an ubuntu server 
> 14.04 64bits.
> I've been struggeling for a while now with hiera to achieve what it is 
> written in the doc ;
>
> My hiera version is 1.3.0
> Puppetmaster version 3.4.3
>
> My hierachy settings is quite simple, with a common file and a specific 
> file for host : 
>
>  ---
> :backends:
>   - yaml
>   - json
> :yaml:
>   :datadir: /etc/puppet/hieradata
> :json:
>   :datadir: /etc/puppet/hieradata
> :hierarchy:
>
>   - common
>   - "node/%{::fqdn}"
>
> :merge_behavior: deeper
>  
> This file is in /etc/puppet/ and linked to /etc/hiera.yaml
>
> In the common.yaml, I'm trying to use a variable based on facts (like in 
> the example on the official documentation) :
>
> smtpserver: "mail.%{::domain}"
> When I issue hiera smtpserver, I have this output :
>
> mail.
>
> Even the lookup type (deeper here in my config) doesn t provide the same 
> output as the example ...
>
> Any idea ? version issue ?
>
> Thx a lot for your advice / answer.
>
>  -- 
> 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/3590c684-299f-4775-a12a-f241ab06f75d%40googlegroups.com
>  
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> -- 
> Johan De Wit
>
> Open Source Consultant
>
> Red Hat Certified Engineer  (805008667232363)
> Puppet Certified Professional 2013/2014 (PCP006)
> blog : http://johan.koewacht.net/
> _
>  
> Open-Future Phone +32 (0)2/255 70 70
> Zavelstraat 72  Fax   +32 (0)2/255 70 71
> 3071 KORTENBERG Mobile+32 (0)474/42 40 73
> BELGIUM http://www.open-future.be
> _
>  
>
>
> Upcoming Events:
>
> Zabbix Certified Specialist | 
> http://www.open-future.be/zabbix-certified-professional-training-8th-till-9th-janaury
>
> Zabbix Certified Professional | 
> http://www.open-future.be/zabbix-certified-professional-training-8th-till-9th-janaury
>
> Bacula Administrator 1 | 
> http://www.open-future.be/bacula-administrator-i-training-13th-till-15th-january
>
> Puppet Fundamentals | 
> http://www.open-future.be/puppet-fundamentals-training-26th-till-28th-january
>
> Puppet Architect | 
> http://www.open-future.be/puppet-architect-training-29th-till-30th-january
>
> Subscribe to our newsletter: http://eepurl.com/BUG8H
>  
> 

-- 
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/1f7b7077-33bd-4511-bb81-39696c2b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Install puppet agent via puppet master

2015-01-08 Thread Dan White

How about "yum install puppet" ?
The puppet master setup I built uses the $::fqdn for the certname, so on the 
agent, is it a basic install it and run it.  All the nitty-gritty details are 
done on the master.

“Sometimes I think the surest sign that intelligent life exists elsewhere in the 
universe is that none of it has tried to contact us.”  (Bill Waterson: Calvin & 
Hobbes)


On Jan 08, 2015, at 10:45 AM, kaustubh chaudhari  wrote:


There are other tools which can do it, like HPSA it will scan the n/w and 
install the agent on the system that you want.

With puppet no. The best option is already suggested. Have the agent installed 
in your template and deploy the vm using the template, you will have Puppet 
agent running on the new VM, for BareMetals you can use post install of your 
kickstart environment Or you can even explore Razor.

-HTH
Kaustubh

On Wednesday, January 7, 2015 8:47:04 AM UTC-5, jcbollinger wrote:



On Tuesday, January 6, 2015 5:45:51 AM UTC-6, jgopi ruizu wrote:

Is it possible to install a puppet agent on a new system by the puppet 
master?
If so how it works? 




The master is not magical.  It cannot do anything to other systems without 
their cooperation, which comes via the agent.


John


--
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/22ea442a-14aa-4c59-ba26-4e81b9b83cd1%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/e06c8955-297f-474d-b377-d01ff847c037%40me.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Install puppet agent via puppet master

2015-01-08 Thread kaustubh chaudhari
There are other tools which can do it, like HPSA it will scan the n/w and 
install the agent on the system that you want. 

With puppet no. The best option is already suggested. Have the agent 
installed in your template and deploy the vm using the template, you will 
have Puppet agent running on the new VM, for BareMetals you can use post 
install of your kickstart environment Or you can even explore Razor.

-HTH
Kaustubh

On Wednesday, January 7, 2015 8:47:04 AM UTC-5, jcbollinger wrote:
>
>
>
> On Tuesday, January 6, 2015 5:45:51 AM UTC-6, jgopi ruizu wrote:
>>
>> Is it possible to install a puppet agent on a new system by the puppet 
>> master?
>> If so how it works? 
>>
>
>
> The master is not magical.  It cannot do *anything* to other systems 
> without their cooperation, which comes via the agent.
>
>
> John
>
>

-- 
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/22ea442a-14aa-4c59-ba26-4e81b9b83cd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Hiera doesn t behave as expected or as written in doc

2015-01-08 Thread Johan De Wit

Hi Raphael,

hiera smtpserver domain=example.com

That should work.  If using hiera from CLI, you need to provide the facts etc 
also.

See the docs : https://docs.puppetlabs.com/hiera/1/command_line.html


hth

johan


On 08/01/15 09:52, Raphael wrote:

Hi,
I have a working puppetmaster installed from package on an ubuntu 
server 14.04 64bits.
I've been struggeling for a while now with hiera to achieve what it is 
written in the doc ;


My hiera version is 1.3.0
Puppetmaster version 3.4.3

My hierachy settings is quite simple, with a common file and a 
specific file for host :


|
---
:backends:
-yaml
-json
:yaml:
:datadir:/etc/puppet/hieradata
:json:
:datadir:/etc/puppet/hieradata
:hierarchy:

-common
-"node/%{::fqdn}"

:merge_behavior:deeper
|

This file is in /etc/puppet/ and linked to /etc/hiera.yaml

In the common.yaml, I'm trying to use a variable based on facts (like 
in the example on the official documentation) :


|
|
smtpserver:"mail.%{::domain}"
|

|When I issue hiera smtpserver, I have this output :

|
mail.
|

Even the lookup type (deeper here in my config) doesn t provide the same output 
as the example ...

Any idea ? version issue ?

Thx a lot for your advice / answer.
--
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/3590c684-299f-4775-a12a-f241ab06f75d%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.



--
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer  (805008667232363)
Puppet Certified Professional 2013/2014 (PCP006)
blog : http://johan.koewacht.net/
_
 
Open-Future Phone +32 (0)2/255 70 70

Zavelstraat 72  Fax   +32 (0)2/255 70 71
3071 KORTENBERG Mobile+32 (0)474/42 40 73
BELGIUM http://www.open-future.be
_
 



Next Events:
Zabbix Certified Training | 
http://www.open-future.be/zabbix-certified-specialist-training-5th-till-7th-january
Zabbix Certified Professional | 
http://www.open-future.be/zabbix-certified-professional-training-8th-till-9th-janaury
Bacula Administrator 1 | 
http://www.open-future.be/bacula-administrator-i-training-13th-till-15th-january
Puppet Fundamentals | 
http://www.open-future.be/puppet-fundamentals-training-26th-till-28th-january
Puppet Architect | 
http://www.open-future.be/puppet-architect-training-29th-till-30th-january
Subscribe to our newsletter | http://eepurl.com/BUG8H

--
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/54AE92BC.30508%40open-future.be.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Hiera doesn t behave as expected or as written in doc

2015-01-08 Thread Martin Alfke
Hi,
> On 08.01.2015, at 09:52, Raphael  wrote:
> 
> Hi,
> I have a working puppetmaster installed from package on an ubuntu server 
> 14.04 64bits.
> I've been struggeling for a while now with hiera to achieve what it is 
> written in the doc ;
> 
> My hiera version is 1.3.0
> Puppetmaster version 3.4.3
> 
> My hierachy settings is quite simple, with a common file and a specific file 
> for host : 
> 
> ---
> :backends:
>   - yaml
>   - json
> :yaml:
>   :datadir: /etc/puppet/hieradata
> :json:
>   :datadir: /etc/puppet/hieradata
> :hierarchy:
> 
>   - common
>   - "node/%{::fqdn}"
> 
> :merge_behavior: deeper
> 
> This file is in /etc/puppet/ and linked to /etc/hiera.yaml
> 
> In the common.yaml, I'm trying to use a variable based on facts (like in the 
> example on the official documentation) :
> 
> 
> smtpserver: "mail.%{::domain}"
> 
> When I issue hiera smtpserver, I have this output :
> 
> mail.

You are running the hiera command on cli?
In this case you do not have facts available.
But: you can provide facts on cli:

hiera -c /etc/hiera.yaml smtpserver domain=foobar.com 

hth,

Martin

-- 
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/B29F42AF-F35C-4609-B8DE-58A91D296CAB%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Hiera doesn t behave as expected or as written in doc

2015-01-08 Thread Raphael
Hi,
I have a working puppetmaster installed from package on an ubuntu server 
14.04 64bits.
I've been struggeling for a while now with hiera to achieve what it is 
written in the doc ;

My hiera version is 1.3.0
Puppetmaster version 3.4.3

My hierachy settings is quite simple, with a common file and a specific 
file for host : 

---
:backends:
  - yaml
  - json
:yaml:
  :datadir: /etc/puppet/hieradata
:json:
  :datadir: /etc/puppet/hieradata
:hierarchy:

  - common
  - "node/%{::fqdn}"

:merge_behavior: deeper

This file is in /etc/puppet/ and linked to /etc/hiera.yaml

In the common.yaml, I'm trying to use a variable based on facts (like in 
the example on the official documentation) :


smtpserver: "mail.%{::domain}"

When I issue hiera smtpserver, I have this output :

mail.

Even the lookup type (deeper here in my config) doesn t provide the same output 
as the example ...

Any idea ? version issue ?

Thx a lot for your advice / answer.

-- 
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/3590c684-299f-4775-a12a-f241ab06f75d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Using http_proxy environment variable

2015-01-08 Thread jcbollinger


On Wednesday, January 7, 2015 3:28:30 PM UTC-6, Kai Timmer wrote:
>
> Hello,
> I have to use a proxy to connect to the internet. 
>
> My puppet works fine when I call it manually as root (with http_proxy 
> set). But the "normal" agent doesn't seem to use the proxy. I always get a 
> timeout when I try to get a pgp key. Getting the package itself works fine 
> (but I guess thats because I configure apt to use the proxy and puppet just 
> calls apt-get).
>
> How do I make the puppet agent use my environment variables?
>
>

The system does not use root's shell environment for starting services, but 
you could alter the service control script to set the wanted environment 
variables.  Alternatively, you could schedule agent runs via cron instead 
of running the agent as a service, and set the environment variables via 
cron's facilities for doing so.

For this particular task, however, you should probably set the 
'http_proxy_host' and 'http_proxy_port' parameters in your Puppet 
configuration (or via the command line).


John

-- 
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/6260f956-1023-4f0a-95ae-9510fc32315f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: many agents connecting at same time and 100+ nodes failed.

2015-01-08 Thread Suresh P
Hi All,

I have found one more issue.
When we install puppet agent, it creates logrotate which will kill the 
puppet and restart it.   We have configured logroate for all the nodes at 
1st minute of everday(00:01).   Because of that all the node's puppet agent 
get reloaded at 00:01 minutes so all agents trying to connect the puppet 
masters at same polling interval. 

Regards,
Suresh.

On Tuesday, 11 November 2014 21:18:42 UTC+5:30, Christopher Wood wrote:
>
> Following up to myself since it turned out that running puppet agents via 
> cron was better for us due to one important feature... 
>
>
> [cwood@client ~]$ mcod puppet runonce --environment=puppetupgrades 
> --no-splay -F hostname=puppetmasterlab 
> running: mco puppet -c /home/cwood/.mcollective.dev runonce 
> --environment=puppetupgrades --no-splay -F hostname=puppetmasterlab 
>
>  * [ > ] 1 / 1 
>
>
> puppetmasterlab.domain.comRequest Aborted 
>Cannot specify any custom puppet options when the daemon is running 
>
>
> ...I can do agent runs using other environments with mcollective. 
>
> It's interesting how things work out over time. 
>
>
>
> On Thu, Nov 06, 2014 at 12:22:04PM -0500, Christopher Wood wrote: 
> > On Thu, Nov 06, 2014 at 09:28:32AM +0100, Felix Frank wrote: 
> > > On 11/06/2014 09:25 AM, james.e...@fasthosts.com  wrote: 
> > > > 
> > > > If that fails, you could try running the puppet agent from a cron 
> job 
> > > > instead with randomised start times as per the below link. 
> > > 
> > > +1 
> > > 
> > > I have yet to see a disadvantage of cron vs. the background agent. 
> > 
> > (Apparently I enjoy splitting tiny hairs in a thread branch. Possibly 
> rhubarbing on, but here goes.) 
> > 
> > Cultural... 
> > 
> > In my experience, it is easier to tell people that any host where an 
> agent is running is a puppetized host. I don't understand why it's more 
> difficult to read /etc/motd or grep root's crontab but that's probably my 
> view of things and not shared elsewhere. (This is more for the transition 
> period as everything goes under puppet management.) 
> > 
> > And then a manager might go and tell everybody that a host with an agent 
> running is a puppetized host and it's hard to go and change puppet methods 
> without requiring retraining. Your puzzlement at the difficulty level of 
> changing from agent to cron likely matches mine. 
> > 
> > Technological... 
> > 
> > The fqdn_rand() function doesn't necessarily spread things as evenly as 
> we might expect given randomness over large ranges. To illustrate, 
> fictional example: 
> > 
> > $ for x in `seq 1 1`; do echo "notice(fqdn_rand(60, 'host${x}.
> cwood.com'))"; done >/tmp/xx.pp 
> > $ puppet apply --color=false /tmp/xx.pp | grep Scope | awk '{print $3}' 
> | sort | uniq -c | sort -rn >/tmp/yy 
> > $ head -5 /tmp/yy 
> > 199 1 
> > 195 51 
> > 188 52 
> > 184 55 
> > 184 48 
> > $ tail -5 /tmp/yy 
> > 151 9 
> > 150 46 
> > 145 5 
> > 144 2 
> > 141 19 
> > 
> > Obviously using cron I might choose something different than 
> run-on-a-random-minute, but I will still be a bit suspicious about this. 
> > 
> > Also, cron isn't necessarily good at running things intermittently over 
> less clock-friendly periods. If I'd like something to run every 47 minutes, 
> just to pick, that's going to bit a bit harder to express with cron. 
> > 
> > 
> > 
> > > -- 
> > > 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/545B3130.90007%40alumni.tu-berlin.de.
>  
>
> > > 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...@googlegroups.com . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/20141106172204.GA26122%40iniquitous.heresiarch.ca.
>  
>
> > 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/3ae5eb7d-0ea4-4d4a-810c-f414fffd3b85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Unable to retrieve catalog with Hiera as ENC

2015-01-08 Thread Adrien Kutak
Well,

it works correctly now.

Thanks
Adrien

Le mercredi 7 janvier 2015 10:26:17 UTC+1, Adrien Kutak a écrit :
>
> Hi felix,
>
> Yes, i'm using puppet 3.7.3 on debian.wheezy 
> I have also installed this gems :
>
> - hiera-file 
> - hiera-gpg 0.1.1
>
> I'll delete all hiera's gems and retry
>
> Thanks
> Adrien
>
> Le mercredi 7 janvier 2015 00:17:42 UTC+1, Felix.Frank a écrit :
>>
>>  Hi,
>>
>> is this Puppet 3.7?
>>
>> Adrien mentioned a scenario on his blog that can lead to this failure: 
>> http://somethingsinistral.net/blog/the-angry-guide-to-puppet-3/
>>
>> It appears unlikely that this is hitting you, but please describe your 
>> setup anyway.
>>
>> Thanks,
>> Felix
>>
>> On 01/06/2015 02:39 PM, Adrien Kutak wrote:
>>  
>> Hi,
>>
>> I'm trying to use Hiera as ENC with dynamic puppet environment however it 
>> fails when I launch puppet : 
>> *root@test:/# puppet agent -t --environment=development*
>>
>>
>>
>>
>> *Error: Could not retrieve catalog from remote server: Error 400 on 
>> SERVER: undefined method `empty_answer' for Hiera::Backend:Module at 
>> /etc/puppet/environments/development/site.pp:2 on node test.com 
>>  Warning: Not using cache on failed catalog Error: Could 
>> not retrieve catalog; skipping run*
>>
>>
>> 

-- 
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/48981cbe-523b-4887-8798-0532deaa39cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.