Re: [Puppet Users] Re: brew and macosx and puppet

2013-10-03 Thread David Portabella
https://github.com/kelseyhightower/puppet-homebrew -- 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 post to this gr

Re: [Puppet Users] How to create local puppet forge repositories

2013-11-18 Thread David Portabella
In our case, we need a local puppet repository for two reasons: 1- to host our own puppet modules, which should not be publicly accessible 2- to have our own local copy of all public puppet modules that we use (so that we do not rely on you; if your servers go down, our company should still b

[Puppet Users] managing puppet module dependencies

2013-11-18 Thread David Portabella
with maven, you can tell that a project requires a list of artifacts and their versions. those dependencies in turn have other dependencies. maven takes care of managing all this. for instance, maven can find out if two of your dependencies requires a conflicting version of another dependency.

[Puppet Users] get a *structured* version of the puppet agent output

2013-11-26 Thread David Portabella
puppet agent --verbose shows a verbose output of the changes done by puppet, such as: notice: /Stage[main]/Logstash::Config/Logstash::Configdir[agent]/File[/etc/logstash/agent/config]/owner: owner changed 'root' to 'logstash' notice: /Stage[main]/Varnish/Service[varnish]/ensure: ensure chang

Re: [Puppet Users] get a *structured* version of the puppet agent output

2013-11-27 Thread David Portabella
Thanks Ygor and R.I. Pienaar. that's exactly what i was looking for! Regards, David On Tuesday, November 26, 2013 8:27:20 PM UTC+1, Ygor wrote: > > Reference: > http://docs.puppetlabs.com/puppet/3/reference/format_report.html > > Start with this: >

Re: [Puppet Users] scope for templates that is called from a class that includes the class that calls the template.

2013-11-27 Thread David Portabella
according to http://docs.puppetlabs.com/guides/scope_and_puppet.html about dynamic lookup from an included puppet file: puppet 2.7 warns about it, and puppet 3.2 stops working, as expected. however, about dynamic lookup from a template called on an included puppet file: both puppet 2.7 and puppet

Re: [Puppet Users] scope for templates that is called from a class that includes the class that calls the template.

2013-11-27 Thread David Portabella
'hello' value? *var from file.txt.erb: hello* On Wednesday, November 27, 2013 2:40:41 PM UTC+1, David Portabella wrote: > > according to http://docs.puppetlabs.com/guides/scope_and_puppet.html > about dynamic lookup from an included puppet file: > puppet 2.7 warns about it

Re: [Puppet Users] get a *structured* version of the puppet agent output

2013-11-27 Thread David Portabella
Thanks again! It is great to use the puppet report yaml files! here there is an example script that prints all resources statuses, then it filters them by taking only the services, then it filters them by taking only the services changed to running. test.ruby #!/usr/bin/ruby require 'puppet' f

Re: [Puppet Users] scope for templates that is called from a class that includes the class that calls the template.

2013-11-28 Thread David Portabella
try and search http://projects.puppetlabs.com/issues/ for similar > reports. If there is none, feel free to open a new bug and supply your > example code. > > If time allows, I'll look into it over the weekend. > > Cheers, > Felix > > On 11/27/2013 02:50 PM, David Portabella wro

[Puppet Users] validate hiera database against a schema

2013-11-29 Thread David Portabella
is there a way to validate a hiera database against a schema? the validation could be done as a whole (but that might not make sense, as the effective hierarchy depends on the context), or better, when calling hiera('myvar') from puppet (for instance). or maybe, this could be a new function (in

Re: [Puppet Users] scope for templates that is called from a class that includes the class that calls the template.

2013-12-01 Thread David Portabella
roblem is wrong template syntax. The below is not strictly valid: > > On 11/27/2013 02:40 PM, David Portabella wrote: > > file.txt.erb > > var from file.txt.erb: <%= @var %> > > What works as expected: > > > var from file.txt.erb: <%= var %> > >

[Puppet Users] puppet 2.7, template, keys of hash

2013-12-04 Thread David Portabella
test.pp $config = { host1 => { port => , msg => 'dfdasfas' }, host2 => { port => , msg => 'dfdasfas' }, } file { '/tmp/file.txt': content => template('file.txt.erb'), } file.txt.erb: keys: <%= @config.keys %> $ puppet apply --templatedir

[Puppet Users] dependency injection in puppet

2013-12-04 Thread David Portabella
Here: http://www.devco.net/archives/2012/12/13/simple-puppet-module-structure-redux.php it explains that "modules that have configuration should be configurable in a single way and single place", and I agree. However, as configuration grows in complexity, this means that the entry point would h

[Puppet Users] Re: dependency injection in puppet

2013-12-04 Thread David Portabella
ecember 4, 2013 10:26:11 PM UTC+1, jcbollinger wrote: > > > > On Wednesday, December 4, 2013 11:48:50 AM UTC-6, David Portabella wrote: >> >> Here: >> http://www.devco.net/archives/2012/12/13/simple-puppet-module-structure-redux.php >> it explains that "modul

Re: [Puppet Users] Re: dependency injection in puppet

2013-12-04 Thread David Portabella
name]}\noutput_password: ${jmxtrans::output[password]}\n", # content => template(template_source), } } class jmxtrans::output ($host, $port, $username, $password) { } On Wednesday, December 4, 2013 10:42:39 PM UTC+1, R.I. Pienaar wrote: > > > > - Original Message -

Re: [Puppet Users] get a *structured* version of the puppet agent output

2013-12-13 Thread David Portabella
Given this puppet manifest (test.pp): $dir = '/tmp' file {'myfile': path => "$dir/myfile.txt", content => 'hello' } puppet produces this report: [...] File[myfile]: !ruby/object:Puppet::Resource::Status resource: File[myfile] file: /Users/david/test.pp line: 4 evalu

Re: [Puppet Users] get a *structured* version of the puppet agent output

2013-12-13 Thread David Portabella
13, 2013 7:32:39 PM UTC+1, Charlie Sharpsteen wrote: > > On Friday, December 13, 2013 5:30:19 AM UTC-8, David Portabella wrote: > > Given this puppet manifest (test.pp): >> $dir = '/tmp' >> file {'myfile': >> path => "$dir/myfile.txt

Re: [Puppet Users] get a *structured* version of the puppet agent output

2013-12-16 Thread David Portabella
harpsteen wrote: > > On Friday, December 13, 2013 2:43:41 PM UTC-8, David Portabella wrote: > > >> is there a way to get the list of resources created when using a puppet >> apply (instead of puppet agent)? >> >> the point is that we need this when refactoring pu

Re: [Puppet Users] get a *structured* version of the puppet agent output

2013-12-16 Thread David Portabella
e: > > Couldn't you collect and interpret the output of puppet apply? > > On 12/16/2013 02:14 PM, David Portabella wrote: > > This seems an overcomplicated issue. Just to step back and look at the > > global picture: > > we are just asking to get the list

Re: [Puppet Users] managing puppet module dependencies

2014-01-13 Thread David Portabella
encies. why? what can be the problem? Regards, David On Monday, November 18, 2013 5:46:57 PM UTC+1, Ryan Coleman wrote: > > > > > On Mon, Nov 18, 2013 at 8:39 AM, David Portabella > > > wrote: > >> with maven, you can tell that a project requires a list of a

[Puppet Users] circular dependency between user/home and parent directory owned by that user

2014-01-30 Thread David Portabella
For illustrating purposes, I need a *david* user with home directory /haha/david, and at the same time, the directory /haha also needs to be owned by *david*. this code does not work, because user requires the /haha directory, and the /haha directory requires the david user, so we have a circular

Re: [Puppet Users] circular dependency between user/home and parent directory owned by that user

2014-01-30 Thread David Portabella
gt; User[‘david’]->File[‘/haha’] > > > > Ref: http://docs.puppetlabs.com/learning/ordering.html > > > > > > > > *Dominique Arpin* > > Tél. Interne: 140-4156 > > Tél. 514 285.2929 Poste: 140-4156 > > > *De :* puppet...@googlegrou

[Puppet Users] when a puppet exec resource contains several "single commands", puppet exec only fails if the last exec command fails

2014-03-10 Thread David Portabella
exec {'test': command => "/bin/ls /doesnotexit", } fails as expected: Error: /bin/ls /doesnotexit returned 1 instead of one of [0] Error: /Stage[main]//Exec[test]/returns: change from notrun to 0 failed: /bin/ls /doesnotexit returned 1 instead of one of [0] However, exec {'test': command

Re: [Puppet Users] when a puppet exec resource contains several "single commands", puppet exec only fails if the last exec command fails

2014-03-10 Thread David Portabella
design, and this is what puppet receives. So its a ' > works at a expected' > > If you need to control each of the return codes just use different exec > resources > > Regards, > El 10/03/2014 16:02, "David Portabella" > > escribió: > >> &

Re: [Puppet Users] when a puppet exec resource contains several "single commands", puppet exec only fails if the last exec command fails

2014-03-10 Thread David Portabella
thanks. I agree, using && instead of ; solves the problem. however, again, there are many puppet modules which use concatenated commands, without realising about this problem. and so, I am suggesting that puppet should enable the "set -e" behavior by default. Regards, David On Monday, March 10

[Puppet Users] puppet class dependencies

2014-03-19 Thread David Portabella
class { c2: } class { c3: } class c1 { } class c2 { class { c1: } } class c3 { require c2 } c3 depends on c2 (as expected), but c3 does not depend on c1. this issue could be fixed by adding "require c1" inside c3. however, in a general case, I don't know what is instantiated inside c2. wh

Re: [Puppet Users] puppet class dependencies

2014-03-19 Thread David Portabella
nchor pattern > http://docs.puppetlabs.com/puppet/latest/reference/lang_containment.html > El 19/03/2014 12:18, "David Portabella" > > escribió: > >> class { c2: } >> class { c3: } >> >> class c1 { >> } >> >> class c2 { >> class {

Re: [Puppet Users] puppet class dependencies

2014-03-19 Thread David Portabella
I've tried the anchor pattern as follows: class { c2: } class { c3: } class c1 { } class c2 { class { c1: } anchor { 'c1_first': } -> Class['c1'] -> anchor { 'c1_last': } } class c3 { require c2 } but still puppet apply --graph test.pp shows that c3 does not depend on c1. so, how to appl

Re: [Puppet Users] puppet class dependencies

2014-03-19 Thread David Portabella
I've even simplified the example: class { c3: } class c1 { notice "+++" file {'/tmp/c1.txt': ensure => present } } class c2 { # include c1 contain c1 notice "+++" file {'/tmp/c2.txt': ensure => present } } class c3 { # include c2 contain c2 notice "+++" file {'/tmp/c3.txt': en

Re: [Puppet Users] puppet class dependencies

2014-03-19 Thread David Portabella
I've even simplified the example: class { c2: } class { c3: } class c1 { notice "+++" file {'/tmp/c1.txt': ensure => present } } class c2 { # include c1 contain c1 notice "+++" file {'/tmp/c2.txt': ensure => present } } class c3 { require c2 notice "+++" file {'/tmp/c3.txt': en

[Puppet Users] i require a defined type which contains a file resource, but the file resource does not retain the relatioship

2014-03-19 Thread David Portabella
I have this test.pp example on puppet 3.4.3 on OSX 10.9: c2 {'test': } -> c3 {'test': } define c1 { notice "+++" file {'/tmp/c1.txt': ensure => present } } define c2 { c1 {$name: } notice "+++" file {'/tmp/c2.txt': ensure => present } } define c3 { notice "+++" file {'/tmp/c3.txt

[Puppet Users] a puppet module works with puppet 3.4.3 normal, but it fails with puppet 3.4.3 (Puppet Enterprise 3.2.0)

2014-03-19 Thread David Portabella
I am testing a puppet module with a vagrant machine. it works on puppet 3.4.3 normal, but it fails with puppet 3.4.3 (Puppet Enterprise 3.2.0). it fails when using a custom puppet provider. full log here: https://github.com/biemond/biemond-orawls-vagrant/issues/18#issuecomment-38063519 any idea?

Re: [Puppet Users] puppet class dependencies

2014-03-27 Thread David Portabella
My colleague Guillaume showed me a possible implementation of the anchor pattern: class { c2: } -> class { c3: } class c1 { notice "+++" anchor {'before_c1':} -> file {'/tmp/c1.txt': ensure => present } -> anchor {'after_c1':} } class c2 { include c1 notice "+++" anchor {'be

[Puppet Users] Re: i require a defined type which contains a file resource, but the file resource does not retain the relatioship

2014-03-27 Thread David Portabella
puppet --graph. On Wednesday, March 19, 2014 9:51:08 PM UTC+1, jcbollinger wrote: > > > > On Wednesday, March 19, 2014 7:54:27 AM UTC-5, David Portabella wrote: >> >> I have this test.pp example on puppet 3.4.3 on OSX 10.9: >> >> c2 {'test': } >> ->

[Puppet Users] Re: i require a defined type which contains a file resource, but the file resource does not retain the relatioship

2014-03-27 Thread David Portabella
seconds $ open -a GraphViz /Users/david/.puppet/var/state/graphs/relationships.dot no relation between exec1, exec2 and/or exec3. On Thursday, March 27, 2014 11:11:02 AM UTC+1, David Portabella wrote: > > I've open a bug ticket: > puppet --graph misses some dependencies > ht

Re: [Puppet Users] puppet class dependencies

2014-03-27 Thread David Portabella
it seems there is a bug in puppet --graph, that misses some dependencies. https://tickets.puppetlabs.com/browse/PUP-2075 so, this code actually works as expected: class { c3: } class c1 { exec { exec1: command => '/bin/echo exec1; exit 1' } } class c2 { * # include c1* * contain c1* exec

[Puppet Users] Re: i require a defined type which contains a file resource, but the file resource does not retain the relatioship

2014-03-27 Thread David Portabella
simpler example, showing the transivity in resource dependencies. (as opposed to no transivity in class dependencies by default) d3 {'test': } define d1 { exec { exec1: command => '/bin/echo exec1; exit 1' } } define d2

[Puppet Users] resource title is unique for each instance. what about resource name?

2014-03-31 Thread David Portabella
as explained here: http://docs.puppetlabs.com/puppet/latest/reference/lang_defined_types.html#title-and-name resource *title* is guaranteed to be unique for each instance. I thought that resource *name* was not required to be unique. however this code suggests the opposite: my_resource { r1: n

Re: [Puppet Users] resource title is unique for each instance. what about resource name?

2014-03-31 Thread David Portabella
d resource types follow the same rules and the $name variable is > always assumed to be a namevar. > > Craig > > > > > On Mon, Mar 31, 2014 at 2:14 PM, David Portabella > > > wrote: > >> as explained here: >> http://docs.puppetlabs.com/puppet/lat

Re: [Puppet Users] puppet class require fails depending on declaration order

2014-04-02 Thread David Portabella
Oh My God! you mean that "it's not a bug, it is a feature" ? On Wednesday, April 2, 2014 11:36:34 AM UTC+2, Jose Luis Ledesma wrote: > > hi, > > > from: > > > http://docs.puppetlabs.com/puppet/latest/reference/lang_classes.html#declaring-classes > > Include-Like vs. Resource-Like > > Puppet has

Re: [Puppet Users] puppet class require fails depending on declaration order

2014-04-03 Thread David Portabella
r wrote: > > > > > > On Wednesday, April 2, 2014 4:57:39 AM UTC-5, David Portabella wrote: > > > > Oh My God! > > > > you mean that "it's not a bug, it is a feature" ? > > > > > > > > It is

Re: [Puppet Users] puppet class require fails depending on declaration order

2014-04-11 Thread David Portabella
> On Thursday, April 3, 2014 10:31:40 AM UTC-5, David Portabella wrote: >> >> *> **Agree with John that you want to completely avoid using the >> parameterized style declaration of classes. Better to use >> 'include' statements and set all of your params

[Puppet Users] Failed running the puppet tests: bundle exec rake spec

2014-04-15 Thread David Portabella
Hi, I need to build and run the specs on puppet, before I can send a pull request: https://github.com/puppetlabs/puppet/pull/2489 here it explains how to set up a machine with the dependencies for building puppet: https://github.com/nespresso/puppet/blob/master/docs/quickstart.md I've used a s

Re: [Puppet Users] puppet class require fails depending on declaration order

2014-04-15 Thread David Portabella
nlearning is twice as hard as learning. ;) Regards, David On Monday, April 14, 2014 4:43:19 PM UTC+2, jcbollinger wrote: > > > > On Friday, April 11, 2014 10:10:37 PM UTC-5, David Portabella wrote: >> >> I didn't know about this *evaluation-order dependency.* &

Re: [Puppet Users] Failed running the puppet tests: bundle exec rake spec

2014-04-15 Thread David Portabella
g the RAM (at least), see if that does anything. > > HTH, > Felix > > On 04/15/2014 03:35 PM, David Portabella wrote: > > > > What can be the problem? > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group.

Re: [Puppet Users] puppet class require fails depending on declaration order

2014-05-19 Thread David Portabella
> so, one specific example, >> someone (not me) implemented a class tomcat with parameters port and >> ssl_port. >> I want to use that class, >> and I want that the ssl_port is always port + 1 (I don't want this to be >> configurable in hiera) >> > so, in my hiera data, I will specify port