Re: [Puppet Users] Hash of hashes to file template

2014-10-05 Thread Poil

Hi,

Something like this :

|<%if  @ospf and @||ospf!=""  -%>
<%@||ospf.sort.mapdo  |iname,instance| -%>|
|   |protocol ospf <% iname =%>:
(...)

But I think you can probably use create_resource()

Best regards,


Le 06/10/2014 00:55, Ciro Iriarte a écrit :
Hi!, I'm starting to work with hiera and file templates, how would be 
the best way to transform this hiera output:


myanycast::bird::ospf:
  myinstance:
tick: 2
rfc1583compat: 'yes'
export: 'all'
area:
  990:
stub: 'no'
interface:
  eth0:
hello: 10
retransmit: 6
cost: 10
transmit_delay: 5
dead_count: 5
dead: 40
wait: 50
type: 'broadcast'

To this in the final configuration file using templates?:

protocol ospf myinstance:
  tick 2;
  rfc1583compat yes;
  export all;
  area 990 {
stub no;
interface "eth0" {
  hello 10;
  retransmit 6;
  cost 10;
  transmit delay 5;
  dead count 5;
  dead 40;
  wait 50;
  type broadcast;
  };
  };
}

There can be many areas per instance, and many interfaces per area.

Also, something that I noticed about hashes is that each hiera query 
(at least by hand) gives me the same data in different order. Can this 
trigger a different md5 for the file and force a service reload each 
30 minutes even there are no configuration changes?


Regards,
Ciro

--
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/ee60bb31-1cc7-4b92-8030-f9a6bc14fd20%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/54322DC3.1080102%40quake.fr.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Hash of hashes to file template

2014-10-05 Thread Ciro Iriarte
Hi!, I'm starting to work with hiera and file templates, how would be the 
best way to transform this hiera output:

myanycast::bird::ospf:
  myinstance:
tick: 2
rfc1583compat: 'yes'
export: 'all'
area:
  990:
stub: 'no'
interface:
  eth0:
hello: 10
retransmit: 6
cost: 10
transmit_delay: 5
dead_count: 5
dead: 40
wait: 50
type: 'broadcast'

To this in the final configuration file using templates?:

protocol ospf myinstance:
  tick 2;
  rfc1583compat yes;
  export all;
  area 990 {
stub no;
interface "eth0" {
  hello 10;
  retransmit 6;
  cost 10;
  transmit delay 5;
  dead count 5;
  dead 40;
  wait 50;
  type broadcast;
  };
  };
}

There can be many areas per instance, and many interfaces per area.

Also, something that I noticed about hashes is that each hiera query (at 
least by hand) gives me the same data in different order. Can this trigger 
a different md5 for the file and force a service reload each 30 minutes 
even there are no configuration changes?

Regards,
Ciro

-- 
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/ee60bb31-1cc7-4b92-8030-f9a6bc14fd20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetdb has no tables

2014-10-05 Thread Tim Dunphy
Hello and thanks for your reply.

Actually I take back what I said about it working. I still have the config
above in place. And I did complete a run successfully on the puppet server
itself. But when I looked at all the clients (I'm using foreman) I saw the
clients were failing runs. So I went back to regular puppet with no
puppetdb by moving my routes.yaml file to routes.yaml.bak and comment out
the following two lines in /etc/puppet/puppet.conf:

#storeconfigs = true
#storeconfigs_backend = puppetdb

And puppet and all the clients are playing nice again. But I really want to
get puppetdb working! So I reversed the steps I that I took above to put
puppetdb back in place so I could show you guys what's going on.

Now it's really apparent that puppetdb is not working at this point. I hope
I can get it going at some point.

I was using this guide to try to get this to work and followed all the
steps, I believe, correctly:

http://www.tokiwinter.com/adding-puppet-db-to-a-centos-6-4-based-puppetmaster/

But now when I perform puppet runs with the puppetdb in place I get back
the following result:

[root@puppet:/etc/puppet] #puppet agent --test
Warning: Unable to fetch my node definition, but the agent run will
continue:
*Warning: Error 400 on SERVER: Could not retrieve facts for
puppet.jokefire.com : *Failed to find facts
from PuppetDB at puppet.jokefire.com:8081: *[404 Not Found] *Error 404
HTTP ERROR: 404Problem accessing /v3/nodes/
puppet.jokefire.com/facts. Reason:Not FoundPowered by Jetty://
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Loading facts
*Error: Could not retrieve catalog from remote server:* *Error 400 on
SERVER*: Failed to submit 'replace facts' command for puppet.jokefire.com
to PuppetDB at puppet.jokefire.com:8081: [404 Not Found] Error 404
HTTP ERROR: 404Problem accessing
/v3/commands. Reason:Not FoundPowered by
Jetty://
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run


When I have a look at the logs  I see that I'm getting password
authentication failures for the puppetdb user:

[root@puppet:/etc/puppet] #tail -30 /var/log/puppetdb/puppetdb.log
2014-10-05 16:25:36,339 ERROR [c.j.b.h.AbstractConnectionHook] Failed to
acquire connection Sleeping for 7000ms and trying again. Attempts left: 1.
Exception: null
2014-10-05 16:25:43,340 ERROR [c.j.b.PoolWatchThread] Error in trying to
obtain a connection. Retrying in 7000ms
org.postgresql.util.PSQLException: *FATAL: password authentication failed
for user "puppetdb"*

*.*


This is what I have in my /etc/puppetdb/conf.d/database.ini

[database]
classname = org.postgresql.Driver
subprotocol = postgresql
subname = //127.0.0.1:5432/puppetdb
username = puppetdb
password = secret
log-slow-statements = 10


Yet when I try to log into the postgres database using those credentials I
get no error:

[root@puppet:~] #su - postgres
-bash-4.1$ psql -h 127.0.0.1 -p 5432 -U puppetdb -W puppetdb
Password for user puppetdb:
psql (8.4.20)
Type "help" for help.

puppetdb=>


Here's the output of that command you showed me.

[root@puppet:/etc/puppetdb/conf.d] #grep '' *

config.ini:# See README.md for more thorough explanations of each section
and

config.ini:# option.

config.ini:

config.ini:[global]

config.ini:# Store mq/db data in a custom directory

config.ini:vardir = /var/lib/puppetdb

config.ini:# Use an external logback config file

config.ini:logging-config = /etc/puppetdb/logback.xml

config.ini:

config.ini:

config.ini:[command-processing]

config.ini:# How many command-processing threads to use, defaults to (CPUs
/ 2)

config.ini:# threads = 4

config.ini:

config.ini:# Maximum amount of disk space (in MB) to allow for ActiveMQ
persistent message storage

config.ini:# store-usage = 102400

config.ini:

config.ini:# Maximum amount of disk space (in MB) to allow for ActiveMQ
temporary message storage

config.ini:# temp-usage = 51200

database.ini:[database]

database.ini:classname = org.postgresql.Driver

database.ini:subprotocol = postgresql

database.ini:subname = //127.0.0.1:5432/puppetdb

database.ini:username = puppetdb

database.ini:password = secret

database.ini:log-slow-statements = 10

jetty.ini:[jetty]

jetty.ini:# Hostname or IP address to listen for clear-text HTTP.  Default
is localhost

jetty.ini:# host = 

jetty.ini:

jetty.ini:# Port to listen on for clear-text HTTP.

jetty.ini:port = 8080

jetty.ini:

jetty.ini:

jetty.ini:# The following are SSL specific settings. They can be configured

jetty.ini:# automatically with the tool `puppetdb ssl-setup`, which is
normally

jetty.ini:# ran during package installation.

jetty.ini:

jetty.ini:# The host or IP address to listen on for HTTPS connections

jetty.ini:ssl-host = 0.0.0.0

jetty.ini:

jetty.ini:# The port to listen on for HTTPS connections

jetty.ini:ssl-port = 8081

jetty.ini:

jetty.ini:# Private key path

jetty.ini:ssl-key = /etc/puppetdb/ssl/private.pe

Re: [Puppet Users] puppetdb has no tables

2014-10-05 Thread Christopher Wood
On Sun, Oct 05, 2014 at 08:41:18PM +0100, Ken Barber wrote:
> > I've installed puppetdb on my puppetmaster. I have puppet-server-3.7.1,
> > puppetdb-2.2 and puppetdb-terminus-2.2.
> >
> > I've setup puppetdb like this:
> >
> > [root@puppet:/etc/puppet] #cat /etc/puppetdb/conf.d/database.ini
> > [database]
> > classname = org.postgresql.Driver
> > subprotocol = postgresql
> > subname = //127.0.0.1:5432/puppetdb
> > username = puppetdb
> > password = secret
> > log-slow-statements = 10
> >
> >
> > [root@puppet:/etc/puppet] #cat /etc/puppet/puppetdb.conf
> > [main]
> > server = puppet.jokefire.com
> > port = 8081
> >
> > [root@puppet:/etc/puppet] #cat /etc/puppet/routes.yaml
> > ---
> > master:
> >   facts:
> > terminus: puppetdb
> > cache: yaml
> >
> > [root@puppet:/etc/puppet] #grep storeconfigs puppet.conf
> > storeconfigs = true
> > storeconfigs_backend = puppetdb
> >
> > I'm running puppet via passenger and using foreman 1.6.0. And I've selected
> > postgres as the database for puppetdb as you can see above. When I perform
> > puppet runs everything seems to go OK. Which I thought meant that everything
> > as good between puppet and the puppetdb.
> >
> > However, when I connect to the postgres database and try to show tables for
> > the puppetdb database, it says that 'no relations are found'.
> >
> > [root@puppet:/etc/puppet] #su - postgres
> > -bash-4.1$ psql
> > psql (8.4.20)
> > Type "help" for help.
> >
> > postgres=# \c puppetdb
> > psql (8.4.20)
> > You are now connected to database "puppetdb".
> > puppetdb=# \dt
> > No relations found.
> >
> > So my question is, if I have everything setup correctly, why am I not seeing
> > any tables inside the puppetdb database? Am I missing any steps that I need
> > in order for this to work?
> 
> Is PuppetDB actually working at all? Or is this just a symptom you are
> trying to track down.
> 
> Well couple of things, can you show your puppetdb.log for starters,
> perhaps the initial startup might be useful.
> 
> I'm hoping this isn't it, but there is a small chance you have a
> duplicate entry in your conf.d directory, I've always found this
> methology to be a good one for checking this:
> 
> # cd /etc/puppetdb/conf.d
> # grep '' *

Regex persnicketiness. ;)

# cd /etc/puppetdb/conf.d
# egrep -vh '^$' * | sort | uniq -d

Grep any lines to find where they're duped:

grep -l 'line string in quotes' *

ALso, this thing is useful:

https://forge.puppetlabs.com/puppetlabs/puppetdb

> Can you show us the results of this (with secrets removed also) it
> might give us another clue.
> 
> It sounds to me like if its working its either using a different
> database than we think it is, or potentially HSQLDB which is the
> embedded one. You should be able to see clues if you are accidentally
> using HSQLDB in this regard in /var/lib/puppetdb/db:
> 
> root@puppetdb1:~# ls /var/lib/puppetdb/db/
> db.log db.properties  db.script  db.tmp
> 
> None of what you have provided shows this to be true so far, but worth
> double checking :-).
> 
> ken.
> 
> -- 
> 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/CAE4bNTnUcKLxxfCdp2NjkVdSekNL-%2BwSOvUvVpu_w%3DgvzZFaiw%40mail.gmail.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/20141005194633.GA1124%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetdb has no tables

2014-10-05 Thread Ken Barber
> I've installed puppetdb on my puppetmaster. I have puppet-server-3.7.1,
> puppetdb-2.2 and puppetdb-terminus-2.2.
>
> I've setup puppetdb like this:
>
> [root@puppet:/etc/puppet] #cat /etc/puppetdb/conf.d/database.ini
> [database]
> classname = org.postgresql.Driver
> subprotocol = postgresql
> subname = //127.0.0.1:5432/puppetdb
> username = puppetdb
> password = secret
> log-slow-statements = 10
>
>
> [root@puppet:/etc/puppet] #cat /etc/puppet/puppetdb.conf
> [main]
> server = puppet.jokefire.com
> port = 8081
>
> [root@puppet:/etc/puppet] #cat /etc/puppet/routes.yaml
> ---
> master:
>   facts:
> terminus: puppetdb
> cache: yaml
>
> [root@puppet:/etc/puppet] #grep storeconfigs puppet.conf
> storeconfigs = true
> storeconfigs_backend = puppetdb
>
> I'm running puppet via passenger and using foreman 1.6.0. And I've selected
> postgres as the database for puppetdb as you can see above. When I perform
> puppet runs everything seems to go OK. Which I thought meant that everything
> as good between puppet and the puppetdb.
>
> However, when I connect to the postgres database and try to show tables for
> the puppetdb database, it says that 'no relations are found'.
>
> [root@puppet:/etc/puppet] #su - postgres
> -bash-4.1$ psql
> psql (8.4.20)
> Type "help" for help.
>
> postgres=# \c puppetdb
> psql (8.4.20)
> You are now connected to database "puppetdb".
> puppetdb=# \dt
> No relations found.
>
> So my question is, if I have everything setup correctly, why am I not seeing
> any tables inside the puppetdb database? Am I missing any steps that I need
> in order for this to work?

Is PuppetDB actually working at all? Or is this just a symptom you are
trying to track down.

Well couple of things, can you show your puppetdb.log for starters,
perhaps the initial startup might be useful.

I'm hoping this isn't it, but there is a small chance you have a
duplicate entry in your conf.d directory, I've always found this
methology to be a good one for checking this:

# cd /etc/puppetdb/conf.d
# grep '' *

Can you show us the results of this (with secrets removed also) it
might give us another clue.

It sounds to me like if its working its either using a different
database than we think it is, or potentially HSQLDB which is the
embedded one. You should be able to see clues if you are accidentally
using HSQLDB in this regard in /var/lib/puppetdb/db:

root@puppetdb1:~# ls /var/lib/puppetdb/db/
db.log db.properties  db.script  db.tmp

None of what you have provided shows this to be true so far, but worth
double checking :-).

ken.

-- 
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/CAE4bNTnUcKLxxfCdp2NjkVdSekNL-%2BwSOvUvVpu_w%3DgvzZFaiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Is there a puppet module for installing Zookeeper in cluster mode?

2014-10-05 Thread Jeremy T. Bouse

Hi there,

I have written both Zookeeper and Solr4 puppet modules; however, 
currently as it was done on company time/resources and they have yet to 
establish/approve an Open-Source policy we're unable to share it without 
violating our employment contracts. We have done everything we can to be 
prepared to release it as soon as we get corporate approval of a policy 
as it is already in GitHub though on a private repo which we will be 
able to open-source and make public at a later date.


On 05.10.2014 07:27, Anastasios Zouzias wrote:

Hi there,

I am looking for a puppet module that is able to install a zookeeper
cluster with three (say) servers/nodes.

From puppetlabs, I found the following module which unfortunately 
does

not work out of the shelf:

https://forge.puppetlabs.com/viirya/zookeeper [1]

Does anybody know if there is any such module out there?

Best,
Anastasios

 --
 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 [2].
 To view this discussion on the web visit

https://groups.google.com/d/msgid/puppet-users/ab1913a8-d591-490d-907a-c1b100514cc3%40googlegroups.com
[3].
 For more options, visit https://groups.google.com/d/optout [4].


Links:
--
[1] https://forge.puppetlabs.com/viirya/zookeeper
[2] mailto:puppet-users+unsubscr...@googlegroups.com
[3]

https://groups.google.com/d/msgid/puppet-users/ab1913a8-d591-490d-907a-c1b100514cc3%40googlegroups.com?utm_medium=email&utm_source=footer
[4] 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/d680cf645354883d3e0c4faff21570c0%40undergrid.net.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Is there a puppet module for installing Zookeeper in cluster mode?

2014-10-05 Thread Anastasios Zouzias
Hi there,

I am looking for a puppet module that is able to install a zookeeper 
cluster with three (say) servers/nodes. 

>From puppetlabs, I found the following module which unfortunately does not 
work out of the shelf:

https://forge.puppetlabs.com/viirya/zookeeper

Does anybody know if there is any such module out there?

Best,
Anastasios

-- 
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/ab1913a8-d591-490d-907a-c1b100514cc3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Hiera gem load path

2014-10-05 Thread Clayton O'Neill
Are you using Puppet Enterprise?  If so, it ships with its own version of 
Ruby, and you need to make sure the hiera-eyaml gem is installed in that 
ruby installation also.

On Friday, October 3, 2014 6:58:41 AM UTC-4, Erinn Looney-Triggs wrote:
>
> I am having a tough time finding an answer to this, probably due to my 
> lack of 
> Google skills. 
>
> I have been working to get hiera-eyaml plugin working. 
>
> Hiera from the command line is able to look up the values in the eyaml 
> files. 
> Implying that it is loading up the correct gems etc. The puppetmaster 
> however 
> is not able to. This is the default puppetmaster (I believe it is 
> webbrick?) 
>
> I believe this is probably because the gems were installed into 
> /usr/local/ 
> and the puppetmaster is not picking those up in its path. 
>
> I cannot, however, figure out how to adjust this for the puppetmaster, any 
> suggestions would be appreciated. 
>
> -Erinn 
>
>
>

-- 
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/34197aa1-ad70-4fe0-be74-8a011b348aa0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Hiera gem load path

2014-10-05 Thread Cristian Falcas
Most probably because of the path to hiera.yaml file.

/etc/hiera.yaml should be a symlink to /etc/puppet/hiera.yaml





On Fri, Oct 3, 2014 at 1:30 AM, Erinn Looney-Triggs <
erinn.looneytri...@gmail.com> wrote:

> I am having a tough time finding an answer to this, probably due to my
> lack of
> Google skills.
>
> I have been working to get hiera-eyaml plugin working.
>
> Hiera from the command line is able to look up the values in the eyaml
> files.
> Implying that it is loading up the correct gems etc. The puppetmaster
> however
> is not able to. This is the default puppetmaster (I believe it is
> webbrick?)
>
> I believe this is probably because the gems were installed into /usr/local/
> and the puppetmaster is not picking those up in its path.
>
> I cannot, however, figure out how to adjust this for the puppetmaster, any
> suggestions would be appreciated.
>
> -Erinn
>
>
>

-- 
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/CAMo7R_fAzQnN0PErLhKyCLqkVdpHDjK1Gh0Dkwc6x_Oxt5Y1bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.