[Puppet Users] Re: Duplicate declaration

2018-09-17 Thread Ugo Bellavance
To be honest, I used the !defined because I am not good enough with puppet 
right now to check the other options.  I have made myself a note, though, 
to revisit this code eventually.

Thanks,

-- 
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/cba6149f-db49-4ddc-af31-b57b8aa43246%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Duplicate declaration

2018-09-11 Thread Ugo Bellavance


On Tuesday, September 11, 2018 at 9:31:43 AM UTC-4, jcbollinger wrote:
>
>
>
> On Monday, September 10, 2018 at 11:18:34 AM UTC-5, Michael Watters wrote:
>>
>> I'd prefer to see the entire vhost.pp code
>>
>
Here it is: https://pastebin.com/1Qt9ng7b 

-- 
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/0f73dcd3-ad03-4902-8289-657c1ba44050%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Duplicate declaration

2018-09-10 Thread Ugo Bellavance


On Monday, September 10, 2018 at 9:46:18 AM UTC-4, Michael Watters wrote:
>
> It sounds like your atqapache::vhost type is attempting to create 
> the /var/www/dev/user1/client1 directory for every vhost that is defined.  
> Can you post your definition for this type here?
>
>
>>
Wasn't it in my first post?

file { [ "$client_base", ]:
  ensure  => 'directory',
  owner   => "$owner",
  group   => "$group",
  mode=> 0744,
} 

-- 
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/08938255-5a24-4346-a1a1-a05ece2de87b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Duplicate declaration

2018-09-09 Thread Ugo Bellavance


On Friday, September 7, 2018 at 5:37:29 PM UTC-4, LinuxDan wrote:
>
> Separate the client base directory resource from the application directory 
> resource. 
>
> When declaring each application directory, add a “require” parameter with 
> a value of the client base directory. 
>
>
Thank you for your quick response.

Do you mean that I should create the clients directory separately, feeding 
it with the list of clients? 

I do that already with my devs directories:

  atqapache::varwwwdevuser { [ 'user1', 'user2', 'user3', 'user4', 'user5', 
'user6', 'user7', 'user8', ] :}

Class defined like this:

define atqapache::varwwwdevuser {

  file {
"/var/www/dev/${title}":
  ensure => directory,
  owner  => "${title}",
  group  => "${title}",
  mode   => 0744,
  require => User["${title}"],
  }
}

Thanks,

-- 
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/aa3a562a-3f24-4d9f-b11e-20c4af21931a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Duplicate declaration

2018-09-07 Thread Ugo Bellavance
Hi,

I have made a module, a long time ago, that allows me to create directories 
and httpd config files.

My pattern is /var/www/dev/$devuser/$clientname/$appname/

It worked perfectly until I ended up having more than one $appname for the 
same $clientname. Here's the error message I get:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Duplicate declaration: File[/var/www/dev/user1/client1] is already declared 
in file /etc/puppet/modules/atqapache/manifests/vhost.pp:146; cannot 
redeclare at /etc/puppet/modules/myapache/manifests/vhost.pp:146 on node 
server1.example.com

The directive responsible for the creation of the folder is this one:

file { [ "$client_base", ]:
  ensure  => 'directory',
  owner   => "$owner",
  group   => "$group",
  mode=> 0744,
}

This line defines the variable: 

$vhost_base = 
"${atqapache::params::home}/$envstage/$client-${application}"

Here's my declaration:

  atqapache::vhost { 'client1-user1app1dev1' :
client => 'client1',
envstage   => 'dev',
application=> 'app1',
devuser=> 'user1',
  }

  atqapache::vhost { 'client1-user1app2dev11' :
client => 'clien1',
envstage   => 'dev',
application=> 'app2',
devuser=> 'user1',
  }

Does anyone know how I could modify my code so that I can have more than 
one app per client?

Thanks,


-- 
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/6a2b9af3-0fb9-4c38-b0a1-7245b2762d38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] hiera lookup

2018-05-30 Thread Ugo Bellavance
When I leave just the class declaration it works:
>
>
>> class {'postgresql::server::contrib':
>> }
>>
>
>
> Well if that serves your needs (and it should) then it is better form to 
> use an include-like declaration instead:
>
> include 'postgresql::server::contrib'
>
> But that's mostly a style consideration.  It will affect behavior only if 
> now or in the future there is a(nother) resource-like declaration of that 
> class somewhere in your manifest set.
>
>
Excellent.
 

>
> Is there a way to have the class declaration in hiera? I tried using this 
>> at the top of my yaml file but it didn't work:
>>
>> ---
>> classes:
>>   - postgresql::server::contrib
>>
>
>
> Hiera just provides data and metadata.  It does not have any inherent 
> behavior associated.
>
> But that absolutely can have the form of an array of class names, which 
> can even be spread across multiple hierarchy levels, and you can use that 
> array to declare the named classes.  The old way was to use the 
> hiera_include() function in one of your manifests, but in recent Puppet 
> (4.x and later) you should be using the lookup() function and regular 
> include() function:
>
> include(lookup('classes', Array[String], 'unique', []))
>
>  
>
>>  
>>
>>>  
>>>
 So class parameters are automatically looked up in hiera, but define 
 parameters (or whatever name it is for objects) is not?

>>>
>>>
>>> That is correct.  There are good reasons for it, but a discussion of 
>>> those would be tangential.  If you're interested, you can find at least one 
>>> such discussion in the archives of this group.
>>>
>>>  
>> Ok thanks,
>>
>> Are the modules supposed to manage that or the user? 
>>
>
>
> Whoever declares a resource instance or a class is responsible for binding 
> the appropriate values to its parameters.  In particular, modules are 
> responsible for binding appropriate data to the resources and classes that 
> they declare internally, but you are responsible for binding values to the 
> resources and classes that you declare, regardless of where the class or 
> resource type is *defined*, and, for resources, regardless of whether 
> they are of plug-in or defined type.  If one interprets "the user" as 
> "whoever is responsible for the declaration" on an entity-by-entity basis, 
> then that simplifies to the user being responsible for managing parameters.
>

I see.  During my testing I found out that if I use create_resources and 
put nothing about it, it throws an error.
 

>
> Of course, where a resource type or class defines default values for its 
> parameters and those values meet your requirements, it's fine to rely on 
> those.  You don't necessarily need to explicitly provide a value for every 
> parameter.  And do note the important distinction between *declaring* a 
> class or resource, and *defining* a class or resource type.
>

This is something that I have always had trouble understanding and lacked 
time to read more on it.  And even if I read on it...
 

>
>
> John
>
>
Thanks John.  You and Arnau are simply amazing. I say something similar 
almost every time I post on this group, but this group provide better 
support than *any* of our software/hardware vendors. Faster support, and of 
better quality. Kudos to all the people who participate here.

-- 
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/17e6e035-8fa4-48a0-8b78-e4e6752f6b37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] hiera lookup

2018-05-29 Thread Ugo Bellavance

>
> That's awfully surprising if those data appear in an Hiera data file from 
> which you are successfully loading other data.  If that is in fact 
> happening then the most likely reason would be that a resource-like class 
> declaration for that class somewhere in your manifest set is explicitly 
> declaring different parameter values for that class (in which case the 
> Hiera data will not be consulted).  But if that were the case, then I would 
> expect Puppet to raise an error when you added your own resource-like 
> declaration of the same class.  Another possibility is that there are 
> conflicting data in some higher-priority level of your data hierarchy, but 
> that would be surprising considering how you arrived where you now are.
>
> My best guess, therefore, is that the file in which you placed the 
> parameter data is not being consulted at all for the node in question (so 
> that in fact you are *not* successfully loading other data from it, 
> either).
>
>
I'm testing with a minimal setup, just to make sure.

I have one manifest, site.pp, that I call locally (no server), and one 
hiera file, common.yaml.

I found it.  I stupidly commented the whole class declaration in site.pp.

When I leave just the class declaration it works:

class {'postgresql::server::contrib':
}


Is there a way to have the class declaration in hiera? I tried using this 
at the top of my yaml file but it didn't work:

---
classes:
  - postgresql::server::contrib
 

>  
>
>> So class parameters are automatically looked up in hiera, but define 
>> parameters (or whatever name it is for objects) is not?
>>
>
>
> That is correct.  There are good reasons for it, but a discussion of those 
> would be tangential.  If you're interested, you can find at least one such 
> discussion in the archives of this group.
>
>  
Ok thanks,

Are the modules supposed to manage that or the user? 

Thanks,

-- 
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/b50f0abe-bf50-453e-913c-9baac7802d20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] hiera lookup

2018-05-29 Thread Ugo Bellavance


On Tuesday, May 29, 2018 at 6:55:01 AM UTC-4, Arnau wrote:
>
>
>
> 2018-05-29 12:24 GMT+02:00 Ugo Bellavance >:
>
>>
>>
>> On Tuesday, May 29, 2018 at 5:54:54 AM UTC-4, Arnau wrote:
>>>
>>> Hi,
>>>
>>> postgresql::server::contrib::package_name: 'rh-postgresql96-postgresql-
>>> contrib'
>>> postgresql::server::contrib::packages_ensure: present
>>>
>>>
>> I don't get the error anymore.  It's not doing what it's supposed but 
>> I'll look into it. I'll try the same thing with the manifest just to see.
>>
>
> What is it doing ?
>

It should be install the package with the name specified in 
postgresql::server::contrib::package_name

Setting the parameters in the manifest works:

class {'postgresql::server::contrib':
  package_name=> 'rh-postgresql96-postgresql-contrib',
  package_ensure  => 'present',
}

But this hiera data doesn't:

postgresql::server::contrib::package_name: 
'rh-postgresql96-postgresql-contrib'
postgresql::server::contrib::packages_ensure: present

What vesion of pupet/hiera? what version of the postgres module are you 
> using?
>

# puppet -V
4.10.10

# hiera -V
1.3.4

puppetlabs-postgresql (v5.3.0)

I ran puppet in debug mode and when I use the manifest, I can see all the 
entries related to Package[postgresql-contrib], but nothing when using 
hiera.
 

>
>
>
>> But why do we have to use create_resources for the postgresql::server::db 
>> section but all the others are OK? Is it just because 
>> postgresql::server::db is an array?
>>
>
>
> *create_resources*
>
> Converts a hash into a set of resources and adds them to the catalog.
>
> This function takes two mandatory arguments: a resource type, and a hash 
> describing a set of resources. The hash should be in the form {title => 
> {parameters} }:
>
>
> *postgresql::server::db *is a *define*
> *postgresql::server::contrib* is a *class*
>
> In the first case you use create_resources cause you want to create 
> resources from the type postgresql::server::db (one or many). So the 
> create_resources function expects a hash with a list of databases + its 
> parameters.
>
> The second case you want to pass values to a class parameters. The class 
> does not expect any has:
>
> class postgresql::server::contrib (
> String $package_name = $postgresql::params::contrib_package_name,
> String[1] $package_ensure = 'present'
> ) inherits postgresql::params {
>
>
So class parameters are automatically looked up in hiera, but define 
parameters (or whatever name it is for objects) is not?

-- 
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/26e7eed0-566d-474e-afab-d6c633dec289%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] hiera lookup

2018-05-29 Thread Ugo Bellavance


On Tuesday, May 29, 2018 at 5:54:54 AM UTC-4, Arnau wrote:
>
> Hi,
>
> postgresql::server::contrib::package_name: 'rh-postgresql96-postgresql-
> contrib'
> postgresql::server::contrib::packages_ensure: present
>
>
I don't get the error anymore.  It's not doing what it's supposed but I'll 
look into it. I'll try the same thing with the manifest just to see.

But why do we have to use create_resources for the postgresql::server::db 
section but all the others are OK? Is it just because 
postgresql::server::db is an array?

Thanks,

-- 
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/d796f5ff-311a-46a0-b703-f12d7f1555b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] hiera lookup

2018-05-29 Thread Ugo Bellavance
Hi,

Here's the content of my whole file, thanks:

---

postgresql::globals::client_package_name: 'rh-postgresql96-postgresql'
postgresql::globals::createdb_path: 
'/opt/rh/rh-postgresql96/root/usr/bin/createdb'
postgresql::globals::datadir: '/var/opt/rh/rh-postgresql96/lib/pgsql/data'
postgresql::globals::manage_package_repo: true
postgresql::globals::needs_initdb: false
postgresql::globals::psql_path: '/opt/rh/rh-postgresql96/root/usr/bin/psql'
postgresql::globals::server_package_name: 
'rh-postgresql96-postgresql-server'


postgresql::server::service_name: 'rh-postgresql96-postgresql.service'
postgresql::server::service_reload: 'systemctl reload 
rh-postgresql96-postgresql.service'
postgresql::server::ip_mask_deny_postgres_user: '0.0.0.0/32'
postgresql::server::ip_mask_allow_all_users: '0.0.0.0/0'
postgresql::server::listen_addresses: '*'
postgresql::server::service_restart_on_change: false

postgresql::server::contrib:
  package_name:
'rh-postgresql96-postgresql-contrib'
  packages_ensure:
true

postgresql::server::db:
  'mydb1':
user:  'db1'
password:  'db1'
  'mydb2':
user:  'db2'
password:  'db2'
  'mydb3':
user:  'db3'
password:  'db3'

On Tuesday, May 29, 2018 at 3:09:08 AM UTC-4, Arnau wrote:
>
> Hi,
>
> are you sure the errors is about the contrib?
> can you show us the hiera content for ' postgresql::server::db' ? Could 
> it be that you have an string when a Hash is expected (for the 
> create_resource).
>
> Best,
> Arnau
>
> 2018-05-28 22:19 GMT+02:00 Ugo Bellavance >:
>
>> Hi,
>>
>> I am using the postgresql module and I wanted to put all my data in 
>> hiera. Some parameters were simply looked up automatically, like 
>> postgresql::globals:: and postgresql::server::.
>>
>> For postgresql::server::db, I had to put this in my manifest:
>>
>>   $dbs=hiera('postgresql::server::db')
>>   create_resources('postgresql::server::db', $dbs)
>>
>> And it works.  However, I'm looking for a way to make 
>> postgresql::server::contrib work as well, but I can't make it to work.  
>> When I use the same recipe I get this error:
>>
>> no implicit conversion of String into Hash
>>
>> How can I make postgresql::server::contrib work as well and why aren't 
>> ::db and ::contrib working out-of the box like globals and server?
>>
>> Format for ::db is:
>>
>> postgresql::server::db { 'db1':
>>   user => 'user1',
>>   password => password,
>> }
>>
>> Format for ::contrib is 
>>
>> class {'postgresql::server::contrib':
>>   package_name=> 'rh-postgresql96-postgresql-contrib',
>>   package_ensure  => true,
>> }
>>
>>
>> Thanks,
>>
>> -- 
>> 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/61c18a0f-76fe-4be8-83fc-aa8703f28cb5%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/puppet-users/61c18a0f-76fe-4be8-83fc-aa8703f28cb5%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/93053ac8-a9ba-46e8-a6b7-e46fa150fad8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Environment variable setting while using a module

2018-04-19 Thread Ugo Bellavance


On Thursday, April 19, 2018 at 7:50:30 AM UTC-4, Thomas Müller wrote:
>
> Hi Ugo
>
> Am Freitag, 30. März 2018 17:27:28 UTC+2 schrieb Ugo Bellavance:
>>
>> Hi,
>>
>> I'm using the puppetlabs-postgresql module and it works very well, but I 
>> want to make it work with a non-standard version of postgresql (from Red 
>> Hat Software Collections) because I would like to use Postgresql 9.6 on 
>> RHEL 7.  Almost everything is working, but I get errors from some commands 
>> that cannot find a shared object.  This is caused by the fact that Software 
>> Collections package use non-standard paths for their files.  For example, 
>> postgresql binaries are in opt/rh/rh-postgresql96/root/usr/bin/ than 
>> /usr/bin/.  Here's the kind of errors I get:
>>
>> /opt/rh/rh-postgresql96/root/usr/bin/psql: error while loading shared 
>> libraries: libpq.so.rh-postgresql96-5: cannot open shared object file: No 
>> such file or directory
>>
>>
>> I've used the pl-postgresql module successfully this way:
>
>
> https://gist.github.com/vinzent/448fa47032a6f050fb4c501cc741ccad#file-puppetdb-postgresql-9-5-example-pp
>

Hi,

That looks great, but is that in the puppetdb module or in the postgresql 
module? 

Thanks,

-- 
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/2932b0eb-ab4d-432d-ae91-1f0fb3e8d86a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Environment variable setting while using a module

2018-04-06 Thread Ugo Bellavance


On Monday, April 2, 2018 at 10:21:15 AM UTC-4, jcbollinger wrote:
>
> It looks like that's probably the *intended* solution, so by all means go 
> with it.  In a more general sense, however, LD_LIBRARY_PATH is not a tool 
> for use in a stable configuration.  It is for one-offs, and possibly for 
> for-purpose wrapper scripts.  It is usually a better solution, at least on 
> RedHat-family systems, to add the needed paths to the dynamic linker by 
> dropping an appropriate file in /etc/ld.so.conf.d and running ldconfig.  
> And it turns out that it's very easy to persuade Puppet to help you with 
> that.
>

I see.  I discovered that another trick would be to install the *syspaths 
packages, which put shell scripts in the usual locations of the binaries.  
These shell scripts contain the scl_source enable command, plus an exec to 
the real location of the binary. I haven't tested it yet though.

Thanks,

-- 
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/f8d7db13-94fe-4cde-976a-b31ec336ecc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Environment variable setting while using a module

2018-03-30 Thread Ugo Bellavance
I think I found a viable solution: 

$ cat /etc/profile.d/enablerh-postgresql96.sh 
#!/bin/bash
source scl_source enable rh-postgresql96


On Friday, March 30, 2018 at 11:27:28 AM UTC-4, Ugo Bellavance wrote:
>
> Hi,
>
> I'm using the puppetlabs-postgresql module and it works very well, but I 
> want to make it work with a non-standard version of postgresql (from Red 
> Hat Software Collections) because I would like to use Postgresql 9.6 on 
> RHEL 7.  Almost everything is working, but I get errors from some commands 
> that cannot find a shared object.  This is caused by the fact that Software 
> Collections package use non-standard paths for their files.  For example, 
> postgresql binaries are in opt/rh/rh-postgresql96/root/usr/bin/ than 
> /usr/bin/.  Here's the kind of errors I get:
>
> /opt/rh/rh-postgresql96/root/usr/bin/psql: error while loading shared 
> libraries: libpq.so.rh-postgresql96-5: cannot open shared object file: No 
> such file or directory
>
> The modules allows for setting a path for the binaries, but not for the 
> libraries, so it finds the binary, but I would need to set 
> the LD_LIBRARY_PATH.  Since puppet cannot use bash built-in commands, I 
> tried using /bin/bash -c 'export LD_LIBRARY_PATH= but it doesn't work. I 
> guess it a shell of its own and the export doesn't propagate to the 
> original environment.
>
> Does anyone has an idea of what I can do before I ask the maintainers of 
> the module?
>
> Thanks,
>
> Ugo
>
>

-- 
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/76d893b3-558a-4eff-81f6-52476d98d02f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Environment variable setting while using a module

2018-03-30 Thread Ugo Bellavance
Hi,

I'm using the puppetlabs-postgresql module and it works very well, but I 
want to make it work with a non-standard version of postgresql (from Red 
Hat Software Collections) because I would like to use Postgresql 9.6 on 
RHEL 7.  Almost everything is working, but I get errors from some commands 
that cannot find a shared object.  This is caused by the fact that Software 
Collections package use non-standard paths for their files.  For example, 
postgresql binaries are in opt/rh/rh-postgresql96/root/usr/bin/ than 
/usr/bin/.  Here's the kind of errors I get:

/opt/rh/rh-postgresql96/root/usr/bin/psql: error while loading shared 
libraries: libpq.so.rh-postgresql96-5: cannot open shared object file: No 
such file or directory

The modules allows for setting a path for the binaries, but not for the 
libraries, so it finds the binary, but I would need to set 
the LD_LIBRARY_PATH.  Since puppet cannot use bash built-in commands, I 
tried using /bin/bash -c 'export LD_LIBRARY_PATH= but it doesn't work. I 
guess it a shell of its own and the export doesn't propagate to the 
original environment.

Does anyone has an idea of what I can do before I ask the maintainers of 
the module?

Thanks,

Ugo

-- 
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/331a9074-61ac-4b41-baf0-4ab483655fe8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Puppet open-source EOLs

2017-12-05 Thread Ugo Bellavance


On Tuesday, December 5, 2017 at 4:33:05 AM UTC-5, Antony Fomenko wrote:
>
> Hi.
> You should update to Puppet 5. But if you use PuppetDB and want to save 
> data you will have to make a stop in Puppet4 with latest PuppetDB 2.x, then 
> update PuppetDB to 4.x and afterwards migrate to Puppet5 and PuppetDB5 due 
> to Puppet5 incompatibility with PuppetDB 2.x
>

I don't use PuppetDB so I'll go to 5 directly.

Thanks,

-- 
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/da9e94c6-0f4f-4433-bf10-dcea0ee15222%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Configuring Cisco Network devices

2017-12-05 Thread Ugo Bellavance


On Tuesday, December 5, 2017 at 3:36:11 PM UTC-5, Jo wrote:
>
> Also this helps deal with managing large numbers of ports with common 
> configuration: https://github.com/jorhett/puppet-device_hiera
>
> This is production-quality, with years of use at some very large entities.
>
> Regarding Puppet device, that's not an inherent limitation. It's pretty 
> easy to build your own providers to manage anything... done a lot of work 
> on that, unfortunately wasn't able to release most of it :(
>

It's unfortunate to see that there is no public module that is available to 
manage even simplet network devices like switches. 

-- 
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/ea25892d-a36c-46d2-90ac-588b83cc5967%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet open-source EOLs

2017-12-03 Thread Ugo Bellavance


On Sunday, December 3, 2017 at 10:02:52 AM UTC-5, Martin Alfke wrote:
>
> Hi Ugo, 
>
> > On 03 Dec 2017, at 02:14, Ugo Bellavance <ug...@lubik.ca > 
> wrote: 
> > 
> > Hi, 
> > 
> > I did google quite a lot about this because we're currently using the 
> EOL'd puppet 3.8 open-source and I'm planning the upgrade to a supported 
> version. I don't understand how the new lifecycle works. Should I upgrade 
> straight to 5 or will puppet 4 supported for a few years?  I have a puppet 
> server and I user hiera for some data. We don't use puppetdb or any other 
> fancy thing.  Our agents are only RHEL and CentOS. 
>
> Regarding EOL and life cycle you can check the following two documents: 
>
> PE support lifecycle: https://puppet.com/misc/puppet-enterprise-lifecycle 
> PE and component versions: 
> https://puppet.com/docs/pe/2017.3/overview/component_versions_in_recent_pe_releases.html
>  
>

Thanks for your quick response, it's the component versions document that I 
couldn't find. I think I'll target the next LTS version.
 

> Upgrades from Puppet 3 to newer versions can be done by directly upgrading 
> to Puppet 5. 
> In the first step you will check your existing code base and make it 
> compatible to Puppet 4 (and later). 
>

I have already started testing my code and modules against Puppet 4.  

In the next step you can enable new features like Data Types (Puppet 4.0 
> and later) and Hiera in Environments (Puppet 4.9 and later) 
>
 
Ok.they're not enabled by default?

If I understand correctly, Puppet switched to PC1 and weird numbers for 
puppet 4 and now Puppet 5 is in puppet5?

Thanks,

-- 
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/6f81f07a-cef6-4f99-98e2-a0736e90612c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Configuring Cisco Network devices

2017-12-02 Thread Ugo Bellavance
Did you check this module: https://github.com/uniak/puppet-networkdevice

Notice: it says that it's a work in progress. Use with caution and test 
extensively in lab before using in production.

On Friday, August 4, 2017 at 11:24:15 AM UTC-4, Harkanwal wrote:
>
> Hello
>
> I need help with current capabilities of Puppet configuring network 
> devices. 
>
> I know there is a cisco puppet module which requires agent to be installed 
> on end devices.
>
> My requirement is to use agent less approach. Hence looking to use puppet 
> device for that. 
>
> As per reading i have done ; Only VLANs and interfaces can be configured 
> via puppet using puppet device approach. Could anyone confirm if we can do 
> more / what else with puppet device on network side?
>
> Second is it possible to use puppet cisco module along with puppet device 
> (Agentless).
>
> Thanks in advance
>
> Regards,
> Harkanwal
>

-- 
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/5d5f6253-f0e1-4e2a-a73e-a9e597c49c76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet open-source EOLs

2017-12-02 Thread Ugo Bellavance
Hi,

I did google quite a lot about this because we're currently using the EOL'd 
puppet 3.8 open-source and I'm planning the upgrade to a supported version. 
I don't understand how the new lifecycle works. Should I upgrade straight 
to 5 or will puppet 4 supported for a few years?  I have a puppet server 
and I user hiera for some data. We don't use puppetdb or any other fancy 
thing.  Our agents are only RHEL and CentOS.

Thanks,

-- 
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/ef394d52-f068-44fc-8094-ece29abb1356%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] stdlib module invalid

2017-07-24 Thread Ugo Bellavance
Definitely...

Right 
on: 
https://github.com/zend-patterns/ZendServerPuppet/blob/master/metadata.json#L6

Thanks a lot, I submitted a PR.  Sorry for the noise, but now I understand 
the role of metadata.json better.

On Friday, July 21, 2017 at 12:11:30 AM UTC-4, Rob Nelson wrote:
>
> It is possible that zendserver may specifically request 4.3.2, rather then 
> >=4.3.2, which means 4.17.1 is an invalid version for dependencies. You can 
> check metadata.json in zendserver to see what specifically it says.
>
> On Thu, Jul 20, 2017 at 9:11 PM Ugo Bellavance <ug...@lubik.ca 
> > wrote:
>
>> Hi,
>>
>> I wonder why, on all my puppet servers, I always get an "invalid" message 
>> besides stdlib.
>>
>> # puppet module list
>> Warning: Module 'puppetlabs-stdlib' (v4.17.1) fails to meet some 
>> dependencies:
>>   'zend-zendserver' (v0.2.0) requires 'puppetlabs-stdlib' (v4.3.2)
>> /etc/puppetlabs/code/environments/production/modules
>> ├── puppetlabs-apt (v1.6.0)
>> └── puppetlabs-stdlib (v4.17.1)  invalid
>> /etc/puppetlabs/code/modules
>> └── zend-zendserver (v0.2.0)
>>
>> Anyone has an idea why?
>>
>> Thanks,
>>
>> -- 
>> 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/b68d7e0b-a900-411d-8877-f5cc28d594a7%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/puppet-users/b68d7e0b-a900-411d-8877-f5cc28d594a7%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> -- 
> Rob Nelson 
>

-- 
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/ef38dfc2-8db8-43cc-be8d-5fc6105779d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] stdlib module invalid

2017-07-20 Thread Ugo Bellavance
Hi,

I wonder why, on all my puppet servers, I always get an "invalid" message 
besides stdlib.

# puppet module list
Warning: Module 'puppetlabs-stdlib' (v4.17.1) fails to meet some 
dependencies:
  'zend-zendserver' (v0.2.0) requires 'puppetlabs-stdlib' (v4.3.2)
/etc/puppetlabs/code/environments/production/modules
├── puppetlabs-apt (v1.6.0)
└── puppetlabs-stdlib (v4.17.1)  invalid
/etc/puppetlabs/code/modules
└── zend-zendserver (v0.2.0)

Anyone has an idea why?

Thanks,

-- 
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/b68d7e0b-a900-411d-8877-f5cc28d594a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: external facts script not working, but only when puppet agent is run as a daemon

2017-07-04 Thread Ugo Bellavance
What I meant exactly is that the error messages were added to the json, so 
when I tried to load the json into an array, I got an error saying that the 
input was not a standard json string.

On Monday, July 3, 2017 at 3:20:12 PM UTC-4, Ugo Bellavance wrote:
>
> I found it: the PHP script threw PHP Notices when run as a daemon because 
> of uninitialized variables.  Got rid of them and now the script works when 
> puppet agent is run as a daemon.
>

-- 
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/c0dcb515-0954-44ae-89e1-369bf9ce8438%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: external facts script not working, but only when puppet agent is run as a daemon

2017-07-03 Thread Ugo Bellavance
I found it: the PHP script threw PHP Notices when run as a daemon because 
of uninitialized variables.  Got rid of them and now the script works when 
puppet agent is run as a daemon.

-- 
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/8b4c0ff0-b09c-427b-a251-da60229cb712%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] external facts script not working, but only when puppet agent is run as a daemon

2017-06-30 Thread Ugo Bellavance
Hi,

I'm a beginner with PHP but I managed to get two scripts to work for 
generating external facts for a puppet module.  These scripts work 
perfectly when I run puppet manually (puppet agent --test), but when the 
puppet agent is started as a daemon (systmctl start puppet), facts are not 
generated. Both scripts give the same error: 

start-puppet-agent: Fact file 
/var/lib/puppet/facts.d/get_extensions_details.php was parsed but returned an 
empty data set

start-puppet-agent: Fact file 
/var/lib/puppet/facts.d/get_directives_details.php was parsed but returned an 
empty data set


I wonder what kind of difference could cause that.

I tried debugging as much as I can, but it looks like the array $arr is not 
fed by the json_decode function. I think json support is built-in so the 
php config should not matter. PHP throws this error: invalid argument 
supplied for foreach()

Scripts: 
https://github.com/zend-patterns/ZendServerPuppet/blob/master/facts.d/get_directives_details.php
https://github.com/zend-patterns/ZendServerPuppet/blob/master/facts.d/get_extensions_details.php

(still) running puppet 3

Thanks,

-- 
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/e9842922-38e2-4e44-81e7-2a37485c0a54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] getvar and case

2017-06-28 Thread Ugo Bellavance
I confirm that using stdlib's downcase() worked.

-- 
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/d1e9f7a0-e8de-4457-b43f-4020931d46e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] getvar and case

2017-06-23 Thread Ugo Bellavance


On Friday, June 23, 2017 at 2:01:46 AM UTC-4, R.I. Pienaar wrote:
>
> You don't mention your versions but on the last 2 years of versions - i.e. 
> 4 - do: 
>
> $facts["zend_application_name_${user_app_name}"] 
>
>
It looks like the facts are all forced downcase 
(https://tickets.puppetlabs.com/browse/FACT-777).

I changed

$directive_value_fact   = getvar("::zend_directive_fileValue_${name}")

to

$directive_value_fact   = getvar("::zend_directive_filevalue_${name}")

and it seems to be working.

I'll have to find a way to do a downcase on the variables and I think it'll 
be ok.

I'll try to think about posting my final results for the community's 
benefit.

Thanks,

-- 
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/6370ae09-4938-4b72-bdde-3cd85c1888df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] getvar and case

2017-06-23 Thread Ugo Bellavance


On Friday, June 23, 2017 at 2:01:46 AM UTC-4, R.I. Pienaar wrote:
>
> You don't mention your versions but on the last 2 years of versions - i.e. 
> 4 - do: 
>
> $facts["zend_application_name_${user_app_name}"] 
>

Unfortunately, I'm still on Puppet 3.8.  I know that Puppet 3 is EOL and 
Puppet 5 is already available (at least as beta), but I've been swamped 
with work and didn't have time to start to plan my migration yet. I have 
installed Puppet 4 on a server, but that's about how far I could go for 
now.  If I could solve this specific problem, I'll have about 98% of this 
task done so I'm just about to be able to start to work with a more recent 
version of puppet.

Thanks,
 

>
> --- 
> R.I.Pienaar 
>
> > On 23 Jun 2017, at 05:03, Ugo Bellavance <ug...@lubik.ca > 
> wrote: 
> > 
> > zend_application_name_${user_app_name} 
>
>

-- 
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/92d689bb-7494-406f-a93b-d2ffcc64a303%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] getvar and case

2017-06-22 Thread Ugo Bellavance
Hi,

I'm fetching some data in facts using getvar, but as soon as there is a 
capital letter in the result, the result doesn't go in the variable.

For example, this never returns anything:

  $directive_value_fact   = getvar("::zend_directive_fileValue_${name}")

The generated fact that I'm looking for contains "fileValue" so I don't 
really have the choice, except to maybe edit the fact-gathering script to 
do replace, but it may cause other problems.

I'm on stdlib 4.16 and I don't see any bugfixes for that in the changelog 
of more recent versions.

Another example... This works, as long as "name" doesn't contain a capital 
letter. And some extensions start with a capital letter (like Phar).

  $extension_status_fact   = getvar("::zend_extension_status_${name}")

Final example.  This works, as long as ${user_app_name} doesn't contain a 
capital letter.

  $app_name_fact   = getvar("::zend_application_name_${user_app_name}")

Actually, from my testing I found that that if ${user_app_name} is all 
caps, it would work.

Any ideas welcome.  For ${user_app_name}, the workaround would be to only 
use all-lowercase application names, but since we don't decide the exact 
name of PHP extensions, the workaround doesn't work.

As you can see in the facts, the only way to get the data that we need is 
to get the zend_directive_fileValue to the the current value of the 
directive.

zend_directive_name_upload_max_filesize=upload_max_filesize
zend_directive_section_upload_max_filesize=
zend_directive_fileValue_upload_max_filesize=32M
zend_directive_defaultValue_upload_max_filesize=32M
zend_directive_isMemoryOnly_upload_max_filesize=0
zend_directive_previousValue_upload_max_filesize=
zend_directive_description_upload_max_filesize=The maximum size of an 
uploaded file
zend_directive_type_upload_max_filesize=shorthand
zend_directive_listValues_upload_max_filesize=
zend_directive_context_upload_max_filesize=Extension
zend_directive_contextName_upload_max_filesize=Filesystem and Streams
zend_directive_units_upload_max_filesize=


Thanks,

Ugo

-- 
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/ae0fd784-fb27-486b-b770-bace0970e58d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Apply every time for no reason = acceptable?

2017-06-04 Thread Ugo Bellavance
Hi,

I'm working on a module that applies some changes through API commands. 
 Where I am now, it's now able to set values to a PHP config using this 
API, but I feel it is a bit ugly because it does the API call every time 
puppet runs, no matter if there is a change or not.  It is problematic? I 
feel like a puppet run should be clean (silent) when nothing changes, but I 
am not aware of best practices stating otherwise either.  It is possible 
for me to use an unless statement to do an API call to determine if the 
config is already at the desired value, but it is, of course, more work.

Thanks,

-- 
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/1bb435cb-37f3-4216-ae8a-68041dc9a7b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Puppet Apply

2017-06-04 Thread Ugo Bellavance

On Friday, June 2, 2017 at 2:05:53 PM UTC-4, Corey Osman wrote:
>
> I would suggest using a tool I wrote called the puppet debugger.  It 
> allows you to write little bits of code in realtime and get the results 
> back right away.  It is a wonderful tool to learn the language with.  
>
> Basically just install it and run puppet debugger, than write some puppet 
> code.  
>
> github.com/nwops/puppet-debugger 
>
> Or online at https://www.puppet-debugger.com
>

That looks fantastic. Can it test modules as well? 

-- 
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/2f64e512-ac04-48f3-9e14-ce1bf21d2b7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Order two calls of parameterized classes

2017-06-02 Thread Ugo Bellavance

>
> As simple as that?  Great.  I tried it and the reload did run after the 
> add, but I can't see from the logs that the reload has the add as 
> dependency.
>
> With your suggested change:
>
> Debug: 
> /Stage[main]/Main/Node[default]/Zendserver::Vhost[vhost1test91]/Zendserver::Vhost::Add[vhost1test91]/Zendserver::Sdk::Command[vhost_add_vhost1test_91]/Exec[zsapi_vhost_add_vhost1test_91]:
>  
> The container Zendserver::Sdk::Command[vhost_add_vhost1test_91] will 
> propagate my refresh event
> Debug: Zendserver::Sdk::Command[vhost_add_vhost1test_91]: The container 
> Zendserver::Vhost::Add[vhost1test91] will propagate my refresh event
> Debug: 
> /Stage[main]/Main/Node[default]/Zendserver::Vhost[vhost1test91]/Zendserver::Vhost::Add[vhost1test91]/Zendserver::Sdk::Command[vhost_reload_vhost1test_91]/Exec[zsapi_vhost_reload_vhost1test_91]/returns:
>  
> Exec try 1/3
> Debug: Exec[zsapi_vhost_reload_vhost1test_91](provider=posix): Executing 
> '/usr/local/zend/bin/zs-client.sh restartPhp --target=localadmin  '
> Debug: Executing '/usr/local/zend/bin/zs-client.sh restartPhp 
> --target=localadmin  '
>
> Without your change (my original code):
>
> Debug: 
> /Stage[main]/Main/Node[default]/Zendserver::Vhost[vhost1test91]/Zendserver::Vhost::Remove[vhost1test91]/Zendserver::Sdk::Command[vhost_remove_vhost1test_91]/Exec[zsapi_vhost_remove_vhost1test_91]:
>  
> The container Zendserver::Sdk::Command[vhost_remove_vhost1test_91] will 
> propagate my refresh event
> Debug: Zendserver::Sdk::Command[vhost_remove_vhost1test_91]: The container 
> Zendserver::Vhost::Remove[vhost1test91] will propagate my refresh event
> Debug: 
> /Stage[main]/Main/Node[default]/Zendserver::Vhost[vhost1test91]/Zendserver::Vhost::Remove[vhost1test91]/Zendserver::Sdk::Command[vhost_reload_vhost1test_91]/Exec[zsapi_vhost_reload_vhost1test_91]/returns:
>  
> Exec try 1/3
> Debug: Exec[zsapi_vhost_reload_vhost1test_91](provider=posix): Executing 
> '/usr/local/zend/bin/zs-client.sh restartPhp --target=localadmin  '
> Debug: Executing '/usr/local/zend/bin/zs-client.sh restartPhp 
> --target=localadmin  '
>
> I don't see any difference.
>
>
I think I found it:

Debug: 
/Stage[main]/Main/Node[default]/Zendserver::Vhost[vhost1]/Zendserver::Vhost::Add[vhost1]/Zendserver::Sdk::Command[vhost_add_vhost1_80]/
before: requires Zendserver::Sdk::Command[vhost_reload_vhost1_80]
 

-- 
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/d53e3826-43fc-42ef-86cb-1a3bf4649efc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Puppet Apply

2017-06-02 Thread Ugo Bellavance


On Friday, June 2, 2017 at 9:10:00 AM UTC-4, Fairouz el ouazi wrote:
>
> HI, 
>First thank you for your response : My problem is a little bit 
> complicated . ..and  it took 's me  one week to know if puppet is the 
> device management that i m looking for  . To be more clear  ...there's an 
> existing platform that manage devices ( IOT devices ) it 's an application 
> that is  divided in many components one of them do "device management " in 
> a simple way with less functionalities for example it can't offer groupping 
> to change parameters of 10 devices at the same time ..or auto-provisioning 
> ...my job is to integrate a good device management on this platform but in 
> collaboration with the existant ... i  was thinkinh of making a puppet 
> server in the level over the existing platform and using the existant 
> device management as an agent ???
>
> Sorry my english is not that good ..but i m trying to do my best ..
>
>
No problem about the language, you're doing your best and that is the only 
thing that matters.  However, it is very hard for me to see if puppet is a 
good for you without having more information, but I think that you are the 
best person to do your tests and determine if puppet is right for you. 
 Basically, puppet can do many things on an agent (client): push files, 
install packages, start services, configure services, etc. It contains a 
number or resource types that, in turn, can be use to achieve real results 
(install and configure a LAMP stack for example, or install MySQL server 
and create a database called db1).

Ugo

-- 
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/46da62d8-0476-4102-ae81-f1af3da9a333%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Puppet Apply

2017-06-02 Thread Ugo Bellavance


On Friday, June 2, 2017 at 8:06:28 AM UTC-4, Ugo Bellavance wrote:
>
>
>
> On Friday, June 2, 2017 at 4:49:13 AM UTC-4, Fairouz el ouazi wrote:
>>
>> HI, 
>>
>>I'm still a beginner in Puppet , and i want to know the advantages and 
>> in winch cases we have to use Puppet in standalone  version ?
>>All that i found is that :single host method on puppet can be the best 
>> way to get started with puppet language , and the best way to quickly 
>> develop and test manifest ? 
>>If anyone has any examples of use cases ? 
>>   THINKS ,
>>
>
> I'd say that the first step would be to create a lab to do some testing. 
> I'd also recommend buying one or a few books about the topic, this will 
> help you a lot. Have you started searching a bit by yourself?  Did you see 
> https://learn.puppet.com/category/self-paced-training?
>
> I'm not sure if I understand your questions correctly, but I don't think 
> there is a "best" way of testing.  You can write manifests on a single VM 
> and test them, but you can also setup a server quite quickly and get going 
> like that. I know that many books cover this topic. I just can't remember 
> which ones.
>
> What kind of use cases are you looking for? Do you have any business needs 
> or is it just to learn?  I suggest that you look at public modules that are 
> on the forge. It's good to be able to create manifests and modules, but 
> many needs can be fulfilled by using modules.
>

This tutorial 
<https://www.linode.com/docs/applications/configuration-management/install-and-configure-puppet>is
 
not perfect, but it's quite good: 

-- 
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/b0fa629e-ad2a-4b65-a937-f32b14b83ba4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Order two calls of parameterized classes

2017-06-02 Thread Ugo Bellavance


On Thursday, June 1, 2017 at 11:39:26 PM UTC-4, Matthew Kennedy wrote:
>
> Because puppet is declarative you can only have one instance of a resource 
> with a particular title in the catalog. This means you cannot have two 
> instances of a class in the catalog (though you can include a class 
> multiple times but it only exists in the catalog once)
>
> Luckily you do not have two instances of a class. 
>  'zendserver::sdk::command' appears to be a defined type.
>

That was on purpose :).
 

>
> Defined types generate resources. You can have multiple instances of a 
> type so long as the title is unique. This is exactly what your example 
> shows, two instances of 'zendserver::sdk::command' with two different 
> titles.
>
> Now the good part for you. Defined types contain all of their unique 
> resources.  This means that any resources that get generated by 
> 'zendserver::sdk::command' will honor the ordering metaparameters. See 
> https://docs.puppet.com/puppet/4.10/lang_defined_types.html#containment
>
> The only thing you need to do to order your commands is add a -> after the 
> closing } of the first command ie
>
> zendserver::sdk::command { "vhost_add_${vhostname}_${port}":
>   target => $target,
>   api_command=> 'vhostAdd',
>   additional_options => $additional_options,
> } ->
> zendserver::sdk::command { "vhost_reload_${vhostname}_${port}":
>   target => $target,
>   api_command=> 'restartPhp',
> }
>
> Now all resources generated by Zendserver::Sdk::Command[
> "vhost_reload_${vhostname}_${port}"] will apply /after/ the resources 
> generated by Zendserver::Sdk::Command["vhost_add_${vhostname}_${port}"]
>


As simple as that?  Great.  I tried it and the reload did run after the 
add, but I can't see from the logs that the reload has the add as 
dependency.

With your suggested change:

Debug: 
/Stage[main]/Main/Node[default]/Zendserver::Vhost[vhost1test91]/Zendserver::Vhost::Add[vhost1test91]/Zendserver::Sdk::Command[vhost_add_vhost1test_91]/Exec[zsapi_vhost_add_vhost1test_91]:
 
The container Zendserver::Sdk::Command[vhost_add_vhost1test_91] will 
propagate my refresh event
Debug: Zendserver::Sdk::Command[vhost_add_vhost1test_91]: The container 
Zendserver::Vhost::Add[vhost1test91] will propagate my refresh event
Debug: 
/Stage[main]/Main/Node[default]/Zendserver::Vhost[vhost1test91]/Zendserver::Vhost::Add[vhost1test91]/Zendserver::Sdk::Command[vhost_reload_vhost1test_91]/Exec[zsapi_vhost_reload_vhost1test_91]/returns:
 
Exec try 1/3
Debug: Exec[zsapi_vhost_reload_vhost1test_91](provider=posix): Executing 
'/usr/local/zend/bin/zs-client.sh restartPhp --target=localadmin  '
Debug: Executing '/usr/local/zend/bin/zs-client.sh restartPhp 
--target=localadmin  '

Without your change (my original code):

Debug: 
/Stage[main]/Main/Node[default]/Zendserver::Vhost[vhost1test91]/Zendserver::Vhost::Remove[vhost1test91]/Zendserver::Sdk::Command[vhost_remove_vhost1test_91]/Exec[zsapi_vhost_remove_vhost1test_91]:
 
The container Zendserver::Sdk::Command[vhost_remove_vhost1test_91] will 
propagate my refresh event
Debug: Zendserver::Sdk::Command[vhost_remove_vhost1test_91]: The container 
Zendserver::Vhost::Remove[vhost1test91] will propagate my refresh event
Debug: 
/Stage[main]/Main/Node[default]/Zendserver::Vhost[vhost1test91]/Zendserver::Vhost::Remove[vhost1test91]/Zendserver::Sdk::Command[vhost_reload_vhost1test_91]/Exec[zsapi_vhost_reload_vhost1test_91]/returns:
 
Exec try 1/3
Debug: Exec[zsapi_vhost_reload_vhost1test_91](provider=posix): Executing 
'/usr/local/zend/bin/zs-client.sh restartPhp --target=localadmin  '
Debug: Executing '/usr/local/zend/bin/zs-client.sh restartPhp 
--target=localadmin  '

I don't see any difference.

Thanks,

-- 
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/8ef98bc1-a184-4b78-824a-e27c2b5b2c7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Order two calls of parameterized classes

2017-06-02 Thread Ugo Bellavance


On Thursday, June 1, 2017 at 6:08:01 PM UTC-4, Pete Brown wrote:
>
> The require meta parameter will do that.
>

Ok, but how to formulate it with the variables?

-- 
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/e51022f2-9761-4357-8efc-3077ec66568a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Puppet Apply

2017-06-02 Thread Ugo Bellavance


On Friday, June 2, 2017 at 4:49:13 AM UTC-4, Fairouz el ouazi wrote:
>
> HI, 
>
>I'm still a beginner in Puppet , and i want to know the advantages and 
> in winch cases we have to use Puppet in standalone  version ?
>All that i found is that :single host method on puppet can be the best 
> way to get started with puppet language , and the best way to quickly 
> develop and test manifest ? 
>If anyone has any examples of use cases ? 
>   THINKS ,
>

I'd say that the first step would be to create a lab to do some testing. 
I'd also recommend buying one or a few books about the topic, this will 
help you a lot. Have you started searching a bit by yourself?  Did you 
see https://learn.puppet.com/category/self-paced-training?

I'm not sure if I understand your questions correctly, but I don't think 
there is a "best" way of testing.  You can write manifests on a single VM 
and test them, but you can also setup a server quite quickly and get going 
like that. I know that many books cover this topic. I just can't remember 
which ones.

What kind of use cases are you looking for? Do you have any business needs 
or is it just to learn?  I suggest that you look at public modules that are 
on the forge. It's good to be able to create manifests and modules, but 
many needs can be fulfilled by using modules.

-- 
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/f48e7211-9fa6-4a90-bacd-1e3169a7adbb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Order two calls of parameterized classes

2017-06-01 Thread Ugo Bellavance
Hi,

I would need to execute a command after the execution of another and I 
didn't find anything on the web regarding this.  Here's the code:

  if $vhost_name_fact != undef {

  } else {
zendserver::sdk::command { "vhost_add_${vhostname}_${port}":
  target => $target,
  api_command=> 'vhostAdd',
  additional_options => $additional_options,
}
zendserver::sdk::command { "vhost_reload_${vhostname}_${port}":
  target => $target,
  api_command=> 'restartPhp',
}
  }

I would like to have the second command to always be executed once the 
first one has been executed.  How would I do that?

Thanks,

Ugo

-- 
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/9d740bb9-1239-4c0f-935e-7b949b1c7ac6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Equivalent of Require, but slightly different

2017-05-15 Thread Ugo Bellavance

>
> Hi, 
>
> Your comparison of $::zend_gui_completed is never boolean true, so the 
> notify always happens. Perhaps your fact is returning a string and not a 
> boolean. Put this in your code just above the conditional statement. 
>
> $zgc_type = inline_template('<%= @zend_gui_completed.class %>') 
> notify { "zend_gui_completed is type ${zgc_type}": } 
>
> If it is a string, check out str2bool() from stdlib[1]. 
>
> [1] - https://github.com/puppetlabs/puppetlabs-stdlib#str2bool 
>
> First thanks for your complete and super quick reply.

I understand why it doesn't work now.  I'll try that tomorrow. And would 
you have any hints for me regarding my 2nd question?  How can I skip the 
execution of a section (class?) if this variable is not true?

Thanks,

-- 
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/3cfc6c98-269a-43ff-9325-ce6ea3d7fb9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Equivalent of Require, but slightly different

2017-05-15 Thread Ugo Bellavance
Hi,

I'm working on a public puppet module and while I've done a lot of 
improvements up to now (especially considering my puppet capabilities), 
there is still a lot of work to do and I'd need some help for my next step. 
 My repo is https://github.com/ubellavance/ZendServerPuppet and my next 
target is to make sure that an application action is not done before the 
bootstrap is complete.  Explanations: the module performs a "bootstrap" 
process at the first puppet run (just after installing the packages).  If I 
set an application action (define, for example) before the bootstrap 
process is complete (which would obviously happen), there is an error with 
obscure error messages provided by the Zend Server API, which isn't really 
user-friendly and it causes a failure of the puppet run.  There is a fact 
that is set to true if the bootstrap is complete: $::zend_gui_completed.  I 
tried doing a conditional statement using this variable but I don't know 
how to just do nothing for the application action and just output a message 
(notify) saying that the application actions will be applied after the 
bootstrap. It is a bit tricky because before the bootstrap it doesn't 
exist, so it is undefined, and once the bootstrap is complete, it equals to 
true.

I tried this, in application.pp, but it looks like the if doesn't work 
because the notify occurs every time

  if $::zend_gui_completed != true {

notify {"zend_gui_completed = $::zend_gui_completed. Bootstrap must run 
first. Application settings will be applied after Bootstrap is done": }

  }


Here's the output:


Notice: 
/Stage[main]/Main/Node[default]/Zendserver::Application[patate]/Notify[zend_gui_completed
 
= true. Bootstrap must run first. Application settings will be applied 
after Bootstrap is done]/message: defined 'message' as 'zend_gui_completed 
= true. Bootstrap must run first. Application settings will be applied 
after Bootstrap is done'


Could someone help me figure out how to make the if work, and, even more 
important, if there is a way to "bypass" the zendserver::application blocks 
if zend_gui_completed is not true?


Here's my application::define:


  zendserver::application { 'patate':

ensure   => 'define',

base_url => "http://patate.com;,

version  => "2",

logo => "/usr/share/pixmaps/poweredby.png"

}


Please let me know if you need more information.  


Thanks,

-- 
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/e22e885d-5342-4432-8cb9-f030ea0483f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Upgrading to Puppet 4 - what about the modules

2017-05-04 Thread Ugo Bellavance
Oh, so modules that claim to be non-puppet3-compatible from now on is 
because they implemented things that are only supported in Puppet 4?  It's 
clearer in my head now.  I'll try the modules I use under puppet 4 and see 
which break.  I'm pretty sure that my current puppet setup will not work as 
I still use import statements.  It was deprecated in puppet3, I guess it is 
not supported in 4?

Thanks,

Ugo

On Wednesday, May 3, 2017 at 11:11:23 PM UTC-4, Rob Nelson wrote:
>
> Generally speaking, modules created for Puppet 3 are likely to work in 
> puppet 4 without changes. Of course, that's not to say that all will, you 
> will have to test and make sure yourself since the module author has not.
>
> However, if a module on the forge does not support puppet 3 by now, that 
> may be a warning sign that development has stalled or the module has been 
> migrated to another namespace. You should attempt to discover if either are 
> the case, so you can plan accordingly - there's no guarantee a module 
> designed for Puppet 3 that is incidentally compatible with Puppet 4 will 
> also be compatible with future versions of puppet 5, and a lack of bug 
> fixes may be problematic as well. Something to explore, anyway.
>
> On Wed, May 3, 2017 at 9:44 PM Ugo Bellavance <ug...@lubik.ca 
> > wrote:
>
>> Hi,
>>
>> I'm currently running a puppet 3 server that serves about 20 puppet 3 
>> clients.  I use a number of modules, and most of them are not compatible 
>> with puppet 4.  There is at least one module that is not compatible with 
>> puppet 4. Is puppet 4 backwards compatible somehow or do we need to have 
>> all our modules puppet 4-ready before upgrading?
>>
>> Thanks,
>>
>> Ugo
>>
>> -- 
>> 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/fc974974-b393-46d9-a5f2-4670ccd7d686%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/puppet-users/fc974974-b393-46d9-a5f2-4670ccd7d686%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> -- 
> Rob Nelson 
>

-- 
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/b7314c2b-5d5a-406d-a0dd-c10586c020f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Upgrading to Puppet 4 - what about the modules

2017-05-03 Thread Ugo Bellavance
Hi,

I'm currently running a puppet 3 server that serves about 20 puppet 3 
clients.  I use a number of modules, and most of them are not compatible 
with puppet 4.  There is at least one module that is not compatible with 
puppet 4. Is puppet 4 backwards compatible somehow or do we need to have 
all our modules puppet 4-ready before upgrading?

Thanks,

Ugo

-- 
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/fc974974-b393-46d9-a5f2-4670ccd7d686%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Puppet master log

2017-01-24 Thread Ugo Bellavance


On Tuesday, October 18, 2016 at 3:04:16 PM UTC-4, Ugo Bellavance wrote:
>
> Hi,
>
> I switched from puppet 2.7 on RHEL5 to puppet 3.8. In the 2.7 logs, I 
> could see the agent's logs, but in 3.8, I don't.  I tried changing the 
> log_level, but it didn't change the way it logged, even at debug.  How do I 
> get back the 2.7 log behaviour?
>
> Thanks,
>

The answer: 

[master]
ssldir = $confdir/ssl
log_level = debug
reports=store,rrdgraph,log

-- 
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/db9008b1-a632-42ec-82e7-2c82d410ea01%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Regex auto-escape

2017-01-13 Thread Ugo Bellavance


On Friday, January 13, 2017 at 6:24:57 AM UTC-5, Thomas Müller wrote:
>
>
>
> Am Donnerstag, 12. Januar 2017 20:23:48 UTC+1 schrieb Ugo Bellavance:
>>
>> Hi,
>>
>> I've been working on a public module that manage text entries that have 
>> SELinux contexts in them. I added basic support to some of the regex 
>> special characters that may be used in SELinux contexts and here's the 
>> result: 
>> https://github.com/ubellavance/puppet-selinux/blob/deleteworks/manifests/fcontext.pp#L49-L50.
>>  
>>  After having done something that fits my need up to now, I knew that it 
>> was probably not perfect so I looked at some lists of contexts and found 
>> out that there are a lot more than just "(/.*)" entries but I think it 
>> doesn't make sense to do a regsubst for every special character.  Is there 
>> something that can be done directly in the module that would automatically 
>> put a backspace before every regex special character?
>>
>>  
> maybe the shellwords does it for you: 
> http://ruby-doc.org/stdlib-2.0.0/libdoc/shellwords/rdoc/Shellwords.html
>
>  
> instead of working on your own selinux module I'd invite you to 
> parcitipate on the voxpupuli/selinux module: 
> https://github.com/voxpupuli/puppet-selinux
>
 
Thanks for your answer. The selinux module is actually from camptocamp. 
Mine is a fork, but you're right, I should test voxpopuli'.  At the time at 
which I needed an SELinux module, I needed SELinux ports support, which, I 
think, wasn't supported by voxpopul's (or its ancestor), so I chose 
camptocamp's. I realize that I "lost" many hours to improve camptocamp's 
module while a switch to voxpopuli was the right thing to do.  At least it 
gave me more experience with contributing to puppet modules.  camptocamp's 
module is simpler than voxpopuli, so it's more accessible to me.

Now I have some testing to do :).

Thanks!

-- 
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/981fcd68-02d2-46e4-9fa0-80ebc9dbf67a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Regex auto-escape

2017-01-12 Thread Ugo Bellavance
Hi,

I've been working on a public module that manage text entries that have 
SELinux contexts in them. I added basic support to some of the regex 
special characters that may be used in SELinux contexts and here's the 
result: 
https://github.com/ubellavance/puppet-selinux/blob/deleteworks/manifests/fcontext.pp#L49-L50.
 
 After having done something that fits my need up to now, I knew that it 
was probably not perfect so I looked at some lists of contexts and found 
out that there are a lot more than just "(/.*)" entries but I think it 
doesn't make sense to do a regsubst for every special character.  Is there 
something that can be done directly in the module that would automatically 
put a backspace before every regex special character?

Thanks,

-- 
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/54910310-4a33-431c-897a-36c5a9020f1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Tidy not working

2016-11-15 Thread Ugo Bellavance
Hi,

# puppet -V
2.7.26

(both on server and client).

I created this manifest:

class tidy_dtools_logdir {

  tidy { "/opt/ati/dtools-current-version/log/":
age => '1w',
  }

}

Added the class to the node, then ran puppet, then:

cat /var/lib/puppet/classes.txt | grep dtool
tidy_dtools_logdir

Many files in this directory are from September (atime and mtime) but when 
I run puppet, no file is deleted.

I tried recurse => 'yes' (even if there is no subdir), type => 'mtime'.

It's the first time I try using tidy, am I missing something obvious?

Ugo

-- 
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/1d8a4483-8ba2-4977-b2b8-e81f1f9090a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Role vs hiera

2016-10-27 Thread Ugo Bellavance


On Thursday, October 27, 2016 at 11:45:06 AM UTC-4, Thomas Müller wrote:
>
>
>
> Am 27.10.2016 um 15:43 schrieb Ugo Bellavance: 
> > That looks great, thanks! 
> > 
> > However, I just realized that my server roles are somewhat related to 
> > the server names.  For example, I could call my webservers something 
> > like www1, www2, www3.  If all those 3 servers have the same config, 
> > is there a way to create a file that would apply to all of them? 
> >  Something like /hiera/hosts/www?.yaml ? 
> no there is no wildcard option. If your hostnames contain the role, you 
> could do something like this: 
>
>
> if $trusted['certname'] =~ /^([a-z]+)[0-9]+\./) { 
>   $role = $1 
> } else { 
>   fail('Could not determine role') 
>   # or set some default role? or call $role = hiera('role'), ... whatever 
> you like 
> } 
>
> I really only would do it by hostname if you are sure your dns names 
> reflect the roles now and forever (or if you are in position to decide 
> that it will be that way forever). 
>
> or like Rob has written, creating a custom fact works too. 
>
>
> > 
> > If not, could I use a hard or soft link? 
> This should work IMHO. 
>

Considering our size, I think I'll go that way.

Thanks everyone for all your help!

Ugo


-- 
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/dfe0f2ad-c800-4ab2-8bc3-e6f2bcedc68d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Role vs hiera

2016-10-27 Thread Ugo Bellavance
That looks great, thanks!

However, I just realized that my server roles are somewhat related to the 
server names.  For example, I could call my webservers something like www1, 
www2, www3.  If all those 3 servers have the same config, is there a way to 
create a file that would apply to all of them?  Something like 
/hiera/hosts/www?.yaml ?

If not, could I use a hard or soft link?

Thanks,

On Thursday, October 27, 2016 at 3:52:49 AM UTC-4, Thomas Müller wrote:
>
>
>
> Am Dienstag, 18. Oktober 2016 20:34:25 UTC+2 schrieb Ugo Bellavance:
>>
>> Hi,
>>
>> I've seen tutorials where they add the role as a fact in an client and 
>> then can use the role for hiera data. Is there a better way to do so (ie 
>> without having to configure anything on the client)?
>>
>
> you could add a hiera call to your main site.pp* to define a top-scope 
> variable which then is also usable in the hiera hiearchy. 
>
> $role = hiera('role', 'default')
>
> node "default" {
>   include "::role::${::role}"
>   # or hiera_include*
>   hiera_include()
> }
>
>
> hiera.yaml example:
>
>
> :backends:
>   - yaml
> :yaml:
>   :datadir: "/etc/puppetlabs/code/environments/%{environment}/hieradata"
> :hierarchy:
>   - "nodes/%{::trusted.certname}"
>   - "virtual/%{::role}"
>   - "osfamily/%{::osfamily}"
>   - common
>
>
> there are more pretty solutions like 
> https://github.com/ripienaar/puppet-classifier on Puppet4 and with the 
> new lookup() functions with supports "knockout". 
>
> - Thomas
>
>
> * https://docs.puppet.com/puppet/latest/reference/dirs_manifest.html 
>
>
> https://docs.puppet.com/hiera/3.2/puppet.html#assigning-classes-to-nodes-with-hiera-hierainclude
>
> https://docs.puppet.com/hiera/3.2/complete_example.html
>
> https://www.devco.net/archives/2016/03/13/the-puppet-4-lookup-function.php
>

-- 
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/8413155f-08f8-4437-b018-58353e57af4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Role vs hiera

2016-10-25 Thread Ugo Bellavance
Hi,

I was actually wondering if it could be done without an ENC as we don't 
have one for now.

Thanks a lot for your input though.

Ugo

On Tuesday, October 18, 2016 at 3:50:37 PM UTC-4, Matt Zagrabelny wrote:
>
> On Tue, Oct 18, 2016 at 1:34 PM, Ugo Bellavance <ug...@lubik.ca 
> > wrote: 
> > Hi, 
> > 
> > I've seen tutorials where they add the role as a fact in an client and 
> then 
> > can use the role for hiera data. Is there a better way to do so (ie 
> without 
> > having to configure anything on the client)? 
>
> As a matter of fact there is a better way. 
>
> If you use an ENC, then you can return the role as a top scope 
> variable and your hiera configs can leverage those top scope 
> variables. 
>
> Here is an example where I've scrubbed any of our site data: 
>
> # puppet-enc ldap.example.com 
> --- 
> classes: 
>   role::directory_server: null 
> environment: production 
> parameters: 
>   context: production 
>   role: role::directory_server 
>
> The "classes" at the top and its "role" are for the classifying of the 
> ENC, but the "context" and "role" in the  "parameters" near the bottom 
> are variables that get exposed - hiera is one of the things that can 
> use those variables. 
>
> This works super slick for us. 
>
> For what it is worth, we also use a notion of context that allows our 
> ENC to describe whether a node is a "testing" or "production" type 
> system - we have hiera lookups based on that data, too. 
>
> Let me know if you want the hiera configs. 
>
> -m 
>

-- 
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/abc28af3-5bce-4241-b219-8929c383d9a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Using a module that is not 100% hiera-compliant

2016-10-19 Thread Ugo Bellavance
Hi Chadwick,

I'll definitely look a it soon, but can you explain what the lines do?

What would key_name be?

Thanks!

On Wednesday, October 19, 2016 at 8:01:34 AM UTC-4, Chadwick Banning wrote:
>
> I looked at the PR (https://github.com/camptocamp/puppet-postfix/pull/50) 
> to add "Hiera support" and it appears that it just add some parameters that 
> take hashes that are used to auto-generate instances of defined types. I 
> wouldn't call this "Hiera support", I'd just call it "convenience 
> parameters".
>
> There's no reason you couldn't just do this on your own in a profile (or 
> anywhere else):
>
> $configs = hiera('')
> create_resources('postfix::config', $configs)
>
> On Tuesday, October 18, 2016 at 1:56:59 PM UTC-4, Ugo Bellavance wrote:
>>
>> Hi,
>>
>> I am using camptocamp/postfix for my postfix configuration.  I originally 
>> defined all my configs manifests but now I would like to change to using 
>> hiera.  Unfortunately, this module doesn't support hiera for some of the 
>> configs, so I must define many parameters in the manifests.  I wanted to 
>> use hiera for simplicity, but also because I have a very nice use case:  I 
>> have one SMTP front-end with its own specific configs (anti-spam/virus), 
>> and a series of regular hosts. Traditionally, all hosts that are in the 
>> same subnet as the Exchange server would use it as relayhost and all the 
>> other hosts use the smtp front-ends.  Therefore, here's what I did:
>>
>> hiera.yaml:
>>
>> ---
>> :backends:
>> #  - regex
>>   - yaml
>> :yaml:
>>   :datadir: /etc/puppet/hiera
>> #:regex:
>> #  :datadir: /var/lib/hiera
>> :hierarchy:
>>   - "host/%{fqdn}"
>>   - "domain/%{domain}"
>>   - "env/%{::environment}"
>>   - "os/%{operatingsystem}"
>>   - "osfamily/%{osfamily}"
>>   - "networks/%{network_ens192}"
>>   - "virtual/%{::virtual}"
>>   - common
>>
>> This way, I define the exchange server as relayhost for the exchange 
>> network in /etc/puppet/hiera/networks/192.168.155.0.yaml, and set the smtp 
>> frontend as relayhost in /etc/puppet/hiera/common.yaml.
>>
>> However, since I can't put all the settings in hiera, I must put some in 
>> the class declaration for the smtp frontends.  When I declare the postfix 
>> class in both my default profile and in the smtp frontend profile, I get an 
>> error saying that the class cannot be declared twice (Class[Postfix] is 
>> already declared; cannot redeclare at 
>> /etc/puppet/manifests/nodes/smtp_postfix_servers.pp:19)
>>
>> Another solution would be to declare the profile in all my roles, but 
>> it's far from perfect.
>>
>> Is there a simple solution?
>>
>> I guess that I could do an if based on ipaddress in my default profile, 
>> but I wanted to use hiera as much as possible. Yes I created an issue to 
>> ask for full hiera support.
>>
>> Thanks,
>>
>> Ugo
>>
>

-- 
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/749872aa-e882-41e4-a82d-94d5b31545c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet master log

2016-10-18 Thread Ugo Bellavance
Hi,

I switched from puppet 2.7 on RHEL5 to puppet 3.8. In the 2.7 logs, I could 
see the agent's logs, but in 3.8, I don't.  I tried changing the log_level, 
but it didn't change the way it logged, even at debug.  How do I get back 
the 2.7 log behaviour?

Thanks,

-- 
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/3fc39df6-8e01-45ea-a74b-dfeab7d5f00d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Role vs hiera

2016-10-18 Thread Ugo Bellavance
Hi,

I've seen tutorials where they add the role as a fact in an client and then 
can use the role for hiera data. Is there a better way to do so (ie without 
having to configure anything on the client)?

Thanks,

-- 
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/e8e5be9f-65b7-467d-a900-04235944803a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Default profile or role

2016-10-18 Thread Ugo Bellavance
So if my default node looks like this:

node default {
class { 'sudo': }

sudo::conf { 'wheel':
  content  => '%wheel  ALL=(ALL)   ALL',
  }

sudo::conf { 'defaults_mail_always':
  content  => 'Defaultsmail_always',
  }
}

Do I simply insert include profile::base in there to add what's in this 
profile?

Thanks,

Ugo

On Tuesday, October 18, 2016 at 2:09:34 PM UTC-4, Matt wrote:
>
> Yeah, agreed, my default node looks like:
> node default {
>   $role=hiera('role')
>   include $role
> }
>
> and the  lowest priority/default-est part of my hiera hierarchy has role: 
> role::base. other actually classified things get role set at various parts 
> of the hierarchy as needed. 
>
>
> On Tue, Oct 18, 2016 at 2:04 PM Peter Kristolaitis <alt...@alter3d.ca 
> > wrote:
>
>> There is no magic involved in roles and profiles -- they're just classes 
>> that get assigned to nodes based on the node's definition.
>>
>> Thus, if you want a default role assigned to the default node 
>> definition... then assign that default role to the default node definition.
>>
>>
>>
>>
>> On 2016-10-18 01:58 PM, Ugo Bellavance wrote:
>>
>> Hi, 
>>
>> Is there an equivalent of the default node definition when using profiles 
>> and roles?
>>
>> Thanks,
>> -- 
>> 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/7a443246-ab0f-4872-943f-66780adff83c%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/puppet-users/7a443246-ab0f-4872-943f-66780adff83c%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/e3afe4b3-0cdf-3478-cb07-a580923f3ba9%40alter3d.ca
>>  
>> <https://groups.google.com/d/msgid/puppet-users/e3afe4b3-0cdf-3478-cb07-a580923f3ba9%40alter3d.ca?utm_medium=email_source=footer>
>> .
>> 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/d57c4923-ec7c-40a4-93db-e401bdf68e4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Default profile or role

2016-10-18 Thread Ugo Bellavance
Hi,

Is there an equivalent of the default node definition when using profiles 
and roles?

Thanks,

-- 
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/7a443246-ab0f-4872-943f-66780adff83c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Using a module that is not 100% hiera-compliant

2016-10-18 Thread Ugo Bellavance
Hi,

I am using camptocamp/postfix for my postfix configuration.  I originally 
defined all my configs manifests but now I would like to change to using 
hiera.  Unfortunately, this module doesn't support hiera for some of the 
configs, so I must define many parameters in the manifests.  I wanted to 
use hiera for simplicity, but also because I have a very nice use case:  I 
have one SMTP front-end with its own specific configs (anti-spam/virus), 
and a series of regular hosts. Traditionally, all hosts that are in the 
same subnet as the Exchange server would use it as relayhost and all the 
other hosts use the smtp front-ends.  Therefore, here's what I did:

hiera.yaml:

---
:backends:
#  - regex
  - yaml
:yaml:
  :datadir: /etc/puppet/hiera
#:regex:
#  :datadir: /var/lib/hiera
:hierarchy:
  - "host/%{fqdn}"
  - "domain/%{domain}"
  - "env/%{::environment}"
  - "os/%{operatingsystem}"
  - "osfamily/%{osfamily}"
  - "networks/%{network_ens192}"
  - "virtual/%{::virtual}"
  - common

This way, I define the exchange server as relayhost for the exchange 
network in /etc/puppet/hiera/networks/192.168.155.0.yaml, and set the smtp 
frontend as relayhost in /etc/puppet/hiera/common.yaml.

However, since I can't put all the settings in hiera, I must put some in 
the class declaration for the smtp frontends.  When I declare the postfix 
class in both my default profile and in the smtp frontend profile, I get an 
error saying that the class cannot be declared twice (Class[Postfix] is 
already declared; cannot redeclare at 
/etc/puppet/manifests/nodes/smtp_postfix_servers.pp:19)

Another solution would be to declare the profile in all my roles, but it's 
far from perfect.

Is there a simple solution?

I guess that I could do an if based on ipaddress in my default profile, but 
I wanted to use hiera as much as possible. Yes I created an issue to ask 
for full hiera support.

Thanks,

Ugo

-- 
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/932fe21c-1980-478e-976d-31fe7835eeec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-09-30 Thread Ugo Bellavance
On Friday, September 30, 2016 at 3:17:50 AM UTC-4, Peter Faller wrote:
>
> Have you considered using an external node classifier instead? 
>
I use The Foreman on my older 2.7 puppet master, but only for reporting 
purposes.  I think I may not good enough with puppet to use an ENC. I'm not 
on puppet full-time.

-- 
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/3f868359-d171-41c5-b806-bd14919e89ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-09-29 Thread Ugo Bellavance
Hi,

Is it possible to have an array in hiera (or puppet) and use it in hiera?

For example:

clients:
  - client1
  - client2

Then,

nginx::nginx_vhosts:
  "%{hiera('clients')}":
ensure: present



It would be the equivalent of having:

nginx::nginx_vhosts:
  'client1':
ensure: present

nginx::nginx_vhosts:
  'client2':
ensure: present

In this article 
(https://blog.serverdensity.com/deploying-nginx-with-puppet/), they declare 
a variable (vdomain) and then use it, but I tried with an array and it 
doesn't work.

Thanks,

-- 
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/b3d1e411-5d58-4e16-b92e-d4a0d75aaf73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Using a vhost name in hiera

2016-09-29 Thread Ugo Bellavance


On Wednesday, September 28, 2016 at 8:07:26 PM UTC-4, Ugo Bellavance wrote:
>
>
>
> On Wednesday, September 28, 2016 at 4:35:50 PM UTC-4, Garrett Honeycutt 
> wrote:
>>
>> On 9/28/16 3:54 PM, Ugo Bellavance wrote: 
>> > Hi, 
>> > 
>> > I am working with this module https://github.com/voxpupuli/puppet-nginx 
>> > to get some nginx servers up.  Here is my hiera config for a vhost: 
>> > 
>> > nginx::nginx_vhosts: 
>> >   'website1.domain.com': 
>> > proxy: 'http://website1.internal' 
>> > 
>> > I would like to have my logs in one directory per vhost. 
>> > 
>> > Here is what I have for now: 
>> > 
>> > nginx::http_access_log: "%{hiera('nginx::config::log_dir')}/access_log" 
>> > 
>> > 
>> > In the template, it looks like that: 
>> > 
>> > "${::nginx::config::log_dir}/${name_sanitized}.access.log 
>> ${format_log}", 
>> > 
>> > Would there be a way to set it in hiera so that it is the equivalent of 
>> > this: 
>> > 
>> > "${::nginx::config::log_dir}/${name_sanitized}/access.log 
>> ${format_log}", 
>> > 
>> > Of course, I would like to avoid having to edit the template. 
>> > 
>> > Thanks, 
>> > 
>>
>> Hi Ugo, 
>>
>> nginx_vhosts has a parameter named access_log. You could use that as 
>> follows. 
>>
>> nginx::nginx_vhosts: 
>>   'website1.domain.com': 
>> proxy: 'http://website1.internal' 
>> access_log: '/whatever/access.log' 
>>
>>
>> https://github.com/voxpupuli/puppet-nginx/blob/master/manifests/resource/vhost.pp#L145
>>  
>>
>>
>> Makes sense, I didn't see that one. In fact I was looking for a way to 
> make it automatic instead of always have to enter the log path.
>
 
I tested it but the system complains that the directory doesn't exist.  I 
wonder how I could easily create a folder for each vhost, and I don't know 
how it could be managed automatially in the module since puppet doesn't 
create parent directories for File directives.  It looks like I'll have to 
stick to the default.

That makes me think of something.  Could I enumerate the names of all my 
vhosts in hiera, and have only one vhost directive?  Something like 
here https://blog.serverdensity.com/deploying-nginx-with-puppet/ but with 
something like a table of vdomain values.

It looks very hard to find relevant information on how to use hiera... but 
it is such an excellent tool!

-- 
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/c5a146b6-ba38-41af-a18c-f4b812427aab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Using a vhost name in hiera

2016-09-28 Thread Ugo Bellavance


On Wednesday, September 28, 2016 at 4:35:50 PM UTC-4, Garrett Honeycutt 
wrote:
>
> On 9/28/16 3:54 PM, Ugo Bellavance wrote: 
> > Hi, 
> > 
> > I am working with this module https://github.com/voxpupuli/puppet-nginx 
> > to get some nginx servers up.  Here is my hiera config for a vhost: 
> > 
> > nginx::nginx_vhosts: 
> >   'website1.domain.com': 
> > proxy: 'http://website1.internal' 
> > 
> > I would like to have my logs in one directory per vhost. 
> > 
> > Here is what I have for now: 
> > 
> > nginx::http_access_log: "%{hiera('nginx::config::log_dir')}/access_log" 
> > 
> > 
> > In the template, it looks like that: 
> > 
> > "${::nginx::config::log_dir}/${name_sanitized}.access.log 
> ${format_log}", 
> > 
> > Would there be a way to set it in hiera so that it is the equivalent of 
> > this: 
> > 
> > "${::nginx::config::log_dir}/${name_sanitized}/access.log 
> ${format_log}", 
> > 
> > Of course, I would like to avoid having to edit the template. 
> > 
> > Thanks, 
> > 
>
> Hi Ugo, 
>
> nginx_vhosts has a parameter named access_log. You could use that as 
> follows. 
>
> nginx::nginx_vhosts: 
>   'website1.domain.com': 
> proxy: 'http://website1.internal' 
> access_log: '/whatever/access.log' 
>
>
> https://github.com/voxpupuli/puppet-nginx/blob/master/manifests/resource/vhost.pp#L145
>  
>
>
> Makes sense, I didn't see that one. In fact I was looking for a way to 
make it automatic instead of always have to enter the log path.

Thanks, 

-- 
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/5361a1a9-67ad-4cb6-b0d7-a6f695bf3980%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Using a vhost name in hiera

2016-09-28 Thread Ugo Bellavance
Hi,

I am working with this module https://github.com/voxpupuli/puppet-nginx to 
get some nginx servers up.  Here is my hiera config for a vhost:

nginx::nginx_vhosts:
  'website1.domain.com':
proxy: 'http://website1.internal'

I would like to have my logs in one directory per vhost.

Here is what I have for now:

nginx::http_access_log: "%{hiera('nginx::config::log_dir')}/access_log"


In the template, it looks like that:

"${::nginx::config::log_dir}/${name_sanitized}.access.log ${format_log}",

Would there be a way to set it in hiera so that it is the equivalent of 
this:

"${::nginx::config::log_dir}/${name_sanitized}/access.log ${format_log}",

Of course, I would like to avoid having to edit the template.

Thanks,

-- 
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/e9f907ac-62ce-4952-8195-fade16f83419%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Duplicate declaration - hard to find...

2016-09-21 Thread Ugo Bellavance
I found the problem by making the classe temporarily non-parameterized and 
it threw an error "Invalid parameter application".  I called this class in 
another file.  I'll fix that up.

Thanks for your help!

Ugo

-- 
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/66d35eb1-a22f-4e7a-a6d4-7fdfeb870720%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Duplicate declaration - hard to find...

2016-09-21 Thread Ugo Bellavance

>
>
> in a define all resources have to have unique names, error says in some 
> case 
> you do not. So you're either attempting to make 2 instances where 
> application 
> is 'agtweb' or something else, 
>
> Show the actual code.  And the actual code where you make 'agtweb' 
> application. 
>
>
Sorry here's the code:

Either:

define apache::varwwwatdsrcapp (

$application  = 'agtweb',
$client   = '',
$envstage = '',

) {

  file {
  "/var/www/atd/src/${application}":
  ensure => directory,
  owner  => "deploy",
  group  => "deploy",
  mode   => 0755,
  require => Class['apache::varwwwatdsrc'],
  }

}

Or

define apache::varwwwatdsrcapp (

$application  = 'agtweb',
$client   = '',
$envstage = '',

) {

  file {
  '/var/www/atd/src/agtweb':
  ensure => directory,
  owner  => "deploy",
  group  => "deploy",
  mode   => 0755,
  require => Class['apache::varwwwatdsrc'],
  }

}

-- 
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/79dff55f-e972-4a9c-9636-3a0f5f44b84c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Duplicate declaration - hard to find...

2016-09-21 Thread Ugo Bellavance
Hi,

I'm getting this error message when I run a puppet noop:

Error 400 on SERVER: Duplicate declaration: File[/var/www/atd/src/agtweb] 
is already declared in file 
/etc/puppet/modules/apache/manifests/varwwwatdsrcapp.pp at line 17; cannot 
redeclare at /etc/puppet/modules/apache/manifests/varwwwatdsrcapp.pp:17

Here's the contents of the file (I tried with the app1 directly or using 
the ${application} variable

define apache::varwwwatdsrcapp (

$application  = 'app1',
$client   = '',
$envstage = '',

) {

  file {
#"/var/www/atd/src/${application}":
'/var/www/atd/src/app1':
  ensure => directory,
  owner  => "deploy",
  group  => "deploy",
  mode   => 0755,
  require => Class['apache::varwwwatdsrc'],
  }

}

Contents of the file containing the required class:

class apache::varwwwatdsrc {

  file { '/var/www/atd/src':
  ensure => directory,
  owner  => "root",
  group  => "root",
  mode   => 0755,
  require => File["/var/www/atd"],
  }

}

Contents of the file containing the required File:

class apache::varwwwatd {

  file { '/var/www/atd':
  ensure => 'directory',
  owner  => 'root',
  group  => 'root',
  mode   => 0744,
  }

}

I realize that I use double quotes where I shouldn't, but I don't think 
that affects the logic.

Any ideas where the problem may be?

Thanks,

Ugo

-- 
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/4b843ccb-c2ba-4f4d-9b9b-6ae7da9d16b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] pdxcat-nrpe, hiera data in command

2016-04-22 Thread Ugo Bellavance

>
> Hi Ugo, 
>
> You don't have to to modify pdxcat/nrpe to get that to work. Wherever 
> you are calling this from, you need to set the value of $ntpserver. That 
> can happen as a parameter to the class which would automatically look it 
> up or with the hiera() function. 
>
> I also have an nrpe module. It allows you to specify all of your plugins 
> in Hiera. 
>
> They seem to be similar in OS support and functionality, though mine has 
> extensive unit testing. 
>
> https://github.com/ghoneycutt/puppet-module-nrpe#usage 
>
> Best regards, 
> -g 
>

Hi Garrett,

I decided to give your module a try, I think it's worth it.  I like the 
idea of having small manifests and all the rest in hiera. However, can I 
use the value of a variable in hiera or do I need to put the whole command 
definition in each yaml file?

For example:

---
ntp::autoupdate: true
ntp::enable: true
ntp::servers:
  - ntp1.example.com
  - ntp2.example.com
nrpe::allowed_hosts: ['127.0.0.1', '192.168.xxx.xxx']
nrpe::plugins:
  check_load:
args: '-w $ARG1$ -c $ARG2$'
  check_ntp:
args: "-h $ntp::servers"
  check_users:
args: '-w 5 -c 10'
  check_zombie_procs:
plugin: 'check_proc'
args: ' -w 5 -c 10 -s Z'

Thanks,

-- 
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/5e8d4b2b-81dc-4388-b745-26073e392735%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] pdxcat-nrpe, hiera data in command

2016-04-21 Thread Ugo Bellavance


On Thursday, April 21, 2016 at 3:25:35 PM UTC-4, Rob Nelson wrote:
>
> Can you link directly to the module you're using, on the forge or on 
> github?


Sorry... https://github.com/pdxcat/puppet-module-nrpe or
https://forge.puppet.com/pdxcat/nrpe

-- 
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/5cc2f9ab-4341-4769-9d08-274bab779d42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] pdxcat-nrpe, hiera data in command

2016-04-21 Thread Ugo Bellavance
Hi,

I want to create a nrpe command using the pdxcat-nrpe, for check_ntp.  My 
NTP servers would check against public servers, and all others will check 
against my internal NTP servers.

The code looks like that:

  nrpe::command {
'check_ntp':
  package_name  => 'nagios-plugins-ntp',
  ensure  => present,
  command => "check_ntp -H $ntpserver";
  }

I'd like to simply use a value in hiera for $ntpserver but it doesn't look 
possible without editing the module, which I'd like to avoid as much as 
possible.

Anyone has an idea?

Thanks,

-- 
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/03a54a17-5fd5-49ca-81ca-28db58587010%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-04-21 Thread Ugo Bellavance


On Thursday, April 21, 2016 at 9:03:29 AM UTC-4, jcbollinger wrote:
>
>
>
> On Wednesday, April 20, 2016 at 8:13:52 AM UTC-5, Ugo Bellavance wrote:
>>
>>
>>
>> On Wednesday, April 20, 2016 at 9:03:35 AM UTC-4, jcbollinger wrote:
>>>
>>>
>>>
>>> On Tuesday, April 19, 2016 at 12:36:47 PM UTC-5, Ugo Bellavance wrote:
>>>
>>> This:
>>>  
>>>
>>>> When debugging on the master:
>>>>
>>>> # puppet master --debug --compile agent1.example.com | grep hiera | 
>>>> grep -v Cannot | grep -v Looking
>>>> [...]
>>>> Debug: hiera(): Hiera YAML backend starting
>>>> Debug: hiera(): Found classes in host/agent1.example.com
>>>> [...]
>>>>
>>>
>>>
>>> Shows that your Hiera config and data are fine.
>>>
>>> You haven't presented any logs of the actual puppetmaster service 
>>> failure, and these might be more illuminating, but at this point I'm 
>>> inclined to guess that your problem is one of two things:
>>>
>>>1. perhaps the master is running with a stale Hiera config, and 
>>>needs to be restarted to see the up-to-date one, or
>>>2. access controls on one or more of the Hiera data files prevent 
>>>the puppetmaster process from reading them.
>>>
>>> I'd rate the latter as somewhat more likely.
>>>
>>
>> Here are the logs on the puppet master (please note that I don't use the 
>> fileserver anymore and as you can see, I restarted the master just before 
>> testing):
>>
>> Apr 20 09:08:51 master puppet-master[26083]: Starting Puppet master 
>> version 3.6.2
>> Apr 20 09:09:27 master puppet-master[26083]: Removing mount "files": 
>> /var/lib/puppet/files does not exist or is not a directory
>> Apr 20 09:09:27 master puppet-master[26083]: Error parsing fileserver 
>> configuration: wrong number of arguments (3 for 0..1); using old 
>> configuration
>> Apr 20 09:09:31 master puppet-master[26083]: The use of 'import' is 
>> deprecated at /etc/puppet/manifests/site.pp:4. See 
>> http://links.puppetlabs.com/puppet-import-deprecation
>> Apr 20 09:09:31 master puppet-master[26083]:   (at grammar.ra:610:in 
>> `block in _reduce_190')
>> Apr 20 09:09:32 master puppet-master[26083]: Could not find data item 
>> classes in any Hiera data file and no default supplied at 
>> /etc/puppet/manifests/site.pp:12 on node 
>> agent1.atqlan.agri-tracabilite.qc.ca
>> Apr 20 09:09:32 master puppet-master[26083]: Could not find data item 
>> classes in any Hiera data file and no default supplied at 
>> /etc/puppet/manifests/site.pp:12 on node agent1.
>> atqlan.agri-tracabilite.qc.ca
>> Apr 20 09:09:32 master puppet-master[26083]: Could not find data item 
>> classes in any Hiera data file and no default supplied at 
>> /etc/puppet/manifests/site.pp:12 on node agent1.
>> atqlan.agri-tracabilite.qc.ca
>>  
>>
>
>
> Well, that at least does demonstrate that the problem is not a stale Hiera 
> config.  The verbosity and logging level are apparently set low enough that 
> the HIera lookup details are not reported.  Did you check the access 
> controls on the data files and the directories in the path to them?  Can a 
> process running with the same uid / gid as the master does access and read 
> the data files?
>

It looks like you found it John! Thanks a lot.

In fact, the files were in /var/lib/hiera/ (the default for my puppet 
binary), but SELinux contexts were not appropriate on the folder and its 
files.  I could have fixed them manually, but instead I moved them to 
/etc/puppet/hiera and ran restorecon -Rv on the folder to make sure SELinux 
contexts were adjusted correctly. Running restorecon on /var/lib/hiera/ 
doesn't change anything.

I'm kind of mad at me for not seeing this log entry:

type=AVC msg=audit(1461246504.666:74599): avc:  denied  { getattr } for 
 pid=4901 comm="puppet" path="/var/lib/hiera/common.yaml" dev="dm-4" 
ino=25715620 scontext=system_u:system_r:puppetmaster_t:s0 
tcontext=unconfined_u:object_r:var_
lib_t:s0 tclass=file

This a test server and on setroubleshoot was not configure like on my 
production server. I'll go configure it now and continue my puppet work.

Thanks!

-- 
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/3a93801d-e263-4bab-b57b-3b8f5c633fb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-04-20 Thread Ugo Bellavance


On Wednesday, April 20, 2016 at 9:03:35 AM UTC-4, jcbollinger wrote:
>
>
>
> On Tuesday, April 19, 2016 at 12:36:47 PM UTC-5, Ugo Bellavance wrote:
>
> This:
>  
>
>> When debugging on the master:
>>
>> # puppet master --debug --compile agent1.example.com | grep hiera | grep 
>> -v Cannot | grep -v Looking
>> [...]
>> Debug: hiera(): Hiera YAML backend starting
>> Debug: hiera(): Found classes in host/agent1.example.com
>> [...]
>>
>
>
> Shows that your Hiera config and data are fine.
>
> You haven't presented any logs of the actual puppetmaster service failure, 
> and these might be more illuminating, but at this point I'm inclined to 
> guess that your problem is one of two things:
>
>1. perhaps the master is running with a stale Hiera config, and needs 
>to be restarted to see the up-to-date one, or
>2. access controls on one or more of the Hiera data files prevent the 
>puppetmaster process from reading them.
>
> I'd rate the latter as somewhat more likely.
>

Here are the logs on the puppet master (please note that I don't use the 
fileserver anymore and as you can see, I restarted the master just before 
testing):

Apr 20 09:08:51 master puppet-master[26083]: Starting Puppet master version 
3.6.2
Apr 20 09:09:27 master puppet-master[26083]: Removing mount "files": 
/var/lib/puppet/files does not exist or is not a directory
Apr 20 09:09:27 master puppet-master[26083]: Error parsing fileserver 
configuration: wrong number of arguments (3 for 0..1); using old 
configuration
Apr 20 09:09:31 master puppet-master[26083]: The use of 'import' is 
deprecated at /etc/puppet/manifests/site.pp:4. See 
http://links.puppetlabs.com/puppet-import-deprecation
Apr 20 09:09:31 master puppet-master[26083]:   (at grammar.ra:610:in `block 
in _reduce_190')
Apr 20 09:09:32 master puppet-master[26083]: Could not find data item 
classes in any Hiera data file and no default supplied at 
/etc/puppet/manifests/site.pp:12 on node 
agent1.atqlan.agri-tracabilite.qc.ca
Apr 20 09:09:32 master puppet-master[26083]: Could not find data item 
classes in any Hiera data file and no default supplied at 
/etc/puppet/manifests/site.pp:12 on node agent1
.atqlan.agri-tracabilite.qc.ca
Apr 20 09:09:32 master puppet-master[26083]: Could not find data item 
classes in any Hiera data file and no default supplied at 
/etc/puppet/manifests/site.pp:12 on node agent1
.atqlan.agri-tracabilite.qc.ca
 

-- 
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/06b16b12-6ead-4a7e-80de-169560fc3b18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-04-20 Thread Ugo Bellavance


On Wednesday, April 20, 2016 at 7:45:13 AM UTC-4, Peter Faller wrote:
>
> Ugo, I think you need:
>
> classes:
>   - ntp
>
> ... instead of:
>
> classes: ntp
>
> ... to make 'classes' an array instead of a simple value.
>

Tried it but I get the same result.  I think that both work, the array 
being needed when one than one class is needed here.

I guess that the next step will be to try with the latest Puppet 3...

Thanks,

-- 
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/4c8d8fb9-38c1-46fe-aefb-8a7492b6dcea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-04-19 Thread Ugo Bellavance
Unfortunately, I wrote agen1 when I edited my post not to show internal 
info.

I tried your alternative solution (hiera_include('classes', [])) and it, 
well, allows the puppet command (puppet agent --noop --test --verbose by 
the way) to run OK instead of throwing a 400, but I don't see it applying 
ntp changes.

I'm actually testing a new server on 3.6.2 (EPEL), my production server is 
2.7 (EPEL).

Thanks a lot,

On Tuesday, April 19, 2016 at 4:39:21 PM UTC-4, Rob Nelson wrote:
>
> Ugo,
>
> In your last example you used 'agen1' instead of 'agent1'. Maybe it's just 
> a typo? Those are the best problems :) I also don't see where the 400 error 
> comes from, can you capture that somewhere?
>
> An alternative solution - or maybe complementary - is to change line 11 to 
> say `hiera_include('classes', [])`, or add a default class that notifies 
> "Can't find a class!" This way, all runs complete, even if they don't 
> manage the device properly, which ensures that facts are at least collected.
>
> I also recommend upgrading to the latest 3.x version now, and 4.x as soon 
> as you can, as SO MANY hiera bugs were fixed in 3.7/3.8 and then 4.3/4.4 
> that it's very likely that any bug you run into is already fixed by moving 
> past 3.6.2.
>
>
> Rob Nelson
> rnel...@gmail.com 
>
> On Tue, Apr 19, 2016 at 1:36 PM, Ugo Bellavance <ug...@lubik.ca 
> > wrote:
>
>> Hi,
>>
>> I'm currently testing hiera and I can't make it work.  I get this 
>> error: Error 400 on SERVER: Could not find data item classes in any Hiera 
>> data file and no default supplied at /etc/puppet/manifests/site.pp:11 on 
>> node. I'm trying to do something like this: 
>> https://docs.puppet.com/hiera/3.0/complete_example.html (puppetlabs ntp 
>> module).
>>
>> Client: puppet 3.6.2
>>
>> On the master:
>>
>> puppet 3.6.2
>>
>> # puppet config print | grep hiera_
>> hiera_config = /etc/puppet/hiera.yaml
>>
>> Contents of /etc/puppet/hiera.yaml
>> ---
>> :backends:
>> #  - regex
>>   - yaml
>> :yaml:
>>   :datadir: /var/lib/hiera
>> #:regex:
>> #  :datadir: /var/lib/hiera
>> :hierarchy:
>>   - "host/%{fqdn}"
>>   - "domain/%{domain}"
>>   - "env/%{::environment}"
>>   - "os/%{operatingsystem}"
>>   - "osfamily/%{osfamily}"
>>   - "virtual/%{::virtual}"
>>   - common
>>
>> Contents of /etc/puppet/manifests/site.pp
>>
>> import "nodes/*"
>> import "os/*"
>> import "packages/*"
>> import "users/*"
>> import "service-types/*"
>>
>> # Enable hiera
>> hiera_include('classes')
>>
>> #filebitbucket { main: server => puppet }
>> #File { backup => main }
>>
>> # The filebucket option allows for file backups to the server
>> filebucket { main: server => 'puppet' }
>>
>> # Set global defaults - including backing up all files to the main 
>> filebucket and adds a global path
>> File { backup => main }
>>
>> Contents of the hiera file for this host:
>>
>> # cat /var/lib/hiera/host/agent1.example.com.yaml
>> ---
>> classes: ntp
>> ntp::restrict:
>>   -
>> ntp::autoupdate: false
>> ntp::enable: true
>> ntp::servers:
>>   - 0.ca.pool.ntp.org
>>   - 1.ca.pool.ntp.org
>>   - 2.ca.pool.ntp.org
>>   - 3.ca.pool.ntp.org
>>
>> Contents of the common file:
>>
>> # cat /var/lib/hiera/common.yaml
>> ---
>> ntp::autoupdate: true
>> ntp::enable: true
>> ntp::servers:
>>   - ntp1.example
>>   - ntp2.example.com
>>
>>
>> When debugging on the master:
>>
>> # puppet master --debug --compile agent1.example.com | grep hiera | grep 
>> -v Cannot | grep -v Looking
>> Warning: The use of 'import' is deprecated at 
>> /etc/puppet/manifests/site.pp:4. See 
>> http://links.puppetlabs.com/puppet-import-deprecation
>>(at grammar.ra:610:in `block in _reduce_190')
>> Debug: hiera(): Hiera YAML backend starting
>> Debug: hiera(): Found classes in host/agent1.example.com
>> Debug: hiera(): Found ntp::autoupdate in host/agent1.example.com
>> Debug: hiera(): Found ntp::restrict in host/agent1.example.com
>> Debug: hiera(): Found ntp::servers in host/agent1.example.com
>> Warning: Variable access via 'search_domain' is deprecated. Use 
>> '@search_domain' instead. 
>> template[/etc/puppet/modules/resolv/templates/resolv.conf.erb]:5
>>(at /etc/puppet/modules/resolv/templates/resolv.con

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

2016-04-19 Thread Ugo Bellavance
Hi,

I'm currently testing hiera and I can't make it work.  I get this 
error: Error 400 on SERVER: Could not find data item classes in any Hiera 
data file and no default supplied at /etc/puppet/manifests/site.pp:11 on 
node. I'm trying to do something like 
this: https://docs.puppet.com/hiera/3.0/complete_example.html (puppetlabs 
ntp module).

Client: puppet 3.6.2

On the master:

puppet 3.6.2

# puppet config print | grep hiera_
hiera_config = /etc/puppet/hiera.yaml

Contents of /etc/puppet/hiera.yaml
---
:backends:
#  - regex
  - yaml
:yaml:
  :datadir: /var/lib/hiera
#:regex:
#  :datadir: /var/lib/hiera
:hierarchy:
  - "host/%{fqdn}"
  - "domain/%{domain}"
  - "env/%{::environment}"
  - "os/%{operatingsystem}"
  - "osfamily/%{osfamily}"
  - "virtual/%{::virtual}"
  - common

Contents of /etc/puppet/manifests/site.pp

import "nodes/*"
import "os/*"
import "packages/*"
import "users/*"
import "service-types/*"

# Enable hiera
hiera_include('classes')

#filebitbucket { main: server => puppet }
#File { backup => main }

# The filebucket option allows for file backups to the server
filebucket { main: server => 'puppet' }

# Set global defaults - including backing up all files to the main 
filebucket and adds a global path
File { backup => main }

Contents of the hiera file for this host:

# cat /var/lib/hiera/host/agent1.example.com.yaml
---
classes: ntp
ntp::restrict:
  -
ntp::autoupdate: false
ntp::enable: true
ntp::servers:
  - 0.ca.pool.ntp.org
  - 1.ca.pool.ntp.org
  - 2.ca.pool.ntp.org
  - 3.ca.pool.ntp.org

Contents of the common file:

# cat /var/lib/hiera/common.yaml
---
ntp::autoupdate: true
ntp::enable: true
ntp::servers:
  - ntp1.example
  - ntp2.example.com


When debugging on the master:

# puppet master --debug --compile agent1.example.com | grep hiera | grep -v 
Cannot | grep -v Looking
Warning: The use of 'import' is deprecated at 
/etc/puppet/manifests/site.pp:4. See 
http://links.puppetlabs.com/puppet-import-deprecation
   (at grammar.ra:610:in `block in _reduce_190')
Debug: hiera(): Hiera YAML backend starting
Debug: hiera(): Found classes in host/agent1.example.com
Debug: hiera(): Found ntp::autoupdate in host/agent1.example.com
Debug: hiera(): Found ntp::restrict in host/agent1.example.com
Debug: hiera(): Found ntp::servers in host/agent1.example.com
Warning: Variable access via 'search_domain' is deprecated. Use 
'@search_domain' instead. 
template[/etc/puppet/modules/resolv/templates/resolv.conf.erb]:5
   (at /etc/puppet/modules/resolv/templates/resolv.conf.erb:5:in `block in 
result')
Warning: Variable access via 'dns_servers' is deprecated. Use 
'@dns_servers' instead. 
template[/etc/puppet/modules/resolv/templates/resolv.conf.erb]:7
   (at /etc/puppet/modules/resolv/templates/resolv.conf.erb:7:in `block in 
result')

(I will eventually fix the warnings, I doubt they cause my hiera problem)

hiera debugging on the master:

# hiera ntp::servers clientcert=agen1.example.com --debug
DEBUG: 2016-04-19 13:26:43 -0400: Hiera YAML backend starting
DEBUG: 2016-04-19 13:26:43 -0400: Looking up ntp::servers in YAML backend
DEBUG: 2016-04-19 13:26:43 -0400: Looking for data source common
DEBUG: 2016-04-19 13:26:43 -0400: Found ntp::servers in common
["ntp1.example.com", "ntp2.example.com"]

(should not find the information in common, should use the information in 
/var/lib/hiera/host/agent1.example.com.yaml

Any help would be greatly appreciated.

Thanks,

Ugo

-- 
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/11548aff-32cd-4cdb-9886-4cfc079cd5fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] stdlib

2016-04-15 Thread Ugo Bellavance
My bad, I had deleted the files in /etc/puppet/modules/stdlib/ on the 
server.  The agent deleted files 
in /var/lib/puppet/lib/puppet/parser/functions/.  I restored the files from 
svn and the problem doesn't occur.

Thanks,

-- 
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/260601c4-1f63-4045-90d9-353c27650d95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] stdlib

2016-04-14 Thread Ugo Bellavance
Hi,

So it is normal to see files that are removed on the client the first time 
it connects to the master with a config that uses stdlib?

On Thursday, April 14, 2016 at 5:23:39 PM UTC-4, Rob Nelson wrote:
>
> Yes, all modules in an environment would be pluginsynced.
>
>
> Rob Nelson
> rnel...@gmail.com 
>
> On Thu, Apr 14, 2016 at 3:48 PM, Ugo Bellavance <ug...@lubik.ca 
> > wrote:
>
>> Hi,
>>
>> Is it normal that when a new client connects to a master, stdlib is 
>> sync'd?  Is that part of pluginsync?
>>
>> Thanks,
>>
>> -- 
>> 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/53552e22-8653-4f9a-b1f6-bc4ae28c9d11%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/puppet-users/53552e22-8653-4f9a-b1f6-bc4ae28c9d11%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/8688602d-ac52-46b4-9df0-6e7f3113f7f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] stdlib

2016-04-14 Thread Ugo Bellavance
Hi,

Is it normal that when a new client connects to a master, stdlib is sync'd? 
 Is that part of pluginsync?

Thanks,

-- 
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/53552e22-8653-4f9a-b1f6-bc4ae28c9d11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Template problems

2016-03-09 Thread Ugo Bellavance


On Tuesday, March 8, 2016 at 8:11:46 AM UTC-5, R.I. Pienaar wrote:
>
>
>
> - Original Message - 
> > From: "Ugo Bellavance" <ug...@lubik.ca > 
> > To: "puppet-users" <puppet...@googlegroups.com > 
> > Sent: Tuesday, 8 March, 2016 13:50:46 
> > Subject: Re: [Puppet Users] Template problems 
>
> > Just a thought, where should I have looked for that? Is it pure Ruby? 
>
> yeah pretty much, there are template docs but this I guess is just 
> confusing. 
>
> If you're on recent puppet you should try epp templates, they are written 
> using the puppet language so less context changing 
>

2.7.  Probably out of luck, as it is so old. 

-- 
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/cc605da4-2235-4d5d-a45c-9745d8e9fe98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Template problems

2016-03-08 Thread Ugo Bellavance
Just a thought, where should I have looked for that? Is it pure Ruby?

On Tuesday, March 8, 2016 at 1:30:38 AM UTC-5, R.I. Pienaar wrote:
>
> You can't nest the <% %> inside another. Try: 
>
> <%= if @rotatelogsuselink then "-L /var/log/httpd/#{@name}/access.log" end 
> %> 
>
> Everything inside is normal Ruby and that's how interpolation works there 
>
> --- 
> R.I.Pienaar 
>
> > On 8 Mar 2016, at 04:32, Ugo Bellavance <ug...@lubik.ca > 
> wrote: 
> > 
> > > <%= if @rotatelogsuselink then "-L /var/log/httpd/<%= name 
> %>/access.log" end %> 
>

-- 
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/5ff43cdd-2811-4d23-9887-5201e8da7004%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Template problems

2016-03-08 Thread Ugo Bellavance
It works!

You guys are better than most vendor's service contract!

Thanks a lot!

Ugo

On Tuesday, March 8, 2016 at 1:30:38 AM UTC-5, R.I. Pienaar wrote:
>
> You can't nest the <% %> inside another. Try: 
>
> <%= if @rotatelogsuselink then "-L /var/log/httpd/#{@name}/access.log" end 
> %> 
>
> Everything inside is normal Ruby and that's how interpolation works there 
>
> --- 
> R.I.Pienaar 
>
> > On 8 Mar 2016, at 04:32, Ugo Bellavance <ug...@lubik.ca > 
> wrote: 
> > 
> > > <%= if @rotatelogsuselink then "-L /var/log/httpd/<%= name 
> %>/access.log" end %> 
>

-- 
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/120a2e3b-219b-4296-b212-86c7af16e39f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Template problems

2016-03-07 Thread Ugo Bellavance
Hi,

I'd like to be able to do something but I always get an error.

Here is my code:

<% if userotatelogs == false -%>

CustomLog /var/log/httpd/<%= name %>/access.log combined

<% else -%>

CustomLog "|/usr/sbin/rotatelogs <%= if @rotatelogsuselocaltime then 
'-l' end %> <%= if @rotatelogsforceopen then '-f' end %> <%= if 
@rotatelogsuselink then "-L /var/log/httpd/<%= name %>/access.log" end %> 
/var/log/httpd/<%= name %>/access.log.%Y-%m-%d <%= rotatelogstime %>" 
combined

<% end -%>


The problematic part seems to be the part in yellow.


Here is the error I get:


compile error 
/etc/puppet/modules/apache/templates/vhost-proxy_w_access.conf.erb:70: 
syntax error, unexpected $undefined, expecting kEND ...; _erbout.concat 
"/access.log\" end %> /var/log/httpd/"; _er...   
^ /etc/puppet/modules/apache/templates/vhost-proxy_w_access.conf.erb:76: 
syntax error, unexpected $end, expecting ')' ; _erbout


I tried with single quotes, as <%= name %>, <%= @name %>, <%= $name %>, but 
it always fails.


Thanks,


Ugo

-- 
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/ad4ba9ae-5213-4885-9198-5fcda6003eea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Creating multiple directories based on variables or array

2015-10-14 Thread Ugo Bellavance
Thanks for your awesome, complete answer John.

Ugo

On Wed, Oct 14, 2015 at 10:12 AM, jcbollinger <john.bollin...@stjude.org>
wrote:

>
> On Tuesday, October 13, 2015 at 12:20:05 PM UTC-5, Ugo Bellavance wrote:
>>
>> Hi,
>>
>> I'd need to create a number of directories in a fasion similar to that:
>>
>> /var/extlogs/$stage/$client-$application
>>
>> For example, if stages are integration, staging, production and clients
>> are client1 and client2 (there are many morem in reality), I'd like to have
>> puppet create
>>
>> /var/extlogs/integration/client1-application1
>> /var/extlogs/integration/client1-application2
>> /var/extlogs/integration/client2-application1
>> /var/extlogs/integration/client2-application2
>> /var/extlogs/staging/client1-application1
>> /var/extlogs/staging/client1-application2
>> /var/extlogs/staging/client2-application1
>> /var/extlogs/staging/client2-application2
>> /var/extlogs/production/client1-application1
>> /var/extlogs/production/client1-application2
>> /var/extlogs/production/client2-application1
>> /var/extlogs/production/client2-application1
>>
>> I've created a class that eases the job:
>>
>
>
> Well no, you've created a defined type.  It's very important to understand
> the difference.
>
>
>
>>
>> define lsyncd::createdestdirs (
>>
>> $application  = '',
>> $client   = '',
>> $envstage = '',
>>
>> ) {
>>
>>
>>   file {
>> '/var/extlogs':
>>   ensure => directory,
>>   owner  => "root",
>>   group  => "root",
>>   mode   => 0755,
>>   }
>>
>>
>
> This is not actually working for you as written.  At least, not for more
> than one combination of 'application', 'client', and 'envstage' per
> node.  You would end up with duplicate declarations at least of
> File['/var/extlogs'], at least.
>
>
>
>>   file {
>> "/var/extlogs/${envstage}":
>>   ensure => directory,
>>   owner  => "root",
>>   group  => "root",
>>   mode   => 0755,
>>   require => File['/var/extlogs'],
>>   }
>>
>>
>
> Note that although it is by no means wrong to declare that dependency on
> the parent directory, Puppet will generate it automatically for you if you
> omit it.  I rely on that in my example code below.
>
>
>
>> [...] would there be a way to have all the directories created in one
>> directive, by setting $application, $client, and $stage in an array?
>>
>>
>
> So you want to create a directory for every combination of $application,
> $client, and $stage values?  Historically, that sort of thing has been
> difficult, but there are good ways to handle it in modern Puppet.
>
>
>
>> I'm currently using puppet 2.7.25 and I'm not using hiera or puppetdb.
>>
>>
>
> Unfortunately, you're stuck in "historically".  *Way back* in
> "historically", in fact: the latest Puppet is 4.2.  This problem can still
> be handled, but it's not as clean or easy.  Moreover, although puppetdb is
> not really relevant to the question, Hiera is.  In Puppet 2.7, you have
> four alternatives for providing data for your classes to operate upon (your
> various 'client', etc. arrays):
>
>- you can build the data directly into your classes; or
>- you can parameterize your classes and use resource-like class
>declarations; or
>- you can look up your data via an external service, with hiera() and
>extlookup() being the most common; or
>- you can declare them as variables in a scope visible from your
>class, such as at node scope or even top scope.
>
> Use of resource-like class declarations has *always* been problematic,
> ever since parameterized classes were first introduced.  There are a few
> specialized cases were it is relatively safe, but I rarely recommend
> resource-like class declarations to anyone.  Since Puppet 2 provided no
> alternative, parameterized classes were very problematic until the
> introduction of automated data binding (via Hiera) in Puppet 3.
>
> Extlookup() does not provide for structured data (e.g. arrays), and
> you're not using Hiera.  If you want to be able to have different nodes
> with different clients, stages, or applications, then you cannot encode
> these data directly into the class that uses them.
>
> Let's say, therefore, that you will declare
>
> $applications = [ 'application1', 'application2' ]
> $clients  = [ 'client1', 'client2

[Puppet Users] Creating multiple directories based on variables or array

2015-10-13 Thread Ugo Bellavance
Hi,

I'd need to create a number of directories in a fasion similar to that:

/var/extlogs/$stage/$client-$application

For example, if stages are integration, staging, production and clients are 
client1 and client2 (there are many morem in reality), I'd like to have 
puppet create

/var/extlogs/integration/client1-application1
/var/extlogs/integration/client1-application2
/var/extlogs/integration/client2-application1
/var/extlogs/integration/client2-application2
/var/extlogs/staging/client1-application1
/var/extlogs/staging/client1-application2
/var/extlogs/staging/client2-application1
/var/extlogs/staging/client2-application2
/var/extlogs/production/client1-application1
/var/extlogs/production/client1-application2
/var/extlogs/production/client2-application1
/var/extlogs/production/client2-application1

I've created a class that eases the job:

define lsyncd::createdestdirs (

$application  = '',
$client   = '',
$envstage = '',

) {


  file {
'/var/extlogs':
  ensure => directory,
  owner  => "root",
  group  => "root",
  mode   => 0755,
  }

  file {
"/var/extlogs/${envstage}":
  ensure => directory,
  owner  => "root",
  group  => "root",
  mode   => 0755,
  require => File['/var/extlogs'],
  }

  file {
"/var/extlogs/${envstage}/${client}-${application}":
  ensure => directory,
  owner  => "root",
  group  => "root",
  mode   => 0755,
  require => File["/var/www/extlogs/${envstage}"],
  }

}

I can simply call something like

  lsyncd::createdestdirs { 'client1-application1':
application => 'application1',
client  => 'client1',
envstage=> 'production',
}

to create one directory, but would there be a way to have all the 
directories created in one directive, by setting $application, $client, and 
$stage in an array?

I'm currently using puppet 2.7.25 and I'm not using hiera or puppetdb.

Thanks,

Ugo

-- 
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/c9182f72-ae82-4a89-95e1-e297dc74aa5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] $title and $name returns node name

2015-10-01 Thread Ugo Bellavance
Hi,

I adapted the apache module for my needs and use it to create vhosts.

Declaration example:

  apache::vhost { 'cust1-user1app1' :
client => 'cust1,
envstage   => 'dev',
application   => 'app1',
devuser=> 'user1',
vhost_name => "${name}",
  }

$name and $title are shown as being cust1-user1app1 in the logs (notice 
directive), but when it creates the file from the template, the result 
of <%= vhost_name %> is the node name. Example:

node 'webserver1' inherits webserverbase

Excerpt from puppet --noop:

+

Puppet version: puppet-2.7.26-2.el6 (EPEL)


As a side note, is there a way to automatically generate the name of the 
declaration (cust1-user1app1 based on the variables?

Thanks,

Ugo

-- 
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/1cca6c9e-50a9-495a-ba71-0be6b960cc94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet EPEL RHEL5/6 vs RHEL7 (2.7.25 master with 3.6.2 clients)

2015-02-02 Thread Ugo Bellavance


 Hi Ugo, 

 The master must be upgraded before the agents or in other words, the 
 agents cannot have newer versions than the master. 


That is odd because it is actually working.  I know it is not supposed to.
 

 The easiest and most reliable path forward is to use yum.puppetlabs.com 
 (ideally, your own local mirror) as the source for your packages, if you 
 want to support EL 5 - 7. Using the corresponding EPEL repo for each 
 distro is not going to work. 

 I don't like to always be on the most recent version with puppet, it moves 
quite fast, compared to my capacity to follow.  I know I'll have to get 
through this when RHEL 8 is released if I keep on using EPEL.

Thanks a lot for your input,

Ugo

-- 
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/1cdd7a5b-31c7-490f-9627-432100c1ce4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet EPEL RHEL5/6 vs RHEL7 (2.7.25 master with 3.6.2 clients)

2015-02-01 Thread Ugo Bellavance
Hi,

I'm using the EPEL puppet packages and my puppet master (server) is on RHEL 
5, so version 2.7.25.  I'm introducing some RHEL 7 test machines in my 
infrastructure and for now I've found that /etc/sysconfig/puppet is not 
used anymore so I had to change my puppet config for 
/etc/puppet/puppet.conf.  Anyone else running this kind of configuration? 
 I remember that when EPEL upgraded from 2.6 to 2.7, the 2.7 client didn't 
work with 2.6 server.  Now 3.6.2 clients work.  Is that expected?

I choose to stick with EPEL since puppet is only about 10% of my job so 
using EPEL packages allow me to have a stable environment for longer and I 
don't really mind not having the latest features.  Of course, I'll 
eventually upgrade my server to a RHEL 7 machine with 3.6.2 server.

Any comments or advice welcome.

Thanks,

Ugo

-- 
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/b47dd330-9f9b-4c2b-ad8a-7e9591746ac7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Custom apache module advice needed

2014-11-25 Thread Ugo Bellavance


On Tuesday, November 25, 2014 12:47:38 AM UTC-5, Pete Brown wrote:


 On 25 Nov 2014 11:37, Ugo Bellavance ug...@lubik.ca javascript: 
 wrote:
 
  Sorry for top-posting, but I found my mistake.  I didn't know we could 
 not set 'require' more than once.  It now looks obvious but it wasn't when 
 I was working on it.

 You can require multiple resources but they need to be in an array.


 Exactly, it's now fixed and working, thanks! 

-- 
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/2d4170b1-5cd0-44d9-8c81-e6071dc0fbae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Custom apache module advice needed

2014-11-25 Thread Ugo Bellavance




- I've had unplanned outages (nothing critical, clients/users were 
warned on dev and staging environments) because the refresh was done 
 before 
the logs directory was created
   - Should I implement file syntax checking for httpd .conf files? 
Should it be on file-level or should it be in the refresh parameter of 
 the 
   service? (Something similar to restart = '/usr/sbin/apachectl -t 
/etc/init.d/httpd graceful',

 The answer is to use the restart = definition. Graceful causes no 
interruption.
 

-- 
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/c00a9de4-addf-4ce9-9427-ac7ee3549c09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Custom apache module advice needed

2014-11-24 Thread Ugo Bellavance
Hi,

I've written my own puppet module for apache because I found that the 
publicly-available ones had many dependencies or were too complex for me. 
 I'm not a puppet expert and I'm using EPEL's puppet which is 2.7.25.

Here is the relevant part of my code that is used to create the apache 
.conf file for our environments.  Our environments follow this standard:

for dev:  /var/www/dev/$user/$application/

for other environments stages: /var/www/$envstage/$application/

The logs are located in a directory called logs in the $application 
folder.

My current puppet codes does everything that is needed to create an 
environment, but it doesn't manage the order, so it may happen that the 
logs folder is created after the apache refresh and cause a problem.

I have a few (less-related) questions regarding this:

   - Does puppet manage the creation of the parent directories as of now?
   - I've had unplanned outages (nothing critical, clients/users were 
   warned on dev and staging environments) because the refresh was done before 
   the logs directory was created
  - Should I implement file syntax checking for httpd .conf files? 
   Should it be on file-level or should it be in the refresh parameter of 
the 
  service? (Something similar to restart = '/usr/sbin/apachectl -t  
  /etc/init.d/httpd graceful',
   

When I add a require = File directives, it fails with an error that looks 
like that:

Duplicate parameter 'require' for on 
File[/etc/httpd/conf.d/blabla-integration1.conf] at 
/etc/puppet/modules/apache/manifests/vhost.pp

Here is the relevant part of my code:


$logdir = $vhost_base/logs

  if $envstage  != 'dev' {
file { [ $logdir, /var/www/$envstage, $vhost_base, ]:
  ensure = 'directory',
  owner  = 'deploy',
  group  = 'deploy',
  mode   = 0744,
  }
}
# Generate the .conf file for the vhost
file {
${vdir}/${name}.conf:
content = template($template),
owner   = 'root',
group   = 'root',
mode= '0644',
require = $logdir,
require = Package['httpd'],
notify  = Service['httpd'],
}

What would be the best way to manage that?  Separate my file resources in 3 
separate directives?

Thanks

Ugo

-- 
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/a0fa4b91-868e-414c-823a-3cba4080f8ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Custom apache module advice needed

2014-11-24 Thread Ugo Bellavance
Sorry for top-posting, but I found my mistake.  I didn't know we could not 
set 'require' more than once.  It now looks obvious but it wasn't when I 
was working on it.

Ugo


On Monday, November 24, 2014 12:38:33 PM UTC-5, Ugo Bellavance wrote:

 Hi,

 I've written my own puppet module for apache because I found that the 
 publicly-available ones had many dependencies or were too complex for me. 
  I'm not a puppet expert and I'm using EPEL's puppet which is 2.7.25.

 Here is the relevant part of my code that is used to create the apache 
 .conf file for our environments.  Our environments follow this standard:

 for dev:  /var/www/dev/$user/$application/

 for other environments stages: /var/www/$envstage/$application/

 The logs are located in a directory called logs in the $application 
 folder.

 My current puppet codes does everything that is needed to create an 
 environment, but it doesn't manage the order, so it may happen that the 
 logs folder is created after the apache refresh and cause a problem.

 I have a few (less-related) questions regarding this:

- Does puppet manage the creation of the parent directories as of now?
- I've had unplanned outages (nothing critical, clients/users were 
warned on dev and staging environments) because the refresh was done 
 before 
the logs directory was created
   - Should I implement file syntax checking for httpd .conf files? 
Should it be on file-level or should it be in the refresh parameter of 
 the 
   service? (Something similar to restart = '/usr/sbin/apachectl -t 
/etc/init.d/httpd graceful',


 When I add a require = File directives, it fails with an error that looks 
 like that:

 Duplicate parameter 'require' for on 
 File[/etc/httpd/conf.d/blabla-integration1.conf] at 
 /etc/puppet/modules/apache/manifests/vhost.pp

 Here is the relevant part of my code:


 $logdir = $vhost_base/logs

   if $envstage  != 'dev' {
 file { [ $logdir, /var/www/$envstage, $vhost_base, ]:
   ensure = 'directory',
   owner  = 'deploy',
   group  = 'deploy',
   mode   = 0744,
   }
 }
 # Generate the .conf file for the vhost
 file {
 ${vdir}/${name}.conf:
 content = template($template),
 owner   = 'root',
 group   = 'root',
 mode= '0644',
 require = $logdir,
 require = Package['httpd'],
 notify  = Service['httpd'],
 }

 What would be the best way to manage that?  Separate my file resources in 
 3 separate directives?

 Thanks

 Ugo


-- 
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/be4870e2-f4d5-4f7e-a64b-1c9242800096%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Authentication based on IP address is deprecated

2014-08-01 Thread Ugo Bellavance
Hi,

I just upgraded my puppetmaster to 2.7.25 (epel) and I get this message in 
the log file when the master is started:

Authentication based on IP address is deprecated; please use certname-based 
rules instead

I saw some kind of explanation in this 
post 
https://groups.google.com/forum/#!searchin/puppet-users/Authentication$20based$20on$20IP/puppet-users/JoMBQFGbLvs/YrRwHf0LQp0J
 
and in 2.7.18 release notes, but it is unclear if it will affect me. I use 
the default auth.conf and it doesn't seem to have changed in the new rpm.

Thanks,

Ugo

-- 
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/237f4a43-51ec-4617-ae1d-e663df252820%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Module for lsyncd - multiple syncs to be configured, but only one config file

2014-05-21 Thread Ugo Bellavance


 I have finally been able to get what I wanted.  I open a issue (
 https://github.com/axkibe/lsyncd/issues/275) on the github project 
 website and the main developper of lsyncd gave me a few lines of code to 
 put in my main config file to have any file in a given directory to be 
 imported in the main config file.  Then I created a module, based on a 
 simple apache vhost module that was given as a sample in the Pro Puppet 
 book.  It works for now, I have to test it more and implement it.  If 
 someone would like to have the module I can provide the code, but it may 
 not be good-looking or fully compliant with the highest standards...

 Thanks for all your help.


By the way, I'd like to say that this community is fantastic.  The support 
has been provided by many different persons around the clock, no matter the 
version I use or my knowledge level about puppet.  I don't think that there 
is even one of our vendors (that we pay $) that matches that.  Even though 
I did help a lot in the past, I don't have much time right now, but I'm 
glad to see that this kind of support exists in the open-source software.

-- 
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/7bd9e8d1-52dc-432c-8ad1-d8b0d9139c51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Module for lsyncd - multiple syncs to be configured, but only one config file

2014-05-20 Thread Ugo Bellavance


On Tuesday, May 20, 2014 8:47:58 PM UTC-4, Jakov Sosic wrote:

 On 05/16/2014 12:34 PM, Ugo Bellavance wrote: 

  Do I need the puppet concat module to do that?  I am on  puppet version 
  2.6 (using EPEL repo, upgrading to 2.7 soon.  I know it is not what 
  this group recommends, but it's the best for me right now). 

 Yes, you do if you use the code I provided. 

 Thanks,

I have finally been able to get what I wanted.  I open a issue 
(https://github.com/axkibe/lsyncd/issues/275) on the github project website 
and the main developper of lsyncd gave me a few lines of code to put in my 
main config file to have any file in a given directory to be imported in 
the main config file.  Then I created a module, based on a simple apache 
vhost module that was given as a sample in the Pro Puppet book.  It works 
for now, I have to test it more and implement it.  If someone would like to 
have the module I can provide the code, but it may not be good-looking or 
fully compliant with the highest standards...

Thanks for all your help.

-- 
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/8faad397-8954-48a4-9873-7600f4efd84f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Module for lsyncd - multiple syncs to be configured, but only one config file

2014-05-16 Thread Ugo Bellavance


On Friday, May 16, 2014 1:35:22 AM UTC-4, David Schmitt wrote:

 Hi, 

 On 16.05.2014 04:37, Ugo Bellavance wrote: 
  I worked on this tonight, but now I get an error when I try to apply it: 
  
  Could not retrieve catalog from remote server: Error 400 on SERVER: 
  Invalid parameter dest at /etc/puppet/manifests/nodes/nodes.pp:29 
  
  If I comment out this variable, another one generate an Invalid 
  parameter error... 
  
  I tried debugging it, but I think I need a little help. 
  
  Here is my init.pp: 
  
  class lsyncd { 
 [...] 
  } 
  
  define lsyncd::sync ( 
 $method, 
 $source, 
 $dest, 
 $desthost,) 
 { 
 [...] 
  } 
  
  Here is how I call it: 
  
  node test.example.com { 
  class { lsyncd: 
  title= [src1], 
  method   = [default.rsyncssh], 
  source   = [/var/www/test/src], 
  dest = [/var/www/test/dst1], 
  desthost = [www.example.com], 
  append   = [true] 
  } 
  } 

 You want to say it this way: 

class { lsyncd: ; } 
lsyncd::sync { 
  src1: 
method   = default.rsyncssh, 
source   = /var/www/test/src, 
dest = /var/www/test/dst1, 
desthost = www.example.com, 
append   = true; 
} 

 For details see the language guide at 

  
 http://docs.puppetlabs.com/puppet/latest/reference/lang_defined_types.html 

 Thanks,

Do I need the puppet concat module to do that?  I am on  puppet version 2.6 
(using EPEL repo, upgrading to 2.7 soon.  I know it is not what this 
group recommends, but it's the best for me right now).

Error:

Could not retrieve catalog from remote server: Error 400 on SERVER: 
Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid 
resource type concat at /etc/puppet/modules/lsyncd/manifests/init.pp:59 on 
node blabla

-- 
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/f1f0dd47-4fdd-4124-ac48-77e45609a37b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] btsync (was: Module for lsyncd - multiple syncs to be configured, but only one config file)

2014-05-16 Thread Ugo Bellavance


On Friday, May 16, 2014 8:12:55 AM UTC-4, Dirk Heinrichs wrote:

  Am 15.05.2014 21:25, schrieb Ugo Bellavance:

  I wrote my first puppet module and it is for lsyncd.


 Just looked into lsyncd and what it can achieve. While I like rsync and 
 use it quite often, there's a better way to mirror directories to multiple 
 destinations: BitTorrent Sync (btsync). btsync uses the BitTorrent 
 algorithm to distribute the contents of a directory to an arbitrary number 
 of other machines, where every other machine starts participating in the 
 distribution process as soon as they have some chunks of the added file(s) 
 available locally, thus producing less load on the originating machine.


Thanks a lot for your input, but I'm not looking for one-many 
relationships, just multiple one-one relationships, so btsync would not be 
that better in my case.

Ugo 

-- 
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/7dd2ae27-9f8c-421c-b12f-fc15a99ff85a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Module for lsyncd - multiple syncs to be configured, but only one config file

2014-05-15 Thread Ugo Bellavance
Hi,

I wrote my first puppet module and it is for lsyncd.  I know that there is 
already a module for that but I think it was written to manage lsyncd and 
csync2 syncs and I don't really understand everything it it so I can't 
really use it or learn from it.  I have been able to create a simple 
module, below is the code from init.pp (I know, I should modularize it so 
that init.pp calls ::install and ::config, but I'll do that once the module 
works as I want).  It is actually working, but only allows for one sync to 
be configured.  I'd like it to be able to configure more than one sync, but 
since all the configs for lsyncd is in one file, I wouldn't know how to do 
it unless I add some variables like $method, $source2, $dest2, $desthost2, 
$append2 and $method, $source3, $dest3, $desthost3, $append3, $method, 
$sourcex, $destx, $desthostx, $appendx. I think someone here would know how 
to do it.

Code for init.pp:

class lsyncd ($method, $source, $dest, $desthost, $append) {

package { 'lsyncd':
ensure = installed,
}

file { 'lsyncd.conf':
ensure  = present,
path= '/etc/lsyncd.conf',
owner   = root,
group   = root,
mode= '0644',
content = template('lsyncd/lsyncd.conf.erb')
}

service { 'lsyncd':
ensure  = running,
enable  = true,
hasrestart  = true,
hasstatus   = true,
require = [Package['lsyncd'], File['lsyncd.conf']],
subscribe   =
File[
'lsyncd.conf'
],
}

}


This is the code for the erb template (feel free to let me know if I you 
find errors):

settings {
   logfile= /var/log/lsyncd.log,
   statusFile = /tmp/lsyncd.status,
   inotifyMode = CloseWrite or Modify,
   delay   = 1
}

sync {
   %= @method %,
   source = %= source %,
   host   = %= desthost %,
   targetdir  = %= dest %,

% if @append -%
   rsync  = {
  _extra = {--append}
   }
% end -%
}

Here is how I'd like to have my config file:

settings {
   logfile= /var/log/lsyncd.log,
   statusFile = /tmp/lsyncd.status,
   inotifyMode = CloseWrite or Modify,
   delay   = 1
}

sync {
   default.rsyncssh,
   source = /var/www/test/src,
   host   = www.example.com,
   targetdir  = /var/www/test/dst,

   rsync  = {
  _extra = {--append}
   }
}

sync {
   default.rsyncssh,
   source = /var/www/,
   host   = www.example.com,
   targetdir  = /var/www/test/dst1,

   rsync  = {
  _extra = {--append}
   }
}

sync {
   default.rsyncssh,
   source = /var/log/,
   host   = www.example.com,
   targetdir  = /var/www/test/dst2,

   rsync  = {
  _extra = {--append}
   }
}

Thanks,

-- 
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/a63e58f0-1da9-40ef-bb4c-b5e99f3b0365%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Module for lsyncd - multiple syncs to be configured, but only one config file

2014-05-15 Thread Ugo Bellavance


On Thursday, May 15, 2014 5:45:57 PM UTC-4, Jakov Sosic wrote:

 On 05/15/2014 09:25 PM, Ugo Bellavance wrote: 
  Hi, 
  
  I wrote my first puppet module and it is for lsyncd.  I know that there 
  is already a module for that but I think it was written to manage lsyncd 
  and csync2 syncs and I don't really understand everything it it so I 
  can't really use it or learn from it.  I have been able to create a 
  simple module, below is the code from init.pp (I know, I should 
  modularize it so that init.pp calls ::install and ::config, but I'll do 
  that once the module works as I want).  It is actually working, but only 
  allows for one sync to be configured.  I'd like it to be able to 
  configure more than one sync, but since all the configs for lsyncd is in 
  one file, I wouldn't know how to do it unless I add some variables 
  like $method, $source2, $dest2, $desthost2, $append2 and $method, 
  $source3, $dest3, $desthost3, $append3, $method, $sourcex, $destx, 
  $desthostx, $appendx. I think someone here would know how to do it. 
  

 I would suggest you to take a look at concat module. 

 I think I'll go that way as I don't know hiera much.

Thanks to you both for your advice, I'll try this soon.

Ugo 

-- 
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/cfae4873-d4ef-452b-b00d-770c21440b01%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Module for lsyncd - multiple syncs to be configured, but only one config file

2014-05-15 Thread Ugo Bellavance


On Thursday, May 15, 2014 5:45:57 PM UTC-4, Jakov Sosic wrote:

 On 05/15/2014 09:25 PM, Ugo Bellavance wrote: 
  Hi, 
  
  I wrote my first puppet module and it is for lsyncd.  I know that there 
  is already a module for that but I think it was written to manage lsyncd 
  and csync2 syncs and I don't really understand everything it it so I 
  can't really use it or learn from it.  I have been able to create a 
  simple module, below is the code from init.pp (I know, I should 
  modularize it so that init.pp calls ::install and ::config, but I'll do 
  that once the module works as I want).  It is actually working, but only 
  allows for one sync to be configured.  I'd like it to be able to 
  configure more than one sync, but since all the configs for lsyncd is in 
  one file, I wouldn't know how to do it unless I add some variables 
  like $method, $source2, $dest2, $desthost2, $append2 and $method, 
  $source3, $dest3, $desthost3, $append3, $method, $sourcex, $destx, 
  $desthostx, $appendx. I think someone here would know how to do it. 
  

 I would suggest you to take a look at concat module. 

 You can basically split your single config file into multiple parts, and 
 write a defined type for sync sections. For example: 

# smb.conf 
concat { 'lsyncd.conf': 
  path= '/etc/lsyncd.conf', 
  owner   = root, 
  group   = root, 
  mode= '0644', 
} 

::concat::fragment { 'lsyncd.conf:settings': 
  target  = 'lsyncd.conf', 
  content = template('lsyncd/settings.conf.erb'), 
  order   = '100', 
} 

 And write your own defined type, for example: 

 define lsycnd::sync ( 
$method, 
$source, 
$host, 
$targetdir, 
 ) { 

include ::lsyncd 

::concat::fragment { lsyncd.conf:sync:${title}: 
  target  = 'lsyncd.conf', 
  content = template('lsyncd/sync.conf.erb'), 
  order   = '200', 
} 

 } 

 Now, your sync.conf.erb would look like: 

 sync { 
 %= @method %, 
 source = %= source %, 
 host   = %= desthost %, 
 targetdir  = %= dest %, 

 % if @append -% 
 rsync  = { 
_extra = {--append} 
 } 
 % end -% 
 } 


 I worked on this tonight, but now I get an error when I try to apply it:

Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid 
parameter dest at /etc/puppet/manifests/nodes/nodes.pp:29

If I comment out this variable, another one generate an Invalid parameter 
error...

I tried debugging it, but I think I need a little help.

Here is my init.pp:

class lsyncd {

  package { 'lsyncd':
ensure = installed,
  }

  concat { 'lsyncd.conf':
path= '/etc/lsyncd.conf',
owner   = root,
group   = root,
mode= '0644',
  }

  ::concat::fragment { 'lsyncd.conf:settings':
target  = 'lsyncd.conf',
content = template('lsyncd/settings.conf.erb'),
order   = '100',
  }

define lsyncd::sync (
  $method,
  $source,
  $dest,
  $desthost,)
  {

  include ::lsyncd

  ::concat::fragment { lsyncd.conf:sync:${title}:
target  = 'lsyncd.conf',
content = template('lsyncd/sync.conf.erb'),
order   = '200',
  }

service { 'lsyncd':
ensure  = running,
enable  = true,
hasrestart  = true,
hasstatus   = true,
require = [Package['lsyncd'], File['lsyncd.conf']],
subscribe   =
File[
'lsyncd.conf'
],
}

  }
}

My settings.conf.erb:

settings {
   logfile= /var/log/lsyncd.log,
   statusFile = /tmp/lsyncd.status,
   inotifyMode = CloseWrite or Modify,
   delay   = 1
}

My sync.conf.erb:

sync {
%= @method %,
source = %= source %,
host   = %= desthost %,
targetdir  = %= dest %,

% if @append -%
rsync  = {
   _extra = {--append}
}
% end -%
}

Here is how I call it:

node test.example.com {
   class { lsyncd:
   title= [src1],
   method   = [default.rsyncssh],
   source   = [/var/www/test/src],
   dest = [/var/www/test/dst1],
   desthost = [www.example.com],
   append   = [true]
   }
}

Thanks,

-- 
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/c18e50c3-c978-48ba-9fb9-268d0652747d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet module restart puppet client or not?

2012-12-13 Thread Ugo Bellavance
On Thursday, December 13, 2012 5:43:14 AM UTC-5, Matthew Burgess wrote:

 On Thu, Dec 13, 2012 at 12:41 AM, Ugo Bellavance 
 ug...@lubik.cajavascript: 
 wrote: 

  I guess maybe I should ask to the Foreman group, 
  but I was mostly wondering whether it was a good idea or not to restart 
  puppet when changing puppet.conf. 

 I think it would be a bad idea not to.  Otherwise you've got a process 
 running under a different configuration than what is on disk, so when 
 it doesn't look like it's behaving like the config suggests it should, 
 it can cause a lot of head-scratching! 


That rises two questions in my mind:


   1. In my understanding, puppetmaster catches any changes in the 
   manifests without needing a restart, why can't the puppet client reload its 
   puppet.conf parameters at the next run?
   2. Why puppet can't use the reload option of most current daemons' 
   init scripts?  I think there should be a parameter hasreload, similar to 
   hasrestart, saying that the init script supports the use of the reload 
   argument.  This would avoid this kind of problem, and people wouldn't have 
   to redefine the restart command.

Ugo

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/Vi0T1D5_sfwJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Puppet module restart puppet client or not?

2012-12-12 Thread Ugo Bellavance
Hi,

I've built a puppet module myself to manage puppet.conf and I use a 
subscribe for the service, so it restarts the client whenever puppet.conf 
changes.  I think I shouldn't but I'd like to have a confirmation.  The 
fact that foreman sees a failure upon a change in puppet.conf makes me 
think even more that I am wrong...

Thanks,

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/13IctiK6RhQJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Puppet module restart puppet client or not?

2012-12-12 Thread Ugo Bellavance


On Wednesday, December 12, 2012 6:13:41 PM UTC-5, Ryan Coleman wrote:




 On Wed, Dec 12, 2012 at 10:57 AM, Ugo Bellavance ug...@lubik.cajavascript:
  wrote:

 Hi,

 I've built a puppet module myself to manage puppet.conf and I use a 
 subscribe for the service, so it restarts the client whenever puppet.conf 
 changes.  I think I shouldn't but I'd like to have a confirmation.   

 The fact that foreman sees a failure upon a change in puppet.conf makes me 
 think even more that I am wrong...


 If the service was successfully restarted, it should register as a 
 successful change. That's normal behavior. Is that not what you see?

 Makes sense, but I think Foreman may have a way to determine whether the 
report is Applied, Restarted, Failed, Restart Failure, Skipped or Pending. 
 Maybe it shows Failed because it doesn't see the Finished catalog run in 
0.64 seconds at the end?  I guess maybe I should ask to the Foreman group, 
but I was mostly wondering whether it was a good idea or not to restart 
puppet when changing puppet.conf.

Thanks,

Ugo

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/0HW2jDtOobsJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: metadata.json and 2.6

2012-12-11 Thread Ugo Bellavance
On Friday, December 7, 2012 8:41:27 PM UTC-5, Ugo Bellavance wrote:

 Hi,

 We've created modules based on the standard, but I had to remove the 
 metadata.json file in the modules because I got these errors when the 
 metadata.json file was there:  Could not retrieve catalog from remote 
 server: Error 400 on SERVER: No source module metadata provided for 
 modulename.

 Is my puppet version too old (puppet-2.6.17-2.el5) to support this file?


 It looks more like my colleague, who has been working on the modules 
hasn't built the module.  He's working on it.
 

 Thanks,

 Ugo


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/3AN4KVbUEuQJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: Module class parameter override question

2012-12-11 Thread Ugo Bellavance
On Tue, Dec 11, 2012 at 3:47 PM, Jason Cochard jason.coch...@gmail.comwrote:

 This class does not accept any parameters, thus why it is failing.  You
 could easily modify it though to do so:

 class apache::service ( $enable = true,)
 {

 ...snip...

  service { $http_service:
 ensure = running,
 enable = *$enable*,
 hasstatus  = true,
 hasrestart = true,
 alias  = 'httpd',
 subscribe  = Package['httpd']
   }
 ...snip...

 Then call it like this on the node:
 node 'server1' {
   class {  apache::service: enable  = false }
 }


Wow, with just that, I'll be able to do that with all my modules that need
to accept parameters.



 Side note, when there is only one parameter, the best practice is to put
 it all on one line.


Ok, I wonder if puppet-lint would have caught that.

Thanks a lot,

Ugo

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Module class parameter override question

2012-12-07 Thread Ugo Bellavance
Hi,

I am experimenting with foreman's apache module and there is this class 
here:

class apache::service {
  $http_service = $::operatingsystem ? {
/(Debian|Ubuntu)/ = 'apache2',
default   = 'httpd',
  }

  service { $http_service:
ensure = running,
enable = true,
hasstatus  = true,
hasrestart = true,
alias  = 'httpd',
subscribe  = Package['httpd']
  }

  exec { 'reload-apache':
command = /etc/init.d/${http_service} reload,
onlyif  = '/usr/sbin/apachectl -t',
require = Service['httpd'],
refreshonly = true,
  }

}

I want to apply this class to a specific host, but I want to override the 
enable parameter so that it is false.

I tried this:

node 'server1' {
  class { 'apache::service':
  enable  = false,}
}

But I always get this error:

Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid 
parameter enable at /etc/puppet/manifests/nodes/nodes.pp:40

Any help would be appreciated.

Thanks,

Ugo

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/CFRXiqvj8cAJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



  1   2   >