[Puppet Users] JOB: Puppet DevOps Position in Switzerland

2012-08-14 Thread Toni Birrer
Hi.

We're a small startup, based in Zurich, Switzerland and we're looking 
for an experienced devops engineer.
Powering our two services ( http://squirro.com and http://memonic.com ) 
is a pretty slick infrastructure based on amazon aws and its been managed 
with puppet since day one ;-)
Since our solutions are built in python and we're not kidding about the dev 
in devops, it great if you have experience in python too. 

You can find all the details about the position 
here: http://squirro.com/about/jobs/open-position-devops-engineer/

Regards,
Toni

-- 
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/-/1UiVS7J5OGIJ.
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] Passing special characters to exec's command - syntax help!!

2012-08-14 Thread Julia Smith
Hi

I want to use exec to create a recursive directory (I know I can use file
but for another reason I don't want to)

So as a variable I get passed in $home and it may be for example
/first/second/userdirectory where first and second may not exist.

Puppet's user wraps useradd so it won't recursively create my directory so
I want to use exec to create the directory /first/second before the user is
created.
If I allow puppet to recursively create /first/second/userdirectory in it's
entirety with file.when the user is created it doesn't contain the
.bashrc and .profile files which I want.

So I wanted to do a simple exec command which does the following if I were
to do it at the command line:

mkdir -p ${home%/*}

...this would make /first/second and I can allow useradd create the
userdirectory.

BUTpuppet doesn't like me passing that to command.

exec { "$home.create":
  path  => '/bin:/usr/bin',
  command   => "mkdir -p '${home%/*}'",
}

I get Could not match %/*}\"

Is this possible and if so what is the correct syntax? I've tried lots of
options.
Thanks in advance
Julia

-- 
This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. 
If you have received this email in error please notify the system manager. 
This message contains confidential information and is intended only for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail.

-- 
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] Re: Passing special characters to exec's command - syntax help!!

2012-08-14 Thread earthgecko
There are a number of ways to achieve that.

One would be to.

file { [ '/first', '/first/second' ]:
  ensure => directory,
  owner  => 'root',
  group  => 'root',
  mode  => '0755',
  before => User['julia'],
}

user { 'juila':
  ensure => present,
  gid  => 'julia',
  groups=> ['users'],
#  uid=> '7000',
  comment => 'This user was created by puppet',
  require=> File['/first/second'],
#  managehome => true,
}

Now you can declare a require or before, you do not have to specify both, 
but if you do it will not break.

As for the passing special characters.  I will post something related now.

-- 
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/-/_V9RvUlzSgAJ.
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: Passing special characters to exec's command - syntax help!!

2012-08-14 Thread earthgecko


So as a variable I get passed in $home and it may be for example 
> /first/second/userdirectory where first and second may not exist. 
>
> So I wanted to do a simple exec command which does the following if I were 
> to do it at the command line:
>
> mkdir -p ${home%/*}
>
> ...this would make /first/second and I can allow useradd create the 
> userdirectory. 
>
> BUTpuppet doesn't like me passing that to command.
>
> exec { "$home.create":
>   path  => '/bin:/usr/bin',
>   command   => "mkdir -p '${home%/*}'",
> }
>
> I get Could not match %/*}\"
>
>
>
So firstly in the context of 

command   => "mkdir -p '${home%/*}'",

Puppet will try and look up variable:

home%/*

Because it is ${ and double quoted, so puppet is trying to compile the 
command as it is ${ in a double quoted string which puppet understands as a 
variable.

I do not understand the context of the % percent and * wildcard 
references.  But is $home was defined as '/first/second', then:

command   => "mkdir -p ${home}",

As for passing special characters, different blends of variables and 
special characters should always be tested.  Special characters should be 
passed via the exec command context if single quoted and no variables, not 
100% certain, it always pays to test.
 

-- 
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/-/4QCHahZc-MYJ.
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: Class Execution order

2012-08-14 Thread jcbollinger


On Tuesday, August 14, 2012 12:12:33 AM UTC-5, Douglas wrote:
>
> Trying to force puppet class execution order with: 
>
> Class['lvm'] -> Class['network'] -> Class['apt'] -> Class <| |> 
>
> This is giving me: 
>
> err: Could not retrieve catalog from remote server: Error 400 on 
> SERVER: Resource type class doesn't exist at 
> /truth/sauce/env/prod/modules/role/manifests/common.pp:37 on node 
> testweb07.us1.xxx.com 
> warning: Not using cache on failed catalog 
>
> I did have it working with run stages, but when trying to also use the 
> relationship syntax with the following in site.pp 
>
> Apt::Source <| |> -> Exec["apt-update"] 
> Exec['apt-update'] -> Package <| |> 
>
> got the dreaded cyclic dependency errors... :( 
>


Yes, both run stages and chaining from/to collections are prone to causing 
cycles.  They have their uses, but you do need to think very carefully 
about how you use them.  Moreover, the more you use them, the more likely 
you are to have trouble.  It is often quite hard to make correct blanket 
statements about resource relationships, more so the more complex your 
manifests become.

It looks and sounds as if you are trying to re-express your stages-based 
manifests using resource chaining.  If that's the case then you are on a 
wild goose chase.  Declaring the same relationships via a different syntax 
must necessarily produce the same cycle(s).  To fix the problem you need to 
remove (the right) unneeded relationships.


John


-- 
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/-/MHvZajwaAc4J.
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: Class Execution order

2012-08-14 Thread earthgecko
Dreaded.  I have found that using the .dot files that puppet --graph option 
produces sometimes helps see those dreaded dependency cycle issues (and 
some times it does not).  I recommend graphviz for anyone on linux for 
generating png files for the .dot files (not sure for Windows).

On my setup I have:

 # If graph is passed the graphviz .dot files are written to
 # /var/lib/puppet/state/graphs/ and you generate a .png image file
 # on your machine with graphviz e.g.:
 # dot -Tpng expanded_relationships.dot -o expanded_relationships.png

And that can help.  We feel for you, good luck, hopefully you have figured 
it by now.



On Tuesday, August 14, 2012 6:12:33 AM UTC+1, Douglas wrote:
>
> Trying to force puppet class execution order with: 
>
> Class['lvm'] -> Class['network'] -> Class['apt'] -> Class <| |> 
>
> This is giving me: 
>
> err: Could not retrieve catalog from remote server: Error 400 on 
> SERVER: Resource type class doesn't exist at 
> /truth/sauce/env/prod/modules/role/manifests/common.pp:37 on node 
> testweb07.us1.xxx.com 
> warning: Not using cache on failed catalog 
>
> I did have it working with run stages, but when trying to also use the 
> relationship syntax with the following in site.pp 
>
> Apt::Source <| |> -> Exec["apt-update"] 
> Exec['apt-update'] -> Package <| |> 
>
> got the dreaded cyclic dependency errors... :( 
>
> Doug. 
>

-- 
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/-/lk1P9eHdV9UJ.
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: Passing special characters to exec's command - syntax help!!

2012-08-14 Thread Julia Smith
Hi
Thanks for your response.
The first answer won't work for me as I want to be dynamic about it and
take in a variable of the full path so it could just as easily be 10
directories deep. I'm getting the value for home from a CLI rather than
hand crafting something static.

The significance of the %/* means take the variable's value and right strip
back to the last '/' character. So where I have /first/second/userdir
passed in in the variable $home,
I want to create only /first/second with the mkdir -p command.

Julia

On 14 August 2012 13:54, earthgecko  wrote:

>
>
> So as a variable I get passed in $home and it may be for example
>> /first/second/userdirectory where first and second may not exist.
>>
>> So I wanted to do a simple exec command which does the following if I
>> were to do it at the command line:
>>
>> mkdir -p ${home%/*}
>>
>> ...this would make /first/second and I can allow useradd create the
>> userdirectory.
>>
>> BUTpuppet doesn't like me passing that to command.
>>
>> exec { "$home.create":
>>   path  => '/bin:/usr/bin',
>>   command   => "mkdir -p '${home%/*}'",
>> }
>>
>> I get Could not match %/*}\"
>>
>>
>>
> So firstly in the context of
>
> command   => "mkdir -p '${home%/*}'",
>
> Puppet will try and look up variable:
>
> home%/*
>
> Because it is ${ and double quoted, so puppet is trying to compile the
> command as it is ${ in a double quoted string which puppet understands as a
> variable.
>
> I do not understand the context of the % percent and * wildcard
> references.  But is $home was defined as '/first/second', then:
>
> command   => "mkdir -p ${home}",
>
> As for passing special characters, different blends of variables and
> special characters should always be tested.  Special characters should be
> passed via the exec command context if single quoted and no variables, not
> 100% certain, it always pays to test.
>
>
> --
> 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/-/4QCHahZc-MYJ.
>
> 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.
>

-- 
This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. 
If you have received this email in error please notify the system manager. 
This message contains confidential information and is intended only for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail.

-- 
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] Re: update yumrepo followed by packages updates.

2012-08-14 Thread trey85stang
Well no go with metadata_expire or a yum clean all after updating the 
repo.  This appears to be a bug of some sort.  Debugging output shows 
before any packages checked this output:

debug: Prefetching yum resources for package
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm --version'
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -qa 
--nosignature --nodigest --qf '%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} 
%{RELEASE} 
%{ARCH} 


''  


debug: Puppet::Type::Package::ProviderYum: Executing '/usr/bin/python 
/usr/lib/ruby/site_ruby/1.8/puppet/provider/package/yumhelper.py'

I am thinking puppet somehow uses this information throughout the puppet 
run,  to verify packages are the latest.  The obvious problem is this 
doesnt get updated if a repo is updated.  Hopefully I can get this worded 
correctly and into a bug report.

On Monday, August 13, 2012 2:20:37 PM UTC-5, trey85stang wrote:
>
> Thanks for the replies.  I will give them metadata_expire option a try and 
> if that doesnt work.. ill just execute a yum clean all with every internal 
> repo update.
>

-- 
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/-/H8lKCaEv-cUJ.
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 fileserver and $environment in foreman

2012-08-14 Thread Yaniv Fine
Hello puppet experts 

i have followed the following docoment to setup separate environment 
for development testing and production 
http://puppetlabs.com/blog/git-workflow-and-puppet-environments/

can i use environment  variable inside a module and thus calling separate 
modules for separate  environment 
when developing new module , after testing it in testing environment  i can 
move/copy it to my prodcution module path without the need to change the 
path in (source  => 'puppet:///development/repolist/files/CentOS-Base.repo')
i just put "$environment" instead of the real environment name 
 source  => 'puppet:///$environment/repolist/files/CentOS-Base.repo'  
can this be accomplished ? does modules => source  understnds the machine 
environment i select in foreman ?


thank you 
attached is my puppet.conf on puppetmaster 

[main]
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl
#modulepath=/etc/puppet/modules:/etc/puppet/modules/development:/etc/puppet/modules/common:/etc/puppet/modules/production
manifest=/etc/puppet/manifests/site.pp
[agent]
classfile = $vardir/classes.txt
localconfig = $vardir/localconfig
report  = true
pluginsync  = true
masterport  = 8140
environment = production
certname= puppetserver.plimus.com
server  = puppetserver.plimus.com

[master]
autosign   = $confdir/autosign.conf { mode = 664 }
reports= foreman
external_nodes = /etc/puppet/node.rb
node_terminus  = exec
[development]
modulepath = /etc/puppet/modules/development
[production]
modulepath = /etc/puppet/modules/production
[testing]
  modulepath = /etc/puppet/modules/testing

-- 
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/-/R0JoeC071JcJ.
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: update yumrepo followed by packages updates.

2012-08-14 Thread trey85stang
dohh... I just realized this host had 2.6 installed... not 2.7.   
Everything works fine on 2.7.

On Tuesday, August 14, 2012 9:07:39 AM UTC-5, trey85stang wrote:
>
> Well no go with metadata_expire or a yum clean all after updating the 
> repo.  This appears to be a bug of some sort.  Debugging output shows 
> before any packages checked this output:
>
> debug: Prefetching yum resources for package
> debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm --version'
> debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -qa 
> --nosignature --nodigest --qf '%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} 
> %{RELEASE} 
> %{ARCH}   
>   
>
> ''
>   
>
> debug: Puppet::Type::Package::ProviderYum: Executing '/usr/bin/python 
> /usr/lib/ruby/site_ruby/1.8/puppet/provider/package/yumhelper.py'
>
> I am thinking puppet somehow uses this information throughout the puppet 
> run,  to verify packages are the latest.  The obvious problem is this 
> doesnt get updated if a repo is updated.  Hopefully I can get this worded 
> correctly and into a bug report.
>
> On Monday, August 13, 2012 2:20:37 PM UTC-5, trey85stang wrote:
>>
>> Thanks for the replies.  I will give them metadata_expire option a try 
>> and if that doesnt work.. ill just execute a yum clean all with every 
>> internal repo update.
>>
>

-- 
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/-/Nqy9xmmEv-kJ.
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: Passing special characters to exec's command - syntax help!!

2012-08-14 Thread earthgecko
OK then.

command => "mkdir -p $(dirname ${home})",

That does it.


-- 
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/-/1LLoBIiTMZ4J.
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 fileserver and $environment in foreman

2012-08-14 Thread Yaniv Fine
Hello puppet experts 

i have followed the following docoment to setup separate environment 
for development testing and production 
http://puppetlabs.com/blog/git-workflow-and-puppet-environments/

can i use environment  variable inside a module and thus calling separate 
modules for separate  environment 
when developing new module , after testing it in testing environment  i can 
move/copy it to my prodcution module path without the need to change the 
path in (source  => 'puppet:///development/
repolist/files/CentOS-Base.repo')
i just put "$environment" instead of the real environment name 
 source  => 'puppet:///$environment/repolist/files/CentOS-Base.repo'  
can this be accomplished ? does modules => source  understnds the machine 
environment i select in foreman ?


thank you 
attached is my puppet.conf on puppetmaster 

[main]
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl
#modulepath=/etc/puppet/modules:/etc/puppet/modules/development:/etc/puppet/modules/common:/etc/puppet/modules/production
manifest=/etc/puppet/manifests/site.pp
[agent]
classfile = $vardir/classes.txt
localconfig = $vardir/localconfig
report  = true
pluginsync  = true
masterport  = 8140
environment = production
certname= puppetserver.mycompany.com
server  = puppetserver.mycompany.com

[master]
autosign   = $confdir/autosign.conf { mode = 664 }
reports= foreman
external_nodes = /etc/puppet/node.rb
node_terminus  = exec
[development]
modulepath = /etc/puppet/modules/development
[production]
modulepath = /etc/puppet/modules/production
[testing]
  modulepath = /etc/puppet/modules/testing

-- 
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/-/Nm8cJthbTykJ.
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] Variable scoping question

2012-08-14 Thread Davíð Steinn Geirsson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi all,

I have a configuration similar to the following (the puppet version is
2.6.16):

node basenode {
$ldapenvironment = "office"
}
node mynode inherits basenode {
include ldap
}

class ldap {
file {
"/etc/openldap/ldap.conf":
owner => "root",
group => "root",
mode => 644,
source => [
"puppet:///modules/ldap/oldap.${ldapenvironment}.conf",
"puppet:///modules/ldap/oldap.conf",
],
sourceselect => first;

}

if ($operatingsystemmajorrelease == "6") {
include ldap::ldap-sssd
}
}

class ldap::ldap-sssd {
file {
"/etc/sssd/sssd.conf":
owner => "root",
group => "root",
mode  => 600,
source => 
"puppet:///modules/ldap/sssd.${ldapenvironment}.conf",
subscribe => Package["sssd"];
}
}


For the ldap class, things work as I expect, $ldapenvironment is
interpolated into the source. However, with the sub-class
ldap::ldap-sssd, the $ldapenvironment variable is empty and puppet
tries to fetch "sssd..conf".

Does variable scoping work differently in includes under node
definitions than under class definitions?

I could not find a good explanation for this in the docs, pointers
would be appreciated.

- -- 
Bestu kveðjur / Best regards,
Davíð Steinn Geirsson

Sími 575 0400 | Síðumúla 32 | 108 Reykjavík
http://www.basis.is/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlAqcxwACgkQKXQCZqH9wfw21wCgncbz0Lk2LV4odeSDHFsB53I0
PtsAoI47VD51NOLOOaN9enrlZkSLi82b
=RRZB
-END PGP SIGNATURE-

-- 
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.



Re: [Puppet Users] variable scoping?

2012-08-14 Thread Zachary Alex Stern

>
> Sorry typo:
>
> class puppet (
>   $server = $puppet::params::server
> ) inherits puppet::params {
>
>
FWIW, this works:

 class puppet::config {

  include puppet::params
  $puppetserver=$puppet::params::puppetserver
  $runinterval=$puppet::params::runinterval
  file { '/etc/puppet/puppet.conf':
ensure  => present,
content => template('puppet/puppet.conf.erb'),
require => Class['puppet::install'],
notify  => Class['puppet::service'],
}
}

-- 
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/-/olunJ-yU1gIJ.
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: Class Execution order

2012-08-14 Thread Douglas Garstang
On Tue, Aug 14, 2012 at 6:09 AM, jcbollinger  wrote:
>
>
> On Tuesday, August 14, 2012 12:12:33 AM UTC-5, Douglas wrote:
>>
>> Trying to force puppet class execution order with:
>>
>> Class['lvm'] -> Class['network'] -> Class['apt'] -> Class <| |>
>>
>> This is giving me:
>>
>> err: Could not retrieve catalog from remote server: Error 400 on
>> SERVER: Resource type class doesn't exist at
>> /truth/sauce/env/prod/modules/role/manifests/common.pp:37 on node
>> testweb07.us1.xxx.com
>> warning: Not using cache on failed catalog
>>
>> I did have it working with run stages, but when trying to also use the
>> relationship syntax with the following in site.pp
>>
>> Apt::Source <| |> -> Exec["apt-update"]
>> Exec['apt-update'] -> Package <| |>
>>
>> got the dreaded cyclic dependency errors... :(
>
>
>
> Yes, both run stages and chaining from/to collections are prone to causing
> cycles.  They have their uses, but you do need to think very carefully about
> how you use them.  Moreover, the more you use them, the more likely you are
> to have trouble.  It is often quite hard to make correct blanket statements
> about resource relationships, more so the more complex your manifests
> become.
>
> It looks and sounds as if you are trying to re-express your stages-based
> manifests using resource chaining.  If that's the case then you are on a
> wild goose chase.  Declaring the same relationships via a different syntax
> must necessarily produce the same cycle(s).  To fix the problem you need to
> remove (the right) unneeded relationships.

Not really. I have three run stages that have been working fine. It
was when I tried to add

Apt::Source <| |> -> Exec["apt-update"]
Exec['apt-update'] -> Package <| |>

to site.pp to globally enforce apt source installs, an apt-get update
and then installation of packages, in that order, that the dependency
cycles started. I thought maybe mixing the two was bad, which was when
I tried replacing the run stages with Class->, which doesn't seem to
be allowed syntactically btw. Looks like a bug?

I could put the installation of apt sources in their own run stage
that runs first. However, different classes of servers need different
apt sources, and therefore I need the ability to be able to add apt
sources at arbitrary points after the initial run stage, yet still
ensuring that an apt-get update happens only once after all the apt
sources have been installed, but before any packages are installed.

This must be a general problem. Wonder how people have solved it...?

Doug.

-- 
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.



Re: [Puppet Users] hiera command line performance

2012-08-14 Thread R.I.Pienaar
hello,

- Original Message -
> From: "Paul Colby" 
> To: puppet-users@googlegroups.com
> Sent: Monday, August 13, 2012 6:22:10 PM
> Subject: [Puppet Users] hiera command line performance
> 
> Hi everyone,
> 
> 
> The hiera command line program (version 0.3.0) is currently taking
> around 2 seconds per invocation. This seems quite slow to me, but is
> probably not an issue for most users.

2 seconds seem quite slow though i guess it depends on the size of your
yamls and so forth, sounds like yours are big and complex.  I'd hope the
bulk of the time is spent on starting/stopping ruby each time.

A better option might be to consider writing your script in ruby rather
than bash so you can then do your lookup that way reusing the single
hiera instance and avoid the ruby start/stop cost

So a simple test on my setup doing:

for i in {1..100}
do
  hiera syslocation ::location=foo
done

this takes 30 seconds, ages.  Here is the same in Ruby reusing the
class and using a single interpreter:

h = Hiera.new(:config => "/etc/hiera.yaml")

Benchmark.measure do
 100.times do
  puts h.lookup("syslocation", "", {"::location" => "foo"})
 end
end

this takes 0.1 second for 100 lookups.  If you know a bit of ruby this
would be a good approach for you even if you just write your script to
configure a single machine in ruby and run it 40 times only

> 
> 
> We have a number of legacy machines that for one reason or another
> have not been puppetised yet, and probably won't be anytime soon, so
> I have a somewhat clever script that, for each of these hosts, uses
> the hiera command like utility to export a few puppet-templated
> documents just as puppet+hiera does for our puppeted server. This
> works very nicely, but involves ~250 hiera lookups per host, which
> at 2 seconds per lookup, is taking more than 8 minutes per host (and
> using near 100% of a CPU core the entire time). As we have ~40 such
> hosts, that's over 5 hours with no concurrency (we do use some
> concurrency, but since each invocation uses near 100% of a CPU core
> each, there's no point running more simultaneous hiera processes
> than the number of CPUs, and even then, we need some reserved for
> other services).
> 
> 
> So, is there some way I can make this export run faster? The bulk of
> the time seems to be spent in initialising the hiera command line
> program, not the actual data lookup (for example, if I fail to
> provide the necessary identity / scope files, it still takes 2
> seconds to get around to returning an error, but if I fail to
> provide a config file, it returns instantaneously with error). So,
> I'd either like to make the program load / initialise much faster,
> or be able to query multiple values for a single hiera command line
> invocation.
> 
> 
> Also, is there a more recent version of hiera that would be faster?
> (I'm a little unclear about hiera versioning - we're running 0.3.0,
> but I don't know if that's recent or old).
> 
> 
> Any suggestions / tips would be greatly appreciated :)
> 
> 
> Thanks.
> 
> 
> Paul.
> 
> --
> 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/-/YTZZ7FOshJkJ .
> 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.
> 

-- 
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] Error 400 on SERVER: Could not parse for environment production: Syntax error at '{'; expected '}'

2012-08-14 Thread Jen Patrick
It's barfing on this:
 Error 400 on SERVER: Could not parse for environment production: Syntax 
error at '{'; expected '}'

Here's the node.pp

node "ccc.unix.ccc.ccc.edu" {
  class {
 "web_server":
  net_static   => {
"eth0" => {
  "macaddress" => $macaddress_eth0,
  "ipaddress"  => "192.168.185.228",
  "netmask"=> "2255.255.255.128",
  "gateway"=> "192.168.185.129",
}
  },

  environment   => "production",
  unattended_update => true,
  nfs   => false,
  proxy => false,
  apachessl => false,
  admins=> ["void", "Null"];
  }

  apache::vhost {
$fqdn:
  priority => '20',
  port => '80',
  docroot  => '/var/www',
  }



# open firewall from vpn
  firewall {
"044 allow SSH from 192.168.10.0/23":
  action => "accept",
  proto  => "tcp",
  dport  => "22",
  source => '192.168.10.0/23';
  }
}

-- 
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/-/4wBjWB34Di8J.
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] How to subscribe to an exported resource?

2012-08-14 Thread Marc Haber
Hi,

I am trying to build (on node A) an authorized_keys file that contains
all host keys from all nodes that have class C imported. Here is my
code:

class C {
@@file { "/var/lib/foo/authorized_keys/$fqdn":
ensure => present,
content => "from=\"$ipaddress_eth0\" ssh-rsa $sshrsakey\n",
tag => "foo",
}
}

node A {
class { 'bar': }
}

class bar {
File <<| tag == 'foo' |>> {
notify => Exec["/home/bar/.ssh/authorized_keys"],
}

exec { "/home/bar/.ssh/authorized_keys":
command => "cat /var/lib/foo/authorized_keys/* > 
/home/bar/.ssh/authorized_keys"
path => "/bin:/usr/bin",
provider => shell,
}
}

This works.

I would, however, prefer to have the exec subscribed to the File
instead of notifying the exec from the File. I would like to write

class bar {
File <<| tag == 'foo' |>>

exec { "/home/bar/.ssh/authorized_keys":
command => "cat /var/lib/foo/authorized_keys/* > 
/home/bar/.ssh/authorized_keys"
path => "/bin:/usr/bin",
provider => shell,
subscribe => File <<| tag == 'foo' |>>,
}
}

which doesn't compile.

How can I refer to the File in my exec?


That being said, is there a way to do things more elegantly? I
understand that I need to create one file by node of class C, or is
there a way to have the exported resources all concatenated into the
same file?

Any hints will be appreciated.

Greetings
Marc

-- 
-
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."Winona Ryder | Fon: *49 621 31958061
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 31958062

-- 
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] Is there a way to configure Puppet Dashboard to use server time (rather than client time) for the "latest report" field?

2012-08-14 Thread Zac Bentley
We run puppet on lots of development test machines (CentOS VMs). It is standard 
practice for our developers to change the system date on their environments, 
sometimes by months or years (note that I didn't say it's a *good* standard 
practice, but it is pretty entrenched). As a result, it is somewhat difficult 
to determine when a client last ran Puppet by viewing its node entry in the 
Dashboard. Is there any way that the Dashboard can be configured to derive the 
"Latest Report" field from the time *on the Dashboard server* when a client 
phoned in, rather than the time according to the client?

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/-/KujdKsxT3LkJ.
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] Error 400 on SERVER: Could not parse for environment production: Syntax error at '{'; expected '}'

2012-08-14 Thread Justin Stoller
On Tue, Aug 14, 2012 at 7:49 AM, Jen Patrick  wrote:
> It's barfing on this:

Is this in relation to a previous thread?

>  Error 400 on SERVER: Could not parse for environment production: Syntax
> error at '{'; expected '}'

is there a line number?

>
> Here's the node.pp

Does this work?

>
> node "ccc.unix.ccc.ccc.edu" {
>   class {
$static = {
 "eth0" => {
   "macaddress" => $macaddress_eth0,
   "ipaddress"  => "192.168.185.228",
   "netmask"=> "2255.255.255.128",
   "gateway"=> "192.168.185.129",
 }
   }

>  "web_server":
   net_static   => $static,
>#   net_static   => {
># "eth0" => {
>#   "macaddress" => $macaddress_eth0,
>#   "ipaddress"  => "192.168.185.228",
>#   "netmask"=> "2255.255.255.128",
>#   "gateway"=> "192.168.185.129",
># }
>#   },
>
>   environment   => "production",
>   unattended_update => true,
>   nfs   => false,
>   proxy => false,
>   apachessl => false,
>   admins=> ["void", "Null"];
>   }
>
>   apache::vhost {
> $fqdn:
>   priority => '20',
>   port => '80',
>   docroot  => '/var/www',
>   }
>
>
>
> # open firewall from vpn
>   firewall {
> "044 allow SSH from 192.168.10.0/23":
>   action => "accept",
>   proto  => "tcp",
>   dport  => "22",
>   source => '192.168.10.0/23';
>   }
> }
>
> --
> 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/-/4wBjWB34Di8J.
> 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.

-- 
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] Puppet for deploying Jboss application

2012-08-14 Thread Rost
Hi All,

I would like to use puppet for deploying Jboss application.

The property file of my Jboss app need to be evaluated before moving in the 
conf dir as it's a template.

How could I make this kind of operation with native resources of puppet.


*Example :*

I have this file *myapp.properties.tmpl* :

ApplicationName=${MY_APP_NAME}
ApplicationVersion=${MY_APP_VERSION}
...


And I have the file *global.properties* :

${MY_APP_NAME}=helloworld
${MY_APP_VERSION}=1.0.0


I would like to replace variables in myapp.properties.tmpl with the right 
value in global.properties and generate the new file *myapp.properties* with

ApplicationName=helloworld
ApplicationVersion=1.0.0

Is that possible, may be with tools like Augeas?

Suggestions 
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/-/gwkHUwM26QYJ.
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] Announcing stdlib 2.4.0

2012-08-14 Thread Jeff McCune
Hello,

We're pleased to announce the release of the stdlib module at version
2.4.0 [1].  This feature release is fully backwards compatible with
all previous releases of the stdlib module since version 2.0.0 and is
tested to work with Puppet 2.6 and 2.7.  The stdlib module follows
semver.org guidelines for version numbers.

[1] http://links.puppetlabs.com/stdlib240

The module may be installed from the Forge using the puppet-module tool:

puppet-module install stdlib

This feature release contains the following new features since version 2.3.3

2012-06-07 - Chris Price  - 2.4.0
 * Add support for a 'match' parameter to file_line (a06c0d8)

2012-08-07 - Erik Dalén  - 2.4.0
 * (#15872) Add to_bytes function (247b69c)

2012-07-19 - Jeff McCune  - 2.4.0
 * (Maint) use PuppetlabsSpec::PuppetInternals.scope (master) (deafe88)

2012-07-10 - Hailee Kenney  - 2.4.0
 * (#2157) Make facts_dot_d compatible with external facts (5fb0ddc)

2012-03-16 - Steve Traylen  - 2.4.0
 * (#13205) Rotate array/string randomley based on fqdn, fqdn_rotate()
(fef247b)

Cheers,
-Jeff McCune

-- 
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.



Re: [Puppet Users] variable scoping?

2012-08-14 Thread Chad Huneycutt
On Tue, Aug 14, 2012 at 11:56 AM, Zachary Alex Stern
 wrote:
>
> FWIW, this works:
>
>  class puppet::config {
>
>   include puppet::params
>   $puppetserver=$puppet::params::puppetserver
>   $runinterval=$puppet::params::runinterval
>   file { '/etc/puppet/puppet.conf':
> ensure  => present,
> content => template('puppet/puppet.conf.erb'),
> require => Class['puppet::install'],
> notify  => Class['puppet::service'],
> }
> }

So what if you would like to use a different puppet server?  You have
to go in to the module and change the params.pp file?  The code Nan
suggested allows you to override the value if necessary at the point
of inclusion, but fall back to a sane default specified in params.pp.
Personally, I am loving hiera, which provides even more flexibility:

class foo ( $bar = hiera('bar') ) {
...
}

And then $bar can be defined in a module-local class (if using puppet
hiera backend), module-local yaml file, site-specific yaml file,
overridden when included, etc, all according to a policy that you
define.

-- 
Chad M. Huneycutt

-- 
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.



Re: [Puppet Users] variable scoping?

2012-08-14 Thread Zachary Stern
That's a fair point, but not applicable to my use-case (multiple puppet
servers).

However, at some point in the near future, I'll be using hiera, and that
will be moot.

On Tue, Aug 14, 2012 at 1:44 PM, Chad Huneycutt wrote:

> On Tue, Aug 14, 2012 at 11:56 AM, Zachary Alex Stern
>  wrote:
> >
> > FWIW, this works:
> >
> >  class puppet::config {
> >
> >   include puppet::params
> >   $puppetserver=$puppet::params::puppetserver
> >   $runinterval=$puppet::params::runinterval
> >   file { '/etc/puppet/puppet.conf':
> > ensure  => present,
> > content => template('puppet/puppet.conf.erb'),
> > require => Class['puppet::install'],
> > notify  => Class['puppet::service'],
> > }
> > }
>
> So what if you would like to use a different puppet server?  You have
> to go in to the module and change the params.pp file?  The code Nan
> suggested allows you to override the value if necessary at the point
> of inclusion, but fall back to a sane default specified in params.pp.
> Personally, I am loving hiera, which provides even more flexibility:
>
> class foo ( $bar = hiera('bar') ) {
> ...
> }
>
> And then $bar can be defined in a module-local class (if using puppet
> hiera backend), module-local yaml file, site-specific yaml file,
> overridden when included, etc, all according to a policy that you
> define.
>
> --
> Chad M. Huneycutt
>
> --
> 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.
>
>


-- 

zachary alex stern I systems architect

o: 212.731.2033 | f: 212.202.6488 | z...@enternewmedia.com

60-62 e. 11th street, 4th floor | new york, ny | 10003

www.enternewmedia.com

-- 
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] Announce: Hiera-Puppet 1.0.0rc3 Available

2012-08-14 Thread Matthaus Litteken
Hiera-Puppet 1.0.0rc3 is a feature release candidate. Hiera-Puppet is
the Puppet backend for Hiera and contains the parser functions for
Puppet.

Downloads are available:
 * Source http://puppetlabs.com/downloads/hiera/hiera-puppet-1.0.0rc3.tar.gz
 * Apt and yum development repositories
 * Apple package http://puppetlabs.com/downloads/mac/hiera-puppet-1.0.0rc3.dmg
 * Prerelease gem:
https://rubygems.org/downloads/hiera-puppet-1.0.0rc3.gem or `gem
install hiera-puppet --pre`

It includes contributions from the following people:
Jeff McCune, Matthaus Litteken, Will Hopper

See the Verifying Puppet Download section at:
 
http://projects.puppetlabs.com/projects/puppet/wiki/Downloading_Puppet#Verifying+Puppet+Downloads

Please report feedback via the Puppet Labs Redmine site, using an
affected version of 1.0.0rc3:
 http://projects.puppetlabs.com/projects/hiera-puppet

## Hiera-Puppet 1.0.0rc3 Release Notes ##

(#15570, #15918) Error: Could not run: no such file to load -- hiera_puppet

Previously lib/hiera_puppet.rb was not installed on redhat or
debian packages.
This commit addresses that by adding the file to the spec/rules file
accordingly.

## Hiera-Puppet 1.0.0rc3 Changelog ##

Jeff McCune (1):
  84b4d11 (Maint) Rename PuppetlabsSpec::Puppet{Seams,Internals}

Matthaus Litteken (2):
  0fbdd62 (#15291) Add Vendor tag to Hiera-Puppet spec file
  fd3fe17 Add hiera_puppet.rb to debian, redhat packages, fix gem
version dependency

Will Hopper (1):
  5e516ee Update Debian packaging rake task to correctly create
the orig.tar.gz

-- 
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.



Re: [Puppet Users] How to subscribe to an exported resource?

2012-08-14 Thread Stephen Gran
Hi,

On Tue, 2012-08-14 at 13:27 +0200, Marc Haber wrote:
> Hi,
> 
> I am trying to build (on node A) an authorized_keys file that contains
> all host keys from all nodes that have class C imported. Here is my
> code:

...

> That being said, is there a way to do things more elegantly? I
> understand that I need to create one file by node of class C, or is
> there a way to have the exported resources all concatenated into the
> same file?

The classic is:
https://github.com/ripienaar/puppet-concat

Cheers,
-- 
Stephen Gran
Senior Systems Integrator - guardian.co.uk

Please consider the environment before printing this email.
--
Visit guardian.co.uk - newspaper of the year

www.guardian.co.ukwww.observer.co.uk www.guardiannews.com 

On your mobile, visit m.guardian.co.uk or download the Guardian
iPhone app www.guardian.co.uk/iphone and iPad edition www.guardian.co.uk/iPad 
 
Save up to 37% by subscribing to the Guardian and Observer - choose the papers 
you want and get full digital access. 
Visit guardian.co.uk/subscribe 

-
This e-mail and all attachments are confidential and may also
be privileged. If you are not the named recipient, please notify
the sender and delete the e-mail and all attachments immediately.
Do not disclose the contents to another person. You may not use
the information for any purpose, or store, or copy, it in any way.
 
Guardian News & Media Limited is not liable for any computer
viruses or other material transmitted with or as part of this
e-mail. You should employ virus checking software.

Guardian News & Media Limited

A member of Guardian Media Group plc
Registered Office
PO Box 68164
Kings Place
90 York Way
London
N1P 2AP

Registered in England Number 908396

-- 
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] Testing Hiera Lookup with Puppet Master

2012-08-14 Thread Mitchell Hashimoto
Hello,

Is there an easy way to test hiera lookup for a node? A node is not getting
the value I expect from Hiera and I want a way to test this.

I noticed that `hiera` has an option called `-i` to use the Puppet
inventory service. With the latest (RC4 I believe) of Hiera I'm getting the
following when I try to use that though:

Puppet inventory service lookup failed: NoMethodError: undefined method
`parse' for #
Could not load Puppet inventory service scope: SystemExit: exit

Therefore it is not working.

Any other way?

Best,
Mitchell

-- 
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] Re: Configuring hosts with data from other hosts

2012-08-14 Thread Sam

what is the right way to handle this?

On Tuesday, May 12, 2009 7:51:31 AM UTC+1, stever...@gmail.com wrote:
>
> So I want to use facts from one host in the configuration of other 
> hosts. 
> Trivial example: setting restrict lines in ntp.conf to allow a 
> monitoring host to query ntpd on remote hosts. 
>
> So if the monitoring host boots with IP 10.2.2.3 (which may change 
> regularly), and it knows its the monitor host (via some customer 
> facter plugins), I want some global variable to be available 
> ($monitor_host_ipaddress, type of thing) which could be used in 
> tempaltes etc for all other hosts. 
>
> Exported resources seems close to what I want, but I dont want to 
> export a file, and copy it to other machines. I want to use 
> variables. 
>
> Or do I have to copy the IP address of the monitor host to each 
> machine, via an exported resource file, and then process it locally in 
> an exec script to build the correct ntp.conf? 
> That doesn't seem very puppet-ish... 
>
> Help? 
> T.I.A. 
>
>

-- 
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/-/8JqLcWgVaYUJ.
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] Testing Hiera Lookup with Puppet Master

2012-08-14 Thread R.I.Pienaar


- Original Message -
> From: "Mitchell Hashimoto" 
> To: puppet-users@googlegroups.com
> Sent: Tuesday, August 14, 2012 12:13:19 PM
> Subject: [Puppet Users] Testing Hiera Lookup with Puppet Master
> 
> Hello,
> 
> 
> Is there an easy way to test hiera lookup for a node? A node is not
> getting the value I expect from Hiera and I want a way to test this.

It depends on what backends you use, the CLI cannot get access to the
data inside the puppet backend for example but for JSON/YAML it shouldd
work

My install lags a bit in versions and I do not have the inventory 
service so its hard to say whats up with that, but given a /etc/hiera.yaml
that points to the right hiera db dir for json files I can do:

$ hiera key fact=val fact=val fact=val

the key being what you want and the kv pairs being the scope it will
pass through the hierarchy

you can also set your master to debug logging and you'll see it log every
lookup and what its trying

-- 
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.



Re: [Puppet Users] Testing Hiera Lookup with Puppet Master

2012-08-14 Thread Mitchell Hashimoto


On Tuesday, August 14, 2012 12:34:45 PM UTC-7, R.I. Pienaar wrote:
>
>
>
> - Original Message - 
> > From: "Mitchell Hashimoto" > 
> > To: puppet...@googlegroups.com  
> > Sent: Tuesday, August 14, 2012 12:13:19 PM 
> > Subject: [Puppet Users] Testing Hiera Lookup with Puppet Master 
> > 
> > Hello, 
> > 
> > 
> > Is there an easy way to test hiera lookup for a node? A node is not 
> > getting the value I expect from Hiera and I want a way to test this. 
>
> It depends on what backends you use, the CLI cannot get access to the 
> data inside the puppet backend for example but for JSON/YAML it shouldd 
> work 
>
> My install lags a bit in versions and I do not have the inventory 
> service so its hard to say whats up with that, but given a /etc/hiera.yaml 
> that points to the right hiera db dir for json files I can do: 
>
> $ hiera key fact=val fact=val fact=val 
>
> the key being what you want and the kv pairs being the scope it will 
> pass through the hierarchy 
>
> you can also set your master to debug logging and you'll see it log every 
> lookup and what its trying 
>

Thanks, I think I'll go with the debug logging route for now. Is there a 
way in the "puppet.conf" file to enable debug logging?

Best,
Mitchell
 

-- 
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/-/JD0RUZ8zq-sJ.
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 for deploying Jboss application

2012-08-14 Thread Dominic Cleal
On 14/08/12 18:18, Rost wrote:
> Hi All,
> 
> I would like to use puppet for deploying Jboss application.
> 
> The property file of my Jboss app need to be evaluated before moving in
> the conf dir as it's a template.
> 
> How could I make this kind of operation with native resources of puppet.
> 
> 
> *Example :*
> 
> I have this file *myapp.properties.tmpl* :
> 
> ApplicationName=${MY_APP_NAME}
> ApplicationVersion=${MY_APP_VERSION}
> ...
> 
> 
> And I have the file *global.properties* :
> 
> ${MY_APP_NAME}=helloworld
> ${MY_APP_VERSION}=1.0.0

This here feels like you're not solving the actual problem, but working
around a bug elsewhere in your design.

> I would like to replace variables in myapp.properties.tmpl with the
> right value in global.properties and generate the new file
> *myapp.properties* with
> 
> ApplicationName=helloworld
> ApplicationVersion=1.0.0
> 
> Is that possible, may be with tools like Augeas?

The first thing you need is to get the data ("helloworld", "1.0.0") into
Puppet.  Ideally via an ENC or hiera or similar.

If it only exists on the filesystem of the host at the start of a run
and you really must, you could use a fact, but you're going into weird
territory as your system build will then depend on the existing state of
the system.  Definitely an anti-pattern here, but possible.

You can use Augeas in facts, but only the properties lens as it exists
in master (rather than the 0.9.0 release) can parse that
global.properties file.  Something like this:

http://pastie.org/4475806
http://projects.puppetlabs.com/projects/facter/wiki/Facter_Augeas

Or do something similar in Ruby to pull the value out of the file on the
host and present it in a fact.

Once you have the value in Puppet, then creating or editing
myapp.properties with Augeas is trivial, or use a template:

augeas { "myapp.properties":
  lens=> "Properties.lns",
  incl=> "/path/to/myapp.properties",
  changes => [
"set ApplicationName ${appname}",
"set ApplicationVersion ${appversion}",
  ],
}

(Where $appname and $appversion are Puppet variables, facts or a proper
data source.)

Cheers,

-- 
Dominic Cleal
Red Hat Consulting
m: +44 (0)7817 878113

-- 
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] Puppetlabs lvm module

2012-08-14 Thread Douglas Garstang
I just grabbed the puppet labs lvm module from Puppet forge.

Attempting to use...

physical_volume {
['/dev/xvdb1', '/dev/xvdc1']:
ensure => present;
}

results in:

err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Syntax error at ':'; expected '}' at
/truth/sauce/env/prod/modules/lvm/manifests/init.pp:29 on node
testweb10.us1.xxx.com

Line 29 of init.pp is:

#
# Just clean up the logical volume
#
absent: {
  logical_volume { $name: ensure => absent, volume_group => $vg,
size => $size }
}

I don't get it what am I missing

Doug.

-- 
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.



Re: [Puppet Users] Puppetlabs lvm module

2012-08-14 Thread Eric Shamow
Everything else aside, you have a semicolon after ensure => present instead of 
a comma in your physical_volume resource. I'm not certain that it's causing the 
problem but it might be confusing the parser.

-Eric 

-- 

Eric Shamow
Professional Services
http://puppetlabs.com/
(c)631.871.6441

Join us for PuppetConf 2012 at the Mission Bay Convention Center in San 
Francisco, California on September 27th and 28th --> http://bit.ly/pcsig12  


On Tuesday, August 14, 2012 at 4:39 PM, Douglas Garstang wrote:

> I just grabbed the puppet labs lvm module from Puppet forge.
> 
> Attempting to use...
> 
> physical_volume {
> ['/dev/xvdb1', '/dev/xvdc1']:
> ensure => present;
> }
> 
> results in:
> 
> err: Could not retrieve catalog from remote server: Error 400 on
> SERVER: Syntax error at ':'; expected '}' at
> /truth/sauce/env/prod/modules/lvm/manifests/init.pp:29 on node
> testweb10.us1.xxx.com (http://testweb10.us1.xxx.com)
> 
> Line 29 of init.pp is:
> 
> #
> # Just clean up the logical volume
> #
> absent: {
> logical_volume { $name: ensure => absent, volume_group => $vg,
> size => $size }
> }
> 
> I don't get it what am I missing
> 
> Doug.
> 
> -- 
> 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 
> (mailto:puppet-users@googlegroups.com).
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com 
> (mailto:puppet-users+unsubscr...@googlegroups.com).
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.



-- 
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.



Re: [Puppet Users] Puppetlabs lvm module

2012-08-14 Thread Douglas Garstang
I've always used semicolons at the end of resources never caused a
problem before, and puppet-lint doesn't complain about them.

On Tue, Aug 14, 2012 at 1:42 PM, Eric Shamow  wrote:
> Everything else aside, you have a semicolon after ensure => present instead 
> of a comma in your physical_volume resource. I'm not certain that it's 
> causing the problem but it might be confusing the parser.
>
> -Eric
>
> --
>
> Eric Shamow
> Professional Services
> http://puppetlabs.com/
> (c)631.871.6441
>
> Join us for PuppetConf 2012 at the Mission Bay Convention Center in San 
> Francisco, California on September 27th and 28th --> http://bit.ly/pcsig12
>
>
> On Tuesday, August 14, 2012 at 4:39 PM, Douglas Garstang wrote:
>
>> I just grabbed the puppet labs lvm module from Puppet forge.
>>
>> Attempting to use...
>>
>> physical_volume {
>> ['/dev/xvdb1', '/dev/xvdc1']:
>> ensure => present;
>> }
>>
>> results in:
>>
>> err: Could not retrieve catalog from remote server: Error 400 on
>> SERVER: Syntax error at ':'; expected '}' at
>> /truth/sauce/env/prod/modules/lvm/manifests/init.pp:29 on node
>> testweb10.us1.xxx.com (http://testweb10.us1.xxx.com)
>>
>> Line 29 of init.pp is:
>>
>> #
>> # Just clean up the logical volume
>> #
>> absent: {
>> logical_volume { $name: ensure => absent, volume_group => $vg,
>> size => $size }
>> }
>>
>> I don't get it what am I missing
>>
>> Doug.
>>
>> --
>> 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 
>> (mailto:puppet-users@googlegroups.com).
>> To unsubscribe from this group, send email to 
>> puppet-users+unsubscr...@googlegroups.com 
>> (mailto:puppet-users+unsubscr...@googlegroups.com).
>> For more options, visit this group at 
>> http://groups.google.com/group/puppet-users?hl=en.
>
>
>
> --
> 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.
>



-- 
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garst...@gmail.com
Cell: +1-805-340-5627

-- 
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.



Re: [Puppet Users] Puppetlabs lvm module

2012-08-14 Thread Eric Shamow
Oh right - for the code compression syntax…I don't use it and so I tend to 
forget it exists. Sorry about that.

Is line 29 specifically this?

absent: {

It would be helpful to see in context with line numbers, such as in a gist.

-Eric  

--  

Eric Shamow
Professional Services
http://puppetlabs.com/
(c)631.871.6441

Join us for PuppetConf 2012 at the Mission Bay Convention Center in San 
Francisco, California on September 27th and 28th --> http://bit.ly/pcsig12   


On Tuesday, August 14, 2012 at 4:43 PM, Douglas Garstang wrote:

> I've always used semicolons at the end of resources never caused a
> problem before, and puppet-lint doesn't complain about them.
>  
> On Tue, Aug 14, 2012 at 1:42 PM, Eric Shamow  (mailto:e...@puppetlabs.com)> wrote:
> > Everything else aside, you have a semicolon after ensure => present instead 
> > of a comma in your physical_volume resource. I'm not certain that it's 
> > causing the problem but it might be confusing the parser.
> >  
> > -Eric
> >  
> > --
> >  
> > Eric Shamow
> > Professional Services
> > http://puppetlabs.com/
> > (c)631.871.6441
> >  
> > Join us for PuppetConf 2012 at the Mission Bay Convention Center in San 
> > Francisco, California on September 27th and 28th --> http://bit.ly/pcsig12
> >  
> >  
> > On Tuesday, August 14, 2012 at 4:39 PM, Douglas Garstang wrote:
> >  
> > > I just grabbed the puppet labs lvm module from Puppet forge.
> > >  
> > > Attempting to use...
> > >  
> > > physical_volume {
> > > ['/dev/xvdb1', '/dev/xvdc1']:
> > > ensure => present;
> > > }
> > >  
> > > results in:
> > >  
> > > err: Could not retrieve catalog from remote server: Error 400 on
> > > SERVER: Syntax error at ':'; expected '}' at
> > > /truth/sauce/env/prod/modules/lvm/manifests/init.pp:29 on node
> > > testweb10.us1.xxx.com (http://testweb10.us1.xxx.com)
> > >  
> > > Line 29 of init.pp is:
> > >  
> > > #
> > > # Just clean up the logical volume
> > > #
> > > absent: {
> > > logical_volume { $name: ensure => absent, volume_group => $vg,
> > > size => $size }
> > > }
> > >  
> > > I don't get it what am I missing
> > >  
> > > Doug.
> > >  
> > > --
> > > 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 
> > > (mailto:puppet-users@googlegroups.com).
> > > To unsubscribe from this group, send email to 
> > > puppet-users+unsubscr...@googlegroups.com 
> > > (mailto:puppet-users+unsubscr...@googlegroups.com).
> > > For more options, visit this group at 
> > > http://groups.google.com/group/puppet-users?hl=en.
> >  
> >  
> >  
> >  
> >  
> > --
> > 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 
> > (mailto:puppet-users@googlegroups.com).
> > To unsubscribe from this group, send email to 
> > puppet-users+unsubscr...@googlegroups.com 
> > (mailto:puppet-users+unsubscr...@googlegroups.com).
> > For more options, visit this group at 
> > http://groups.google.com/group/puppet-users?hl=en.
>  
>  
>  
>  
>  
> --  
> Regards,
>  
> Douglas Garstang
> http://www.linkedin.com/in/garstang
> Email: doug.garst...@gmail.com (mailto:doug.garst...@gmail.com)
> Cell: +1-805-340-5627
>  
> --  
> 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 
> (mailto:puppet-users@googlegroups.com).
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com 
> (mailto:puppet-users+unsubscr...@googlegroups.com).
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.



-- 
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.



Re: [Puppet Users] Puppetlabs lvm module

2012-08-14 Thread Douglas Garstang
Eric,

Yes... that's specifically line 29.

19logical_volume { $name:
20  ensure => present,
21  volume_group => $vg,
22  size => $size,
23  before => Volume_group[$vg]
24}
25  }
26  #
27  # Just clean up the logical volume
28  #
29  absent: {
30logical_volume { $name: ensure => absent, volume_group =>
$vg, size => $size }
31  }
32  #
33  # Create the whole chain.
34  #

code compression syntax not familiar with that...

Doug.

On Tue, Aug 14, 2012 at 1:45 PM, Eric Shamow  wrote:
> Oh right - for the code compression syntax…I don't use it and so I tend to 
> forget it exists. Sorry about that.
>
> Is line 29 specifically this?
>
> absent: {
>
> It would be helpful to see in context with line numbers, such as in a gist.
>
> -Eric
>
> --
>
> Eric Shamow
> Professional Services
> http://puppetlabs.com/
> (c)631.871.6441
>
> Join us for PuppetConf 2012 at the Mission Bay Convention Center in San 
> Francisco, California on September 27th and 28th --> http://bit.ly/pcsig12
>
>
> On Tuesday, August 14, 2012 at 4:43 PM, Douglas Garstang wrote:
>
>> I've always used semicolons at the end of resources never caused a
>> problem before, and puppet-lint doesn't complain about them.
>>
>> On Tue, Aug 14, 2012 at 1:42 PM, Eric Shamow > (mailto:e...@puppetlabs.com)> wrote:
>> > Everything else aside, you have a semicolon after ensure => present 
>> > instead of a comma in your physical_volume resource. I'm not certain that 
>> > it's causing the problem but it might be confusing the parser.
>> >
>> > -Eric
>> >
>> > --
>> >
>> > Eric Shamow
>> > Professional Services
>> > http://puppetlabs.com/
>> > (c)631.871.6441
>> >
>> > Join us for PuppetConf 2012 at the Mission Bay Convention Center in San 
>> > Francisco, California on September 27th and 28th --> http://bit.ly/pcsig12
>> >
>> >
>> > On Tuesday, August 14, 2012 at 4:39 PM, Douglas Garstang wrote:
>> >
>> > > I just grabbed the puppet labs lvm module from Puppet forge.
>> > >
>> > > Attempting to use...
>> > >
>> > > physical_volume {
>> > > ['/dev/xvdb1', '/dev/xvdc1']:
>> > > ensure => present;
>> > > }
>> > >
>> > > results in:
>> > >
>> > > err: Could not retrieve catalog from remote server: Error 400 on
>> > > SERVER: Syntax error at ':'; expected '}' at
>> > > /truth/sauce/env/prod/modules/lvm/manifests/init.pp:29 on node
>> > > testweb10.us1.xxx.com (http://testweb10.us1.xxx.com)
>> > >
>> > > Line 29 of init.pp is:
>> > >
>> > > #
>> > > # Just clean up the logical volume
>> > > #
>> > > absent: {
>> > > logical_volume { $name: ensure => absent, volume_group => $vg,
>> > > size => $size }
>> > > }
>> > >
>> > > I don't get it what am I missing
>> > >
>> > > Doug.
>> > >
>> > > --
>> > > 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 
>> > > (mailto:puppet-users@googlegroups.com).
>> > > To unsubscribe from this group, send email to 
>> > > puppet-users+unsubscr...@googlegroups.com 
>> > > (mailto:puppet-users+unsubscr...@googlegroups.com).
>> > > For more options, visit this group at 
>> > > http://groups.google.com/group/puppet-users?hl=en.
>> >
>> >
>> >
>> >
>> >
>> > --
>> > 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 
>> > (mailto:puppet-users@googlegroups.com).
>> > To unsubscribe from this group, send email to 
>> > puppet-users+unsubscr...@googlegroups.com 
>> > (mailto:puppet-users+unsubscr...@googlegroups.com).
>> > For more options, visit this group at 
>> > http://groups.google.com/group/puppet-users?hl=en.
>>
>>
>>
>>
>>
>> --
>> Regards,
>>
>> Douglas Garstang
>> http://www.linkedin.com/in/garstang
>> Email: doug.garst...@gmail.com (mailto:doug.garst...@gmail.com)
>> Cell: +1-805-340-5627
>>
>> --
>> 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 
>> (mailto:puppet-users@googlegroups.com).
>> To unsubscribe from this group, send email to 
>> puppet-users+unsubscr...@googlegroups.com 
>> (mailto:puppet-users+unsubscr...@googlegroups.com).
>> For more options, visit this group at 
>> http://groups.google.com/group/puppet-users?hl=en.
>
>
>
> --
> 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.
>



-- 
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garst...@gmail.com
Cel

[Puppet Users] Re: Announcing stdlib 2.4.0

2012-08-14 Thread Jeff McCune
On Tue, Aug 14, 2012 at 10:30 AM, Jeff McCune  wrote:

> Hello,
>
> We're pleased to announce the release of the stdlib module at version
> 2.4.0 [1].  This feature release is fully backwards compatible with
> all previous releases of the stdlib module since version 2.0.0 and is
> tested to work with Puppet 2.6 and 2.7.  The stdlib module follows
> semver.org guidelines for version numbers.
>
> [1] http://links.puppetlabs.com/stdlib240
>
> The module may be installed from the Forge using the puppet-module tool:
>
> puppet-module install stdlib


I have to stop copying and pasting that old announcement.

It's puppet module install puppetlabs-stdlib if you're using recent Puppet
2.7 versions or puppet-module install puppetlabs-stdlib if you're using the
puppet-module Gem.

-Jeff

-- 
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.



Re: [Puppet Users] Best practice for Node Def files

2012-08-14 Thread Jeff McCune
On Mon, Aug 13, 2012 at 12:36 PM, llowder  wrote:

> If using the nodes/*.pp and having your site.pp be "import 'nodes/*'",
>

You should avoid using the import statement (see
http://projects.puppetlabs.com/issues/12929).  Instead, follow the [module
conventions](docs.puppetlabs.com/guides/modules.html)


> what is the best practice? Is it better to have one node def per file, or
> group the node defs by class (ie, all app servers in one file or all web
> servers in one file) or some other layout?
>

Best practice is to use an external node classifier or place all of your
node declarations into one site.pp file.  One file is preferable because
one-file-per-node scales poorly to tens of thousands of nodes as Puppet
will read tens of thousands of files every time a catalog is compiled.


> Also, is there a way to have the node defs broken out without having to
> use import 'node/*' ? Or would that be to just list each one out by name?
>

You could use a single default node and selectively include classes using
conditional logic.  Or use an external node classifier.

-Jeff

-- 
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.



Re: [Puppet Users] Puppetlabs lvm module

2012-08-14 Thread Ryan Coleman
Well that's embarrassing. It seems as those the 'cleaned' match of the
case statement isn't actually closed. :-/

Would you try adding a closing brace in lvm/manifests/init.pp around
like 26, where this code appears? It should close the 'cleaned: {'
block.

}
  #
  # Just clean up the logical volume
  #

Let us know if that was the culprit. We'll get that fixed and into a
release. I apologize for the inconvenience -- this is our bad.

On Tue, Aug 14, 2012 at 1:48 PM, Douglas Garstang
 wrote:
> Eric,
>
> Yes... that's specifically line 29.
>
> 19logical_volume { $name:
> 20  ensure => present,
> 21  volume_group => $vg,
> 22  size => $size,
> 23  before => Volume_group[$vg]
> 24}
> 25  }
> 26  #
> 27  # Just clean up the logical volume
> 28  #
> 29  absent: {
> 30logical_volume { $name: ensure => absent, volume_group =>
> $vg, size => $size }
> 31  }
> 32  #
> 33  # Create the whole chain.
> 34  #
>
> code compression syntax not familiar with that...
>
> Doug.
>
> On Tue, Aug 14, 2012 at 1:45 PM, Eric Shamow  wrote:
>> Oh right - for the code compression syntax…I don't use it and so I tend to 
>> forget it exists. Sorry about that.
>>
>> Is line 29 specifically this?
>>
>> absent: {
>>
>> It would be helpful to see in context with line numbers, such as in a gist.
>>
>> -Eric
>>
>> --
>>
>> Eric Shamow
>> Professional Services
>> http://puppetlabs.com/
>> (c)631.871.6441
>>
>> Join us for PuppetConf 2012 at the Mission Bay Convention Center in San 
>> Francisco, California on September 27th and 28th --> http://bit.ly/pcsig12
>>
>>
>> On Tuesday, August 14, 2012 at 4:43 PM, Douglas Garstang wrote:
>>
>>> I've always used semicolons at the end of resources never caused a
>>> problem before, and puppet-lint doesn't complain about them.
>>>
>>> On Tue, Aug 14, 2012 at 1:42 PM, Eric Shamow >> (mailto:e...@puppetlabs.com)> wrote:
>>> > Everything else aside, you have a semicolon after ensure => present 
>>> > instead of a comma in your physical_volume resource. I'm not certain that 
>>> > it's causing the problem but it might be confusing the parser.
>>> >
>>> > -Eric
>>> >
>>> > --
>>> >
>>> > Eric Shamow
>>> > Professional Services
>>> > http://puppetlabs.com/
>>> > (c)631.871.6441
>>> >
>>> > Join us for PuppetConf 2012 at the Mission Bay Convention Center in San 
>>> > Francisco, California on September 27th and 28th --> http://bit.ly/pcsig12
>>> >
>>> >
>>> > On Tuesday, August 14, 2012 at 4:39 PM, Douglas Garstang wrote:
>>> >
>>> > > I just grabbed the puppet labs lvm module from Puppet forge.
>>> > >
>>> > > Attempting to use...
>>> > >
>>> > > physical_volume {
>>> > > ['/dev/xvdb1', '/dev/xvdc1']:
>>> > > ensure => present;
>>> > > }
>>> > >
>>> > > results in:
>>> > >
>>> > > err: Could not retrieve catalog from remote server: Error 400 on
>>> > > SERVER: Syntax error at ':'; expected '}' at
>>> > > /truth/sauce/env/prod/modules/lvm/manifests/init.pp:29 on node
>>> > > testweb10.us1.xxx.com (http://testweb10.us1.xxx.com)
>>> > >
>>> > > Line 29 of init.pp is:
>>> > >
>>> > > #
>>> > > # Just clean up the logical volume
>>> > > #
>>> > > absent: {
>>> > > logical_volume { $name: ensure => absent, volume_group => $vg,
>>> > > size => $size }
>>> > > }
>>> > >
>>> > > I don't get it what am I missing
>>> > >
>>> > > Doug.
>>> > >
>>> > > --
>>> > > 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 
>>> > > (mailto:puppet-users@googlegroups.com).
>>> > > To unsubscribe from this group, send email to 
>>> > > puppet-users+unsubscr...@googlegroups.com 
>>> > > (mailto:puppet-users+unsubscr...@googlegroups.com).
>>> > > For more options, visit this group at 
>>> > > http://groups.google.com/group/puppet-users?hl=en.
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > 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 
>>> > (mailto:puppet-users@googlegroups.com).
>>> > To unsubscribe from this group, send email to 
>>> > puppet-users+unsubscr...@googlegroups.com 
>>> > (mailto:puppet-users+unsubscr...@googlegroups.com).
>>> > For more options, visit this group at 
>>> > http://groups.google.com/group/puppet-users?hl=en.
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Regards,
>>>
>>> Douglas Garstang
>>> http://www.linkedin.com/in/garstang
>>> Email: doug.garst...@gmail.com (mailto:doug.garst...@gmail.com)
>>> Cell: +1-805-340-5627
>>>
>>> --
>>> 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 
>>> (mailto:puppet-users@googlegroups.com).
>>> To unsubscribe from this group, send email to 
>>> p

Re: [Puppet Users] Pass array to a define

2012-08-14 Thread Douglas Garstang
On Sat, Aug 11, 2012 at 7:48 PM, Stefan Schulte
 wrote:
> On Sat, Aug 11, 2012 at 01:46:57PM -0700, James A. Peltier wrote:
>> - Original Message -
>> | On Fri, Aug 10, 2012 at 05:10:20PM -0700, Douglas Garstang wrote:
>> | > How can I pass an array to a define? It's not documented in the
>> | > puppet
>> | > language guide.
>> | >
>> | > I've got:
>> | >
>> | > define lvm::create_vg ( $pvdisks ) {
>> | > exec {
>> | > 'pvcreate':
>> | > command => "/sbin/pvcreate -yf $pvdisks",
>> | > unless  => "/sbin/pvdisplay $pvdisks",
>> | >...
>> | > }
>> | > }
>> | >
>> | > class someclass {
>> | > lvm::create_vg {
>> | > 'bcvg01':
>> | > pvdisks => ['/dev/xvdb1', '/dev/xvdc1'];
>> | > }
>> | > }
>> | >
>> | > Inside the define, $pvdisks gets expanded to '/dev/xvdb1/dev/xvdc1'
>> | >
>> | > Doug.
>> |
>> | Inside your define $pvdisks is whatever you passed as the pvdisks
>> | parameter, so in your case $pvdisks *is* an array. But in the unless
>> | parameter you use the array in a string context so all your items are
>> | concatenated. Unfortunately puppet does not have a join function to
>> | convert an array to a string.
>> |
>> | On the other hand it may not be desired to destroy every disk you
>> | pass
>> | as in the pvdisks array if only one of the disks is not a LVM disk
>> | (as
>> | pvdisplay returns with a non-zero exitcode as soon as one disk is not
>> | recognized to be a LVM disk)
>> |
>> | So the best approach is probably to get the LVM puppet plugin and
>> | replace your exec with
>> |
>> | physical_volume { $pvdisks:
>> |   ensure => present,
>> | }
>> |
>> | The physical_volume is a new type that comes with the LVM plugin.
>> |
>> | [1] http://forge.puppetlabs.com/puppetlabs/lvm
>> |
>> | -Stefan
>>
>> Great!  But what happens if you want to specify multiple physical volumes be 
>> a member of a single data volume during creation.  Is the expectation that 
>> you'd always specify a lvm:vg with the initial disk and then lvm:vg extend 
>> that volume?
>
> Do you mean something like sda1 and sda2 beeing two physical volumes in
> the volume group vg? This should work:
>
>
> physical_volume { [ '/dev/sda1', '/dev/sda2']:
>   ensure => present.
> }
>
> volume_group { 'vg':
>   ensure   => present,
>   physical_volumes => [ '/dev/sda1', '/dev/sda2' ],
>   require  => [
> Physical_volume['/dev/sda1'],
> Physical_volume['/dev/sda2'],
>   ],
> }
>
> -Stefan

Yeah, well I tried the puppet labs lvm module. After I fixed the
syntax errors, which included a missing '}' in the code (wtf!??!), it
seems that custom types don't work with environments...

http://projects.puppetlabs.com/issues/4409

Doug.

-- 
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] Custom Providers and Environmemts.

2012-08-14 Thread Douglas Garstang
I've installed the puppet labs lvm module. After fixing the missing
"}" at line 20 in init.pp (really?!?!), I'm getting this:'

err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError:
Invalid resource type physical_volume at
/truth/sauce/env/prod/modules/role/manifests/common.pp:43 on node
testweb10.us1.xxx.com

Seems related to:
http://projects.puppetlabs.com/issues/4409

I'm using environments. Is this fixed?

Doug

-- 
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.



Re: [Puppet Users] Puppetlabs lvm module

2012-08-14 Thread Douglas Garstang
On Tue, Aug 14, 2012 at 2:22 PM, Ryan Coleman  wrote:
> Well that's embarrassing. It seems as those the 'cleaned' match of the
> case statement isn't actually closed. :-/
>
> Would you try adding a closing brace in lvm/manifests/init.pp around
> like 26, where this code appears? It should close the 'cleaned: {'
> block.
>
> }
>   #
>   # Just clean up the logical volume
>   #
>
> Let us know if that was the culprit. We'll get that fixed and into a
> release. I apologize for the inconvenience -- this is our bad.

Yep. That was the culprit. Maybe you guys wanna run this through a
'puppet parser validate' before posting them to the forge...?

I'm still borked though because it seems that custom types don't work
with environments.

Doug.

-- 
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.



Re: [Puppet Users] Best practice for Node Def files

2012-08-14 Thread llowder


On Tuesday, August 14, 2012 4:14:47 PM UTC-5, Jeff McCune wrote:
>
> On Mon, Aug 13, 2012 at 12:36 PM, llowder 
> > wrote:
>
>> If using the nodes/*.pp and having your site.pp be "import 'nodes/*'",
>>
>
> You should avoid using the import statement (see 
> http://projects.puppetlabs.com/issues/12929).  Instead, follow the 
> [module conventions](docs.puppetlabs.com/guides/modules.html)
>  
>

I do have all my classes in modules, and the only place I use import is in 
my site.pp
 

> what is the best practice? Is it better to have one node def per file, or 
>> group the node defs by class (ie, all app servers in one file or all web 
>> servers in one file) or some other layout?
>>
>
> Best practice is to use an external node classifier or place all of your 
> node declarations into one site.pp file.  One file is preferable because 
> one-file-per-node scales poorly to tens of thousands of nodes as Puppet 
> will read tens of thousands of files every time a catalog is compiled.
>  
>

I only have a few dozen nodes to manage at present, and in the next while 
that is only likely to grow from 2-3 dozen to 3-4 dozen, so scaling isn't 
something I need to worry about (though it is something I keep in mind just 
in case of unexpected growth). Using all the nodes in site.pp seems like it 
would scale poorly as well, as then you have a single massive file you have 
to search through every time you need to either add a node or update one.

 

> Also, is there a way to have the node defs broken out without having to 
>> use import 'node/*' ? Or would that be to just list each one out by name?
>>
>
> You could use a single default node and selectively include classes using 
> conditional logic.  Or use an external node classifier.
>  
>

At present, the classes in our modules would have to be reworked in order 
to use an ENC, as they do not allow for direct relationship chaining.  That 
sort of refactoring (to make the classes and modules manage their own 
deps)  is on my list of things to do, as is looking at moving to an ENC, 
but it is goingto be a while before I am able to.


 

> -Jeff
>

-- 
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/-/QDrWKv1pfI8J.
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] Puppetlabs lvm module

2012-08-14 Thread Ryan Coleman
On Tue, Aug 14, 2012 at 2:30 PM, Douglas Garstang
 wrote:
> Yep. That was the culprit. Maybe you guys wanna run this through a
> 'puppet parser validate' before posting them to the forge...?

Obviously, our intention is not to release borked code but a mistake was made.

>
> I'm still borked though because it seems that custom types don't work
> with environments.

I see you've got another thread going about this. Thanks for keeping
them logically separate.

-- 
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] Re: Custom Providers and Environmemts.

2012-08-14 Thread Douglas Garstang
On Tue, Aug 14, 2012 at 2:25 PM, Douglas Garstang
 wrote:
> I've installed the puppet labs lvm module. After fixing the missing
> "}" at line 20 in init.pp (really?!?!), I'm getting this:'
>
> err: Could not retrieve catalog from remote server: Error 400 on
> SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError:
> Invalid resource type physical_volume at
> /truth/sauce/env/prod/modules/role/manifests/common.pp:43 on node
> testweb10.us1.xxx.com
>
> Seems related to:
> http://projects.puppetlabs.com/issues/4409
>
> I'm using environments. Is this fixed?
>
> Doug

Jeez, I dunno... the rb files are on the client...

[us1:i-f8350ebe] root@testweb10:/etc/sysctl.d# ls -l
/var/lib/puppet/lib/puppet/type
total 16
-rw-r--r-- 1 root root  531 2012-08-14 20:35 filesystem.rb
-rw-r--r-- 1 root root 1380 2012-08-14 20:35 logical_volume.rb
-rw-r--r-- 1 root root  320 2012-08-14 20:35 physical_volume.rb
-rw-r--r-- 1 root root  458 2012-08-14 20:35 volume_group.rb

Doug

-- 
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.



Re: [Puppet Users] Custom Providers and Environmemts.

2012-08-14 Thread Eric Shamow
Douglas,

Do you intend to use different versions of the type in different environments, 
or are you just concerned with trying to get the same code out everywhere?

According to

http://projects.puppetlabs.com/issues/13858

this is fixed for Telly, and there is a patch available if you want to give it 
a try.

If you don't mind the type being available on the master as well, making it 
available in the modulepath the master uses as a client should resolve the 
issue. The problem is that the master loads new types locally for validation, 
and so needs access to them itself.

-Eric 

-- 

Eric Shamow
Professional Services
http://puppetlabs.com/
(c)631.871.6441

Join us for PuppetConf 2012 at the Mission Bay Convention Center in San 
Francisco, California on September 27th and 28th --> http://bit.ly/pcsig12  


On Tuesday, August 14, 2012 at 5:25 PM, Douglas Garstang wrote:

> I've installed the puppet labs lvm module. After fixing the missing
> "}" at line 20 in init.pp (really?!?!), I'm getting this:'
> 
> err: Could not retrieve catalog from remote server: Error 400 on
> SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError:
> Invalid resource type physical_volume at
> /truth/sauce/env/prod/modules/role/manifests/common.pp:43 on node
> testweb10.us1.xxx.com (http://testweb10.us1.xxx.com)
> 
> Seems related to:
> http://projects.puppetlabs.com/issues/4409
> 
> I'm using environments. Is this fixed?
> 
> Doug
> 
> -- 
> 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 
> (mailto:puppet-users@googlegroups.com).
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com 
> (mailto:puppet-users+unsubscr...@googlegroups.com).
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.



-- 
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.



Re: [Puppet Users] Custom Providers and Environmemts.

2012-08-14 Thread Douglas Garstang
On Tue, Aug 14, 2012 at 2:40 PM, Eric Shamow  wrote:
> Douglas,
>
> Do you intend to use different versions of the type in different 
> environments, or are you just concerned with trying to get the same code out 
> everywhere?
>
> According to
>
> http://projects.puppetlabs.com/issues/13858
>
> this is fixed for Telly, and there is a patch available if you want to give 
> it a try.
>
> If you don't mind the type being available on the master as well, making it 
> available in the modulepath the master uses as a client should resolve the 
> issue. The problem is that the master loads new types locally for validation, 
> and so needs access to them itself.

Eric,

Not sure I follow. Your saying that puppetlabs-lvm-0.1.0/* needs to be
placed in the location set by modulepath on the server?

Doug.

-- 
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.



Re: [Puppet Users] Custom Providers and Environmemts.

2012-08-14 Thread Eric Shamow
Specifically the types need to be in the server's $libdir. You can place them 
there manually, but the way they generally get there is via pluginsync. So the 
easiest way to ensure the master can process them is to place them in the 
module path used by the server *when the server is acting as a puppet agent* 
and run puppet agent on the server.

This will sync the types to the correct directory on the master and enable it 
to parse them when they are used elsewhere.

-Eric 

-- 

Eric Shamow
Professional Services
http://puppetlabs.com/
(c)631.871.6441

Join us for PuppetConf 2012 at the Mission Bay Convention Center in San 
Francisco, California on September 27th and 28th --> http://bit.ly/pcsig12  


On Tuesday, August 14, 2012 at 5:47 PM, Douglas Garstang wrote:

> On Tue, Aug 14, 2012 at 2:40 PM, Eric Shamow  (mailto:e...@puppetlabs.com)> wrote:
> > Douglas,
> > 
> > Do you intend to use different versions of the type in different 
> > environments, or are you just concerned with trying to get the same code 
> > out everywhere?
> > 
> > According to
> > 
> > http://projects.puppetlabs.com/issues/13858
> > 
> > this is fixed for Telly, and there is a patch available if you want to give 
> > it a try.
> > 
> > If you don't mind the type being available on the master as well, making it 
> > available in the modulepath the master uses as a client should resolve the 
> > issue. The problem is that the master loads new types locally for 
> > validation, and so needs access to them itself.
> 
> Eric,
> 
> Not sure I follow. Your saying that puppetlabs-lvm-0.1.0/* needs to be
> placed in the location set by modulepath on the server?
> 
> Doug.
> 
> -- 
> 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 
> (mailto:puppet-users@googlegroups.com).
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com 
> (mailto:puppet-users+unsubscr...@googlegroups.com).
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.



-- 
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.



Re: [Puppet Users] Custom Providers and Environmemts.

2012-08-14 Thread Douglas Garstang
On Tue, Aug 14, 2012 at 2:49 PM, Eric Shamow  wrote:
> Specifically the types need to be in the server's $libdir. You can place them 
> there manually, but the way they generally get there is via pluginsync. So 
> the easiest way to ensure the master can process them is to place them in the 
> module path used by the server *when the server is acting as a puppet agent* 
> and run puppet agent on the server.
>
> This will sync the types to the correct directory on the master and enable it 
> to parse them when they are used elsewhere.
>
> -Eric

Actually, *sigh* something else is wrong, because I used the concat
module earlier, after enabling pluginsync on both master and client,
and it seems to have synced what it needs ok:

[us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib# ls -l
total 8
drwxr-sr-x 2 root root 4096 2012-08-14 18:02 facter
drwxr-sr-x 4 root root 4096 2012-08-14 20:35 puppet
[us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib# cd facter/
[us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib/facter# ls -l
total 4
-rw-r--r-- 1 root root 103 2012-08-14 18:02 concat_basedir.rb

Something else is wrong, something specifically with puppetlabs/lvm.
The concat module is in the same environment too.

Doug.

-- 
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.



Re: [Puppet Users] Custom Providers and Environmemts.

2012-08-14 Thread Douglas Garstang
On Tue, Aug 14, 2012 at 2:59 PM, Douglas Garstang
 wrote:
> On Tue, Aug 14, 2012 at 2:49 PM, Eric Shamow  wrote:
>> Specifically the types need to be in the server's $libdir. You can place 
>> them there manually, but the way they generally get there is via pluginsync. 
>> So the easiest way to ensure the master can process them is to place them in 
>> the module path used by the server *when the server is acting as a puppet 
>> agent* and run puppet agent on the server.
>>
>> This will sync the types to the correct directory on the master and enable 
>> it to parse them when they are used elsewhere.
>>
>> -Eric
>
> Actually, *sigh* something else is wrong, because I used the concat
> module earlier, after enabling pluginsync on both master and client,
> and it seems to have synced what it needs ok:
>
> [us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib# ls -l
> total 8
> drwxr-sr-x 2 root root 4096 2012-08-14 18:02 facter
> drwxr-sr-x 4 root root 4096 2012-08-14 20:35 puppet
> [us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib# cd facter/
> [us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib/facter# ls -l
> total 4
> -rw-r--r-- 1 root root 103 2012-08-14 18:02 concat_basedir.rb
>
> Something else is wrong, something specifically with puppetlabs/lvm.
> The concat module is in the same environment too.
>
> Doug.

Now I'm really confused... The files _ARE_ on the client...

[us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib/puppet# find . -ls
2745884 drwxr-sr-x   4 root root 4096 Aug 14 20:35 .
2745974 drwxr-sr-x   2 root root 4096 Aug 14 20:35 ./type
2745984 -rw-r--r--   1 root root 1380 Aug 14 20:35
./type/logical_volume.rb
2746014 -rw-r--r--   1 root root  458 Aug 14 20:35
./type/volume_group.rb
2745994 -rw-r--r--   1 root root  320 Aug 14 20:35
./type/physical_volume.rb
2746004 -rw-r--r--   1 root root  531 Aug 14 20:35
./type/filesystem.rb
2745894 drwxr-sr-x   6 root root 4096 Aug 14 20:35 ./provider
2745934 drwxr-sr-x   2 root root 4096 Aug 14 20:35
./provider/logical_volume
2745964 -rwxr-xr-x   1 root root 3653 Aug 14 20:35
./provider/logical_volume/lvm.rb
2745914 drwxr-sr-x   2 root root 4096 Aug 14 20:35
./provider/filesystem
2745924 -rw-r--r--   1 root root  825 Aug 14 20:35
./provider/filesystem/lvm.rb
2745944 drwxr-sr-x   2 root root 4096 Aug 14 20:35
./provider/physical_volume
2745954 -rw-r--r--   1 root root  401 Aug 14 20:35
./provider/physical_volume/lvm.rb
2745904 drwxr-sr-x   2 root root 4096 Aug 14 20:35
./provider/volume_group
2746024 -rw-r--r--   1 root root 1856 Aug 14 20:35
./provider/volume_group/lvm.rb

But...

[us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib/puppet# puppet
agent --test --onetime --verbose
info: Retrieving plugin
info: Loading facts in concat_basedir
info: Loading facts in concat_basedir
err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError:
Invalid resource type physical_volume at
/truth/sauce/env/prod/modules/role/manifests/common.pp:44 on node
testweb10.us1.xxx.com

Doug.

-- 
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.



Re: [Puppet Users] Custom Providers and Environmemts.

2012-08-14 Thread Douglas Garstang
On Tue, Aug 14, 2012 at 3:03 PM, Douglas Garstang
 wrote:
> On Tue, Aug 14, 2012 at 2:59 PM, Douglas Garstang
>  wrote:
>> On Tue, Aug 14, 2012 at 2:49 PM, Eric Shamow  wrote:
>>> Specifically the types need to be in the server's $libdir. You can place 
>>> them there manually, but the way they generally get there is via 
>>> pluginsync. So the easiest way to ensure the master can process them is to 
>>> place them in the module path used by the server *when the server is acting 
>>> as a puppet agent* and run puppet agent on the server.
>>>
>>> This will sync the types to the correct directory on the master and enable 
>>> it to parse them when they are used elsewhere.
>>>
>>> -Eric
>>
>> Actually, *sigh* something else is wrong, because I used the concat
>> module earlier, after enabling pluginsync on both master and client,
>> and it seems to have synced what it needs ok:
>>
>> [us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib# ls -l
>> total 8
>> drwxr-sr-x 2 root root 4096 2012-08-14 18:02 facter
>> drwxr-sr-x 4 root root 4096 2012-08-14 20:35 puppet
>> [us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib# cd facter/
>> [us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib/facter# ls -l
>> total 4
>> -rw-r--r-- 1 root root 103 2012-08-14 18:02 concat_basedir.rb
>>
>> Something else is wrong, something specifically with puppetlabs/lvm.
>> The concat module is in the same environment too.
>>
>> Doug.
>
> Now I'm really confused... The files _ARE_ on the client...
>
> [us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib/puppet# find . -ls
> 2745884 drwxr-sr-x   4 root root 4096 Aug 14 20:35 .
> 2745974 drwxr-sr-x   2 root root 4096 Aug 14 20:35 ./type
> 2745984 -rw-r--r--   1 root root 1380 Aug 14 20:35
> ./type/logical_volume.rb
> 2746014 -rw-r--r--   1 root root  458 Aug 14 20:35
> ./type/volume_group.rb
> 2745994 -rw-r--r--   1 root root  320 Aug 14 20:35
> ./type/physical_volume.rb
> 2746004 -rw-r--r--   1 root root  531 Aug 14 20:35
> ./type/filesystem.rb
> 2745894 drwxr-sr-x   6 root root 4096 Aug 14 20:35 ./provider
> 2745934 drwxr-sr-x   2 root root 4096 Aug 14 20:35
> ./provider/logical_volume
> 2745964 -rwxr-xr-x   1 root root 3653 Aug 14 20:35
> ./provider/logical_volume/lvm.rb
> 2745914 drwxr-sr-x   2 root root 4096 Aug 14 20:35
> ./provider/filesystem
> 2745924 -rw-r--r--   1 root root  825 Aug 14 20:35
> ./provider/filesystem/lvm.rb
> 2745944 drwxr-sr-x   2 root root 4096 Aug 14 20:35
> ./provider/physical_volume
> 2745954 -rw-r--r--   1 root root  401 Aug 14 20:35
> ./provider/physical_volume/lvm.rb
> 2745904 drwxr-sr-x   2 root root 4096 Aug 14 20:35
> ./provider/volume_group
> 2746024 -rw-r--r--   1 root root 1856 Aug 14 20:35
> ./provider/volume_group/lvm.rb
>
> But...
>
> [us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib/puppet# puppet
> agent --test --onetime --verbose
> info: Retrieving plugin
> info: Loading facts in concat_basedir
> info: Loading facts in concat_basedir
> err: Could not retrieve catalog from remote server: Error 400 on
> SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError:
> Invalid resource type physical_volume at
> /truth/sauce/env/prod/modules/role/manifests/common.pp:44 on node
> testweb10.us1.xxx.com
>
> Doug.

Files are on the server too..

[us1] root@truth:/truth# find / -name physical_volume.rb
/truth/sauce/env/prod/modules/lvm/spec/unit/puppet/type/physical_volume.rb
/truth/sauce/env/prod/modules/lvm/lib/puppet/type/physical_volume.rb

The second one, under env/prod is the correct environment. So... this
should work...

Doug.

-- 
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.



Re: [Puppet Users] Custom Providers and Environmemts.

2012-08-14 Thread Douglas Garstang
On Tue, Aug 14, 2012 at 3:06 PM, Douglas Garstang
 wrote:
> On Tue, Aug 14, 2012 at 3:03 PM, Douglas Garstang
>  wrote:
>> On Tue, Aug 14, 2012 at 2:59 PM, Douglas Garstang
>>  wrote:
>>> On Tue, Aug 14, 2012 at 2:49 PM, Eric Shamow  wrote:
 Specifically the types need to be in the server's $libdir. You can place 
 them there manually, but the way they generally get there is via 
 pluginsync. So the easiest way to ensure the master can process them is to 
 place them in the module path used by the server *when the server is 
 acting as a puppet agent* and run puppet agent on the server.

 This will sync the types to the correct directory on the master and enable 
 it to parse them when they are used elsewhere.

 -Eric
>>>
>>> Actually, *sigh* something else is wrong, because I used the concat
>>> module earlier, after enabling pluginsync on both master and client,
>>> and it seems to have synced what it needs ok:
>>>
>>> [us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib# ls -l
>>> total 8
>>> drwxr-sr-x 2 root root 4096 2012-08-14 18:02 facter
>>> drwxr-sr-x 4 root root 4096 2012-08-14 20:35 puppet
>>> [us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib# cd facter/
>>> [us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib/facter# ls -l
>>> total 4
>>> -rw-r--r-- 1 root root 103 2012-08-14 18:02 concat_basedir.rb
>>>
>>> Something else is wrong, something specifically with puppetlabs/lvm.
>>> The concat module is in the same environment too.
>>>
>>> Doug.
>>
>> Now I'm really confused... The files _ARE_ on the client...
>>
>> [us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib/puppet# find . -ls
>> 2745884 drwxr-sr-x   4 root root 4096 Aug 14 20:35 .
>> 2745974 drwxr-sr-x   2 root root 4096 Aug 14 20:35 ./type
>> 2745984 -rw-r--r--   1 root root 1380 Aug 14 20:35
>> ./type/logical_volume.rb
>> 2746014 -rw-r--r--   1 root root  458 Aug 14 20:35
>> ./type/volume_group.rb
>> 2745994 -rw-r--r--   1 root root  320 Aug 14 20:35
>> ./type/physical_volume.rb
>> 2746004 -rw-r--r--   1 root root  531 Aug 14 20:35
>> ./type/filesystem.rb
>> 2745894 drwxr-sr-x   6 root root 4096 Aug 14 20:35 ./provider
>> 2745934 drwxr-sr-x   2 root root 4096 Aug 14 20:35
>> ./provider/logical_volume
>> 2745964 -rwxr-xr-x   1 root root 3653 Aug 14 20:35
>> ./provider/logical_volume/lvm.rb
>> 2745914 drwxr-sr-x   2 root root 4096 Aug 14 20:35
>> ./provider/filesystem
>> 2745924 -rw-r--r--   1 root root  825 Aug 14 20:35
>> ./provider/filesystem/lvm.rb
>> 2745944 drwxr-sr-x   2 root root 4096 Aug 14 20:35
>> ./provider/physical_volume
>> 2745954 -rw-r--r--   1 root root  401 Aug 14 20:35
>> ./provider/physical_volume/lvm.rb
>> 2745904 drwxr-sr-x   2 root root 4096 Aug 14 20:35
>> ./provider/volume_group
>> 2746024 -rw-r--r--   1 root root 1856 Aug 14 20:35
>> ./provider/volume_group/lvm.rb
>>
>> But...
>>
>> [us1:i-f8350ebe] root@testweb10:/var/lib/puppet/lib/puppet# puppet
>> agent --test --onetime --verbose
>> info: Retrieving plugin
>> info: Loading facts in concat_basedir
>> info: Loading facts in concat_basedir
>> err: Could not retrieve catalog from remote server: Error 400 on
>> SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError:
>> Invalid resource type physical_volume at
>> /truth/sauce/env/prod/modules/role/manifests/common.pp:44 on node
>> testweb10.us1.xxx.com
>>
>> Doug.
>
> Files are on the server too..
>
> [us1] root@truth:/truth# find / -name physical_volume.rb
> /truth/sauce/env/prod/modules/lvm/spec/unit/puppet/type/physical_volume.rb
> /truth/sauce/env/prod/modules/lvm/lib/puppet/type/physical_volume.rb
>
> The second one, under env/prod is the correct environment. So... this
> should work...

No... wait those files are the original ones imported into the git
source. Ignore that. Losing sanity.

Doug.

-- 
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.



Re: [Puppet Users] Pass array to a define

2012-08-14 Thread Stefan Schulte
On Tue, Aug 14, 2012 at 02:23:37PM -0700, Douglas Garstang wrote:
> Yeah, well I tried the puppet labs lvm module. After I fixed the
> syntax errors, which included a missing '}' in the code (wtf!??!), it
> seems that custom types don't work with environments...
> 
> http://projects.puppetlabs.com/issues/4409
> 
> Doug.
> 

You can use custom types even if you use environments. The problem is that
type and parameter validation happens on the master side so the puppetmaster
process needs to be aware of the custom type.

So on your master you need to have at least these files:

/var/lib/puppet/lib/puppet/type/filesystem.rb
/var/lib/puppet/lib/puppet/type/logical_volume.rb
/var/lib/puppet/lib/puppet/type/physical_volume.rb
/var/lib/puppet/lib/puppet/type/volume_group.rb

On your agent you need to have the type/* and provider/*/* files but
this is already handled if you use `pluginsync = true` in your
`/etc/puppet/puppet.conf`.

On your puppet master you can either copy the files by hand or run a puppet
agent process on the master with pluginsync enabled. If the files are in
place make sure to restart your puppetmaster (maybe the master will pick
them up automatically but I am not sure about that).

The thing about environments is: You may want to add a parameter to the
`volume_group´ type so you modify the volume_group.rb file in your "dev"
environment. While a puppet node with environment "dev" will get the new
version of the plugin now, the puppetmaster will still see its version
in /var/lib/puppet/type/volume_group.rb which does not have the new
parameter. If you run puppet agent on your masternode in the environment
"prod" you are forced to push your changes to volume_group.rb into prod.

I hope this helps and you get the lvm type to work.

-Stefan

-- 
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] Puppet hanging when listen turned on

2012-08-14 Thread James A. Peltier
Hi All,

Recently Puppet (2.7.18 / RHEL 6.3) has started to hang when the listen 
parameter is turned on.  I've tried rolling back several versions of Puppet as 
well as rolling back Ruby so as to try and figure out if it was a recent update 
that did it, but to no avail.


strace on the puppet pid shows the following


rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
select(7, [5 6], [], [], {1, 99})   = 0 (Timeout)
select(7, [5 6], [], [], {0, 0})= 0 (Timeout)
select(7, [6], [], [], {0, 0})  = 0 (Timeout)
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
select(7, [5 6], [], [], {1, 99} 


This sounds an awful lot like http://projects.puppetlabs.com/issues/12185 but 
it doesn't chew up any CPU time, it just sits there and loops the above strace 
over and over again.  Telnet to 8139 doesn't work either.  Ideas?


-- 
James A. Peltier
Manager, IT Services - Research Computing Group
Simon Fraser University - Burnaby Campus
Phone   : 778-782-6573
Fax : 778-782-3045
E-Mail  : jpelt...@sfu.ca
Website : http://www.sfu.ca/itservices
  http://blogs.sfu.ca/people/jpeltier

Success is to be measured not so much by the position that one has reached
in life but as by the obstacles they have overcome. - Booker T. Washington

-- 
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] Announce: Puppet 2.7.19rc3 Available

2012-08-14 Thread Moses Mendoza
Puppet 2.7.19rc3 is a maintenance release candidate for Puppet in the
2.7.x series with bug fixes.

Downloads are available at:
 * Source https://downloads.puppetlabs.com/puppet/puppet-2.7.19rc3.tar.gz

Windows package is available at
https://downloads.puppetlabs.com/windows/puppet-2.7.19rc3.msi

RPMs are available at https://yum.puppetlabs.com/el or /fedora

Debs are available at  https://apt.puppetlabs.com

Mac package is available at
https://downloads.puppetlabs.com/mac/puppet-2.7.19rc3.dmg

See the Verifying Puppet Download section at:
https://projects.puppetlabs.com/projects/puppet/wiki/Downloading_Puppet

Please report feedback via the Puppet Labs Redmine site, using an
affected puppet version of 2.7.19rc3:
http://projects.puppetlabs.com/projects/puppet/

This release contains contributions from Daniel Pittman, Matthaus
Litteken, and Moses Mendoza.

## Puppet 2.7.19rc3 Release Notes ##

Ruby 1.9.3 has a different error when `require` fails.

The text of the error message when load fails has changed, resulting in the
test failing.  This adapts that to catch the different versions,
allowing this
to pass in all cases.

(#15291) Add Vendor tag to Puppet spec file

Previously the spec file had no Vendor tag, which left it undefined. This
commit adds a Vendor tag that references the _host_vendor macro,
so that it can
be easily set to 'Puppet Labs' internally and customized by users
easily. The
Vendor tag makes it easier for users to tell where the package came from.

Add packaging support for fedora 17

This commit modifies the puppet.spec file to use
the ruby vendorlib instead of sitelib if building
for fedora 17, which ships with ruby 1.9. Mostly
borrowed from the official Fedora 17 package.

## Puppet 2.7.19rc3 Changelog ##

Daniel Pittman(1)
   85f5543 Ruby 1.9.3 has a different error when `require` fails.
Matthaus Litteken(1)
   b2d08a4 (#15291) Add Vendor tag to Puppet spec file
Moses Mendoza(1)
   7611753 Add packaging support for fedora 17

-- 
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.



Re: [Puppet Users] Best practice for Node Def files

2012-08-14 Thread Ramin K

On 8/14/2012 2:14 PM, Jeff McCune wrote:

what is the best practice? Is it better to have one node def per
file, or group the node defs by class (ie, all app servers in one
file or all web servers in one file) or some other layout?


Best practice is to use an external node classifier or place all of your
node declarations into one site.pp file.  One file is preferable because
one-file-per-node scales poorly to tens of thousands of nodes as Puppet
will read tens of thousands of files every time a catalog is compiled.


Another option is one node file per hostgroup which doesn't get near 
enough mention despite its usefulness for the environments 95% of us 
likely administer. Provides some organization with separate files and 
scales to thousands of nodes assuming less than thousands of hostgroups.


node /^some regex based on hostname matching hostgroup$/ {

Ramin

--
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] uninitialized constant Puppet::Util::Autoload (NameError)

2012-08-14 Thread saasadm
Have anyone seen this error before?   I just installed Puppet and tried it 
out and got this error.I haven't made any changes to the system
yet after the installation.

>puppet agent --noop --verbose -test
/usr/lib/ruby/site_ruby/1.8/puppet/util/subclass_loader.rb:21:in 
`handle_subclasses': uninitialized constant Puppet::Util::Autoload 
(NameError)
from /usr/lib/ruby/site_ruby/1.8/puppet/network/handler.rb:18
from /usr/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:2:in 
`require'
from /usr/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:2
from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:52:in 
`require'
from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:52:in 
`require_application'
from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:59:in 
`execute'
from /usr/bin/puppet:4

Any ideas?

Thanks

Phat

-- 
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/-/7ZhYrXtr1kAJ.
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] uninitialized constant Puppet::Util::Autoload (NameError)

2012-08-14 Thread Ryan Coleman
On Tue, Aug 14, 2012 at 4:10 PM, saasadm  wrote:
> Have anyone seen this error before?   I just installed Puppet and tried it
> out and got this error.I haven't made any changes to the system
> yet after the installation.
>
>>puppet agent --noop --verbose -test

Are there two dashes before test? --test versus -test?

> /usr/lib/ruby/site_ruby/1.8/puppet/util/subclass_loader.rb:21:in
> `handle_subclasses': uninitialized constant Puppet::Util::Autoload
> (NameError)
> from /usr/lib/ruby/site_ruby/1.8/puppet/network/handler.rb:18
> from /usr/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:2:in
> `require'
> from /usr/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:2
> from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:52:in
> `require'
> from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:52:in
> `require_application'
> from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:59:in
> `execute'
> from /usr/bin/puppet:4
>
> Any ideas?
>
> Thanks
>
> Phat
>
> --
> 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/-/7ZhYrXtr1kAJ.
> 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.



-- 
Ryan Coleman | about.me/ryc
Modules & Forge @ Puppet Labs

-- 
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.



Re: [Puppet Users] Testing Hiera Lookup with Puppet Master

2012-08-14 Thread R.I.Pienaar


- Original Message -
> From: "Mitchell Hashimoto" 
> To: puppet-users@googlegroups.com
> Sent: Tuesday, August 14, 2012 1:12:31 PM
> Subject: Re: [Puppet Users] Testing Hiera Lookup with Puppet Master
> 
> 
> 
> On Tuesday, August 14, 2012 12:34:45 PM UTC-7, R.I. Pienaar wrote:
> 
> 
> 
> - Original Message -
> > From: "Mitchell Hashimoto" < mitchell@gmail.com >
> > To: puppet...@googlegroups.com
> > Sent: Tuesday, August 14, 2012 12:13:19 PM
> > Subject: [Puppet Users] Testing Hiera Lookup with Puppet Master
> > 
> > Hello,
> > 
> > 
> > Is there an easy way to test hiera lookup for a node? A node is not
> > getting the value I expect from Hiera and I want a way to test
> > this.
> 
> It depends on what backends you use, the CLI cannot get access to the
> data inside the puppet backend for example but for JSON/YAML it
> shouldd
> work
> 
> My install lags a bit in versions and I do not have the inventory
> service so its hard to say whats up with that, but given a
> /etc/hiera.yaml
> that points to the right hiera db dir for json files I can do:
> 
> $ hiera key fact=val fact=val fact=val
> 
> the key being what you want and the kv pairs being the scope it will
> pass through the hierarchy
> 
> you can also set your master to debug logging and you'll see it log
> every
> lookup and what its trying
> 
> 
> 
> Thanks, I think I'll go with the debug logging route for now. Is
> there a way in the "puppet.conf" file to enable debug logging?

not actually sure off the top of my head but just adding --debug to
the flags on the CLI or in rack should do it

-- 
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.



Re: [Puppet Users] Puppet for deploying Jboss application

2012-08-14 Thread Rost
thks

Le mardi 14 août 2012 22:21:04 UTC+2, Dominic Cleal a écrit :
>
> On 14/08/12 18:18, Rost wrote: 
> > Hi All, 
> > 
> > I would like to use puppet for deploying Jboss application. 
> > 
> > The property file of my Jboss app need to be evaluated before moving in 
> > the conf dir as it's a template. 
> > 
> > How could I make this kind of operation with native resources of puppet. 
> > 
> > 
> > *Example :* 
> > 
> > I have this file *myapp.properties.tmpl* : 
> > 
> > ApplicationName=${MY_APP_NAME} 
> > ApplicationVersion=${MY_APP_VERSION} 
> > ... 
> > 
> > 
> > And I have the file *global.properties* : 
> > 
> > ${MY_APP_NAME}=helloworld 
> > ${MY_APP_VERSION}=1.0.0 
>
> This here feels like you're not solving the actual problem, but working 
> around a bug elsewhere in your design. 
>
> > I would like to replace variables in myapp.properties.tmpl with the 
> > right value in global.properties and generate the new file 
> > *myapp.properties* with 
> > 
> > ApplicationName=helloworld 
> > ApplicationVersion=1.0.0 
> > 
> > Is that possible, may be with tools like Augeas? 
>
> The first thing you need is to get the data ("helloworld", "1.0.0") into 
> Puppet.  Ideally via an ENC or hiera or similar. 
>
> If it only exists on the filesystem of the host at the start of a run 
> and you really must, you could use a fact, but you're going into weird 
> territory as your system build will then depend on the existing state of 
> the system.  Definitely an anti-pattern here, but possible. 
>
> You can use Augeas in facts, but only the properties lens as it exists 
> in master (rather than the 0.9.0 release) can parse that 
> global.properties file.  Something like this: 
>
> http://pastie.org/4475806 
> http://projects.puppetlabs.com/projects/facter/wiki/Facter_Augeas 
>
> Or do something similar in Ruby to pull the value out of the file on the 
> host and present it in a fact. 
>
> Once you have the value in Puppet, then creating or editing 
> myapp.properties with Augeas is trivial, or use a template: 
>
> augeas { "myapp.properties": 
>   lens=> "Properties.lns", 
>   incl=> "/path/to/myapp.properties", 
>   changes => [ 
> "set ApplicationName ${appname}", 
> "set ApplicationVersion ${appversion}", 
>   ], 
> } 
>
> (Where $appname and $appversion are Puppet variables, facts or a proper 
> data source.) 
>
> Cheers, 
>
> -- 
> Dominic Cleal 
> Red Hat Consulting 
> m: +44 (0)7817 878113 
>

-- 
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/-/j8t3iTOJjNoJ.
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: Is there a way to configure Puppet Dashboard to use server time (rather than client time) for the "latest report" field?

2012-08-14 Thread pe
As well as the above, I'd like to also know how to get it to use the 'local 
time', not UTC, as all my systems are in the same timezone.


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/-/OxHuxGpcwXcJ.
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] hiera command line performance

2012-08-14 Thread Paul Colby
Thanks R.I. Pienaar, that's exactly the kind of suggestion I was hoping 
for! :)

I haven't written any Ruby for ~9 years, but as I regularly develop in 
several other languages (primarily C++), I'll enjoy getting my hands dirty 
with Ruby again.

And thanks for including a basic single-interpreter example - that will 
help me get going a lot quicker!

Thanks,

Paul.

On Wednesday, August 15, 2012 2:45:06 AM UTC+10, R.I. Pienaar wrote:
>
> hello, 
>
> - Original Message - 
> > From: "Paul Colby" > 
> > To: puppet...@googlegroups.com  
> > Sent: Monday, August 13, 2012 6:22:10 PM 
> > Subject: [Puppet Users] hiera command line performance 
> > 
> > Hi everyone, 
> > 
> > 
> > The hiera command line program (version 0.3.0) is currently taking 
> > around 2 seconds per invocation. This seems quite slow to me, but is 
> > probably not an issue for most users. 
>
> 2 seconds seem quite slow though i guess it depends on the size of your 
> yamls and so forth, sounds like yours are big and complex.  I'd hope the 
> bulk of the time is spent on starting/stopping ruby each time. 
>
> A better option might be to consider writing your script in ruby rather 
> than bash so you can then do your lookup that way reusing the single 
> hiera instance and avoid the ruby start/stop cost 
>
> So a simple test on my setup doing: 
>
> for i in {1..100} 
> do 
>   hiera syslocation ::location=foo 
> done 
>
> this takes 30 seconds, ages.  Here is the same in Ruby reusing the 
> class and using a single interpreter: 
>
> h = Hiera.new(:config => "/etc/hiera.yaml") 
>
> Benchmark.measure do 
>  100.times do 
>   puts h.lookup("syslocation", "", {"::location" => "foo"}) 
>  end 
> end 
>
> this takes 0.1 second for 100 lookups.  If you know a bit of ruby this 
> would be a good approach for you even if you just write your script to 
> configure a single machine in ruby and run it 40 times only 
>
> > 
> > 
> > We have a number of legacy machines that for one reason or another 
> > have not been puppetised yet, and probably won't be anytime soon, so 
> > I have a somewhat clever script that, for each of these hosts, uses 
> > the hiera command like utility to export a few puppet-templated 
> > documents just as puppet+hiera does for our puppeted server. This 
> > works very nicely, but involves ~250 hiera lookups per host, which 
> > at 2 seconds per lookup, is taking more than 8 minutes per host (and 
> > using near 100% of a CPU core the entire time). As we have ~40 such 
> > hosts, that's over 5 hours with no concurrency (we do use some 
> > concurrency, but since each invocation uses near 100% of a CPU core 
> > each, there's no point running more simultaneous hiera processes 
> > than the number of CPUs, and even then, we need some reserved for 
> > other services). 
> > 
> > 
> > So, is there some way I can make this export run faster? The bulk of 
> > the time seems to be spent in initialising the hiera command line 
> > program, not the actual data lookup (for example, if I fail to 
> > provide the necessary identity / scope files, it still takes 2 
> > seconds to get around to returning an error, but if I fail to 
> > provide a config file, it returns instantaneously with error). So, 
> > I'd either like to make the program load / initialise much faster, 
> > or be able to query multiple values for a single hiera command line 
> > invocation. 
> > 
> > 
> > Also, is there a more recent version of hiera that would be faster? 
> > (I'm a little unclear about hiera versioning - we're running 0.3.0, 
> > but I don't know if that's recent or old). 
> > 
> > 
> > Any suggestions / tips would be greatly appreciated :) 
> > 
> > 
> > Thanks. 
> > 
> > 
> > Paul. 
> > 
> > -- 
> > 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/-/YTZZ7FOshJkJ . 
> > To post to this group, send email to 
> > puppet...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > puppet-users...@googlegroups.com . 
> > For more options, visit this group at 
> > http://groups.google.com/group/puppet-users?hl=en. 
> > 
>

-- 
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/-/WQV-NVyOHXgJ.
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] Calling custom Puppet function from within a provider

2012-08-14 Thread Mitchell Hashimoto
Hello,

I have a custom Puppet function. Am I able to call that function from
within my custom provider (written in Ruby)?

Best,
Mitchell

-- 
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.



Re: [Puppet Users] Puppet hanging when listen turned on

2012-08-14 Thread Miguel Di Ciurcio Filho
On Tue, Aug 14, 2012 at 7:27 PM, James A. Peltier  wrote:
> Hi All,
>
> Recently Puppet (2.7.18 / RHEL 6.3) has started to hang when the listen 
> parameter is turned on.  I've tried rolling back several versions of Puppet 
> as well as rolling back Ruby so as to try and figure out if it was a recent 
> update that did it, but to no avail.
>

I've have the same problem, but on Ubuntu 10.04 or Debian Squeeze.
Puppet randomly hangs and becomes zombie when listen is turned on.

Regards,

Miguel

-- 
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] Installing puppet-dashboard on ubuntu precise

2012-08-14 Thread Sam Morrison
Hi, 

I'm trying to install dashboard on precise and I get the below error.
I'm using the latest version that is available in the puppet apt 
repository. The package rdoc is installed (it's just a virtual package 
pointing to ruby)

Are there some other missing dependencies that the package doesn't specify?
I don't know ruby that well so finding it hard to debug.

Also it's well after 2011-11-01 is that a problem too?

Thanks,
Sam



root@admin:/usr/share/puppet-dashboard# rake RAILS_ENV=production 
db:migrate --trace
NOTE: Gem.source_index is deprecated, use Specification. It will be removed 
on or after 2011-11-01.
Gem.source_index called from 
/usr/share/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It 
will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from 
/usr/share/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. 
It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
rake aborted!
no such file to load -- rdoc/task
/usr/lib/ruby/vendor_ruby/1.8/rubygems/cus

Re: [Puppet Users] Installing puppet-dashboard on ubuntu precise

2012-08-14 Thread Ashish

Hi,

I just ran into the same problem few days back,

see whether you have installed rack 1.1.0 you can check by "gem list"

and if possible uninstall the existing rack which ever version it is 
and then install it with this command gem install rack -v=1.1.0



server:/usr/share/puppet-dashboard/script# gem list

*** LOCAL GEMS ***

daemon_controller (1.0.0)
fastthread (1.0.7)
passenger (3.0.15)
rack (1.1.2, 1.1.0)
rake (0.9.2.2)


Regards,
System Admin
Ashish Jaiswal

On Wednesday 15 August 2012 10:47:38 AM IST, Sam Morrison wrote:

Hi,

I'm trying to install dashboard on precise and I get the below error.
I'm using the latest version that is available in the puppet apt
repository. The package rdoc is installed (it's just a virtual package
pointing to ruby)

Are there some other missing dependencies that the package doesn't
specify?
I don't know ruby that well so finding it hard to debug.

Also it's well after 2011-11-01 is that a problem too?

Thanks,
Sam



root@admin:/usr/share/puppet-dashboard# rake RAILS_ENV=production
db:migrate --trace
NOTE: Gem.source_index is deprecated, use Specification. It will be
removed on or after 2011-11-01.
Gem.source_index called from
/usr/share/puppet-dashboard/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement.
It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from
/usr/share/puppet-dashboard/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
/usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#