[Puppet Users] User management

2014-08-20 Thread Gregory Orange
How do people manage users? I'm slowly marching toward LDAP (someone recently suggested FreeIPA, not sure if it's relevant), but trying to stave it off for the time being. I've read a few blogs and posts on the topic, but nothing clear comes out - except that if one gets too complicated, one sh

Re: [Puppet Users] Re: How can we find out the directory presence?

2014-08-20 Thread Christopher Wood
That might work if you were compiling the catalog on the server where the catalog will be applied. Functions/templates are run during catalog compilation so this will not find a directory on a pure-agent node. https://docs.puppetlabs.com/learning/templates.html https://docs.puppetlabs.com/guides

[Puppet Users] Re: How can we find out the directory presence?

2014-08-20 Thread Jason_s
you could drop down into pure ruby and evaluate that inside an inline_template… On Monday, August 18, 2014 2:05:43 PM UTC+2, Satish Katuru wrote: > > Hi , > > I wanted to find out whether the directory exists or not in the > machine.How can I do it? > > if I do it as below it will create a dir

[Puppet Users] puppet script/module for 3 environment

2014-08-20 Thread Frans Thamura
hi all anyone have an example that run puppet script in 3 enviroment, 1. puppet vagrant 2. puppet apply 3. puppet master can share? thx F -> still stack test my own in that environment -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsu

Re: [Puppet Users] Q: execute a working manifest with modules

2014-08-20 Thread Frans Thamura
> From the doc : > > *nix (open source)$confdir/modules:/usr/share/puppet/modules > > So in your case it would be --modulepath=/vagrant/data/puppet/modules. > I try the puppet apply --modulepath=/vagrant/data/puppet/modules the console like do nothing can help? F > Hope it helps, > >

Re: [Puppet Users] Encrypting /var/lib/puppet directory on clients

2014-08-20 Thread Brian Mathis
The only way to mount an encrypted volume on boot is if the password is stored somewhere on the server itself, such as in /etc/crypttab. Maybe you could come up with a system that uses ssh to login and "manually" mount the volume with a password after the system is booted. One thing to be aware o

[Puppet Users] Encrypting /var/lib/puppet directory on clients

2014-08-20 Thread Eugene Sapozhnikov
I have been given a project to secure our client hosts. One of the requirements was to setup an encrypted volume and mount it over /var/puppet/lib . the other requirement was to have the encryption key reside only on the puppet master. I have been able to use cryptsetup to have puppet configur

Re: [Puppet Users] Re: If else statement if file exists

2014-08-20 Thread Yanis Guenane
Mea culpa for a misleading information. Thanks John for the explanation, I didn't know about the 'particular instant during the catalog compilation'. And for the ensure => absent, I haven't thought about that one. -- Yanis Guenane On 08/20/2014 09:11 AM, jcbollinger wrote: > > > On Tuesday, Au

Re: [Puppet Users] Error 400: Could not find declared class (consistently)

2014-08-20 Thread Christopher Wood
On Wed, Aug 20, 2014 at 06:13:56AM -0700, Lutz Behnke wrote: >Hi there, > >I am getting the following error on one of my client machines: > >Error: Could not retrieve catalog from remote server: Error 400 on SERVER: >Puppet::Parser::AST::Resource failed with error ArgumentError: C

Re: [Puppet Users] Re: "require" broken with create_resources() ?

2014-08-20 Thread Joseph Swick
On 20/08/14 09:50, Vincent Miszczak wrote: > > Instead, I pass a YAML hash through an ENC (Foreman to be precise): > test: > url: "https://mygitrepos/myapp.git"; > root:"/opt/apps/myapp" > user: root > require: Class[myclass] > > > I finally understand this won't work because this is expan

[Puppet Users] Error 400: Could not find declared class (consistently)

2014-08-20 Thread Lutz Behnke
Hi there, I am getting the following error on one of my client machines: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class postfix::relay at /etc/puppet/local-puppet-conf/mod

Re: [Puppet Users] Re: If else statement if file exists

2014-08-20 Thread Eugene Sapozhnikov
Thanks for clearing it up. I ended up just using onlyif and unless in each exec statement. this allowed me to rcycle the same commands between the scenario of creating the volume and mounting and encrypting the volume and mounting it. Thanks On Wednesday, August 20, 2014 6:11:14 AM UTC-7, jc

Re: [Puppet Users] Re: "require" broken with create_resources() ?

2014-08-20 Thread Vincent Miszczak
I've simplified things a bit in the description to make it easy to read. I don't really have $apps = { test => { url=> "https://mygitrepos/myapp.git";, root=> "/opt/apps/myapp", user=>"root", require=>Class[myclass], } } Instead, I pass a YAML hash through an ENC (For

[Puppet Users] Re: If else statement if file exists

2014-08-20 Thread jcbollinger
On Monday, August 18, 2014 4:45:23 PM UTC-5, Eugene Sapozhnikov wrote: > > > > I am trying to figure out a way to use a if statement to run multiple sets > of commands depending if one file exists, but I am unable to find any good > documented ways of doing this. > > Your main alternatives are

Re: [Puppet Users] Re: If else statement if file exists

2014-08-20 Thread jcbollinger
On Tuesday, August 19, 2014 11:10:26 AM UTC-5, Yanis Guenane wrote: > > If your file `/volumes/vol1` could be managed by Puppet somehow, you > could use if defined(File['/volumes/vol1']) as a condition. > > Not sure if it is possible in your case, > Whether it's possible is irrelevant, becau

Re: [Puppet Users] Re: "require" broken with create_resources() ?

2014-08-20 Thread R.I.Pienaar
- Original Message - > From: "jcbollinger" > To: puppet-users@googlegroups.com > Sent: Wednesday, August 20, 2014 2:01:09 PM > Subject: [Puppet Users] Re: "require" broken with create_resources() ? > > > > On Wednesday, August 20, 2014 6:04:56 AM UTC-5, Vincent Miszczak wrote: > > > >

Re: [Puppet Users] puppet resource ordering/execution kungfu

2014-08-20 Thread Flamarion Jorge
Inside of your lib/facter directory you could write a facter for check if package is already installed and use a top scope variable provide by facter to do an if in your class for test it. If the package is installed (true) don't do anything else if (false) install it else {}. Sorry for my bad En

[Puppet Users] Re: "require" broken with create_resources() ?

2014-08-20 Thread jcbollinger
On Wednesday, August 20, 2014 6:04:56 AM UTC-5, Vincent Miszczak wrote: > > Hello, > > I have a define like this : > > define application::install($root,$url,$user="root") > { > include git > #Puppet wants a command to start with /something... > $cmd="/bin/echo 1&&{ cd $root||mkdir $root&&cd $

Re: [Puppet Users] How can we find out the directory presence?

2014-08-20 Thread Martin Alfke
Hi, you want to find out whether a directory exists on a node. This has to be done on the node by using custom facts. When the master compiles the catalog you want to switch processing of Puppet code depending on the fact result. This means: you have to write a custom fact which best distribut

[Puppet Users] puppet resource ordering/execution kungfu

2014-08-20 Thread Stefan Wiederoder
Hello puppet users, I´m struggling with puppets resource odering my task is to install the QConvergeConsoleCLI rpm, which needs /tmp as executable - which is per default noexec on our boxes. but adding a require to the package instruction will always mount /tmp as executable even if the p

Re: [Puppet Users] How can we find out the directory presence?

2014-08-20 Thread Sneha More
Jorge, : the other way you specified does the same as: File { " /etc/puppet/test": ensure => "directory", } This will also create a directory if it does not exist. Satish: There must be some reason for which you are checking presence of directory. So you can add unless condition with exec resource

[Puppet Users] "require" broken with create_resources() ?

2014-08-20 Thread Vincent Miszczak
Hello, I have a define like this : define application::install($root,$url,$user="root") { include git #Puppet wants a command to start with /something... $cmd="/bin/echo 1&&{ cd $root||mkdir $root&&cd $root ; }&&git clone -b prod $url ." $unless="/bin/ls -alh $root |grep '.git'" exec{"$cm