Re: [Puppet Users] Condition on class existence on agent

2014-02-26 Thread Nikola Petrov
On Wed, Feb 26, 2014 at 07:12:19AM -0800, zerozerouno...@gmail.com wrote:
> On Wednesday, February 26, 2014 2:47:32 PM UTC+1, nikolavp wrote:
>  
> 
> > What is the reason for the definition of those classes on the same host? 
> >
> 
> That's because I have some more general "role A" to which some hosts 
> belong, but I also have "role B" which is some sort of further 
> specification of role A, and host B belongs to it and thus needs a more 
> specific configuration file.

A specific example I think will be of much help. Some ideas:

1) Is "role B" just a more specific "role A" or they aren't so much
related. You can use inheritance if they are and change the file/define
you are interested in. Although inheritance is almost always abused
in this setup it is OK.

>  
> 
> > Can't it just be a single class with a parameter moved to hiera or
> 
> 
> Er... I never used hiera until now.
> I had a look at the doc but it seemed to me a bit overkill for this 
> requirement.

Other ways to do this would be to just "propagate" the parameter for the
change to both "role A" and "role B" with default values.

> 
> something else? My other suggestion would be to create a fact that 
> > changes the setting on the machine based on the fact value. 
> >
> 
> Would be a good idea, but can a fact be created with a value which depends 
> on puppet classes assigned to the host?
> Uhm... maybe assign the fact value based on the output of a command like 
> "puppet resource user "?
> I'm afraid the result would be based on existence on the master again, not 
> on the agent.
> 

I am not sure if understood the idea. I am not saying that you have to
create a dependant fact but just to set a fact with the value you want
to change. So let's say you want to have a database connection URI. Role
A sets it to something by default and Role B sets it to something else.
You can specify the wanted connection URI on the host with custom fact.

N.B. Can you also tell us how do you assign the roles for each host
because that might help us be more specific with a solution.

-- 
Nikola

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20140227075204.GA23232%40nikolavp-desktop.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Hiera isn't merging hashes

2014-02-26 Thread Charlie Sharpsteen
On Wednesday, February 26, 2014 2:19:23 PM UTC-8, paul@complex.com 
wrote:
>
> I have been doing some experimenting with Puppet + Hiera with some of my 
> hashes, but when it is going through my hierarchy it is returning whatever 
> hash it hits first and skipping the others.
>
> For my node 'sandbox1'
>
> sandbox.pp:
>
> node /^sandbox\d+/ {
>   class { 'php':}
>   notify { 'PHP hash':
> message => hiera('php::augeas',{})
>   }
>   $php_settings = hiera('php::augeas',{})
>   create_resources('php::augeas',$php_settings)
> }
>
>

The `hiera` lookup function only returns the first key it finds --- which 
is the behavior you are observing. For hash merge lookup, you will need to 
use the `hiera_hash` function in your manifest instead of `hiera`.

For full details, see the docs on Hiera lookup functions:

http://docs.puppetlabs.com/hiera/1/puppet.html#hiera-lookup-functions

Hope this helps!

-Charlie

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/646bc467-b109-4828-baa8-74af6bed6426%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Hiera isn't merging hashes

2014-02-26 Thread paul . lewis
I currently have these versions of puppet related packages installed:

# yum list installed | grep puppet

facter.x86_64   1:1.7.3-1.el6  @puppetlabs-products
hiera.noarch1.3.1-1.el6@puppetlabs
puppet.noarch   3.3.1-1.el6@puppetlabs
puppet-dashboard.noarch 1.2.23-1.el6   @puppetlabs-products
puppet-server.noarch3.3.1-1.el6@puppetlabs
puppetdb.noarch 1.5.2-1.el6@puppetlabs
puppetdb-terminus.noarch1.5.2-1.el6@puppetlabs

I also have :merge_behavior set to deeper


On Wednesday, February 26, 2014 6:08:51 PM UTC-5, Andrew wrote:
>
> you need to use hiera 1.2 and enable deep merging
> On 26 Feb 2014 22:19, > wrote:
>
>> I have been doing some experimenting with Puppet + Hiera with some of my 
>> hashes, but when it is going through my hierarchy it is returning whatever 
>> hash it hits first and skipping the others.
>>
>> For my node 'sandbox1'
>>
>> sandbox.pp:
>>
>> node /^sandbox\d+/ {
>>   class { 'php':}
>>   notify { 'PHP hash':
>> message => hiera('php::augeas',{})
>>   }
>>   $php_settings = hiera('php::augeas',{})
>>   create_resources('php::augeas',$php_settings)
>> }
>>
>>
>> hiera.yaml:
>>
>> ---
>> :backends:
>>   - json
>> :json:
>>   :datadir: /etc/puppet/hiera
>> :merge_behavior: "deeper"
>> :hierarchy:
>>   - "nodes/%{::hostname}"
>>   - "roles/%{::role}"
>>   - "provider/%{::provider}"
>>   - "provider/%{::provider}/virtual/virtual_%{::is_virtual}"
>>   - common
>>
>>
>> hiera/nodes/sandbox1.json:
>>
>> {
>> "php::augeas" : {
>> "php-allow_url_fopen" : {
>> "entry"   : "PHP/allow_url_fopen",
>> "value"   : "On"
>> }
>> }
>> }
>>
>>
>> hiera/roles/sandbox.json:
>>
>> {
>> "php::augeas" : {
>> "php-log_errors" : {
>> "entry"   : "PHP/log_errors",
>> "value"   : "On"
>> }
>> }
>> } 
>>
>>
>> hiera/common.json:
>>
>> {
>> "php::augeas" : {
>> "php-date_timezone" : {
>> "entry"   : "Date/date.timezone",
>> "value"   : "America/New_York"
>> },
>> "php-short_open_tag" : {
>> "entry"   : "PHP/short_open_tag",
>> "value"   : "On"
>> },
>> "php-error_log" : {
>> "entry"   : "PHP/error_log",
>> "value"   : "/var/log/php/php_error.log"
>> }
>> }
>> } 
>>
>>
>> In this configuration, *only  "php-allow_url_fopen" **from the top-level 
>> nodes hash is returned*. If I remove that nodes/sandbox1.json, it only 
>> returns the "php-log_errors" from the next "roles" hiera level down. 
>> Finally, if the nodes and roles json's are removed it will apply all three 
>> from the common.json hash.
>>
>> I have tried both native and deeper merge behaviors with the same result. 
>> The strangest thing is that the hiera command line tool on the master 
>> returns the correct hash:
>>
>> # hiera -h php::augeas ::hostname=sandbox1 ::role=sandbox -c 
>> /etc/puppet/hiera.yaml
>>
>> {"php-date_timezone"=>
>>   {"entry"=>"Date/date.timezone", "value"=>"America/New_York"},
>>  "php-short_open_tag"=>{"entry"=>"PHP/short_open_tag", "value"=>"On"},
>>  "php-error_log"=>
>>   {"entry"=>"PHP/error_log", "value"=>"/var/log/php/php_error.log"},
>>  "php-log_errors"=>{"entry"=>"PHP/log_errors", "value"=>"On"},
>>  "php-allow_url_fopen"=>{"entry"=>"PHP/allow_url_fopen", "value"=>"On"}}
>>
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to puppet-users...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/96454179-6cd7-4c54-9ec2-2bf553e319a9%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ddc1f9c0-8d30-43ad-856c-2fdf771f5b3e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: debugging puppet/hiera-eyaml decryption problems?

2014-02-26 Thread William Leese
What does the actual yaml containing the encrypted value look like? I've 
had some trouble simply copy & pasting eyaml output into yaml files. I 
found using something like this works best:

mysql::server::root_password: 
ENC[PKCS7,MxxZIhvcNAQcDoIIBejCCAXYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEgsnipsnipsnipsnipsnipsnipIZIAWUDBAEqBBALP97TUumMst8nV3mXwI7TgCBn9mVz/uaSgcJHo9xUuXmK1ynG80J0tqDyblahalbhalabhaOQHQ==]

(just incase wordwrap kicks in, that's all on one line).

Are your yaml files named *.eyaml?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/a8e752a7-b378-413e-b207-6c9b47aa6012%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Announce: Hiera 1.3.2 Now Available

2014-02-26 Thread Melissa Stone
**Final Release**


Hiera 1.3.2
---

   - Final: February 26, 2014
   - RC2: February 20, 2014
   - RC1: February 11, 2014



Hiera 1.3.2 Downloads
--
Source: https://downloads.puppetlabs.com/hiera/hiera-1.3.2.tar.gz

Available in native package format in the Puppet Labs apt and yum
repositories at:
http://yum.puppetlabs.com and http://apt.puppetlabs.com

For information on how to enable the Puppet Labs repos, see:
http://docs.puppetlabs.com/guides/puppetlabs_package_repositories.html#open-source-repositories

Gems are available via rubygems at
https://rubygems.org/downloads/hiera-1.3.2.gem
  or by using `gem install hiera`

Mac packages are available at
https://downloads.puppetlabs.com/mac/hiera-1.3.2.dmg

Please report feedback via the Puppet Labs tickets site, using an
affected hiera version of 1.3.2:
https://tickets.puppetlabs.com/browse/HI


Hiera 1.3.2 release notes
---
Hiera 1.3.2 is a bug fix release in the 1.3 series. It adds packages for
Red Hat Enterprise Linux 7, support for deploying to Solaris and Windows
vCloud instances, and fixes a bug on Debian.


*RHEL 7 Support*

   - HI-179 : Add RHEL 7
   support for Hiera packaging.


*Bug Fixes*

   - HI-176 : Hiera would
   fail to find the correct ruby binary on Debian when an alternative version
   was installed. Hiera now uses /usr/bin/ruby, which fixes the issue.
   - HI-178 : Acceptance
   tests have been added for Solaris and Windows vCloud machines.
   - HI-115 : Hiera would
   show an incorrect recursive_guard warning if the same variable was
   interpolated twice in a hierarchy definition, even if the usage was not
   recursive.


Hiera 1.3.2 Contributors
--
Andrew Parker, Branan Purvine-Riley, Charlie Sharpsteen, Derek Yarnell,
Josh Cooper, Kylo Ginsberg, Matthaus Owens, Melissa Stone, Ryan McKern


Hiera 1.3.2 Changelog

Andrew Parker (3):
  2711bb9 (Maint) Include json in the acceptance deps
  0b10b2f (HI-179) Simplify and Rakeify acceptance tests
  d3c3e57 (HI-179) Test against RHEL7

Branan Purvine-Riley (1):
  ed31186 (#23140) Support deploying to Solaris and Windows vcloud
machines

Charlie Sharpsteen (3):
  fff35c0 (HI-115) Add failing test for repeated lookups
  a91f003 (HI-115) Process interpolation sites in isolation
  dde18af Remove substiution in interpolation functions

Derek Yarnell (1):
  b32c513 Adds support for building hiera on RHEL7 via spec.

Josh Cooper (3):
  7a443a9 (Maint) Add windows gem dependencies
  3145685 (Maint) Don't require json gem on non-ruby platforms
  60493f1 (Maint) Skip test on Windows

Kylo Ginsberg (1):
  c3b33fe (hi-7) Restore missing windows-2003.cfg

Matthaus Owens (3):
  b20ea81 (CPR-12) Ensure hiera works with alternatives on debian
  1239715 (HI-179) Add ability to log spec test order to a file
  9754abb (HI-179) Provide JUnit output for jenkins

Melissa Stone (4):
  2ca4685 (packaging) Update VERSION to 1.3.2-rc1
  0ea6956 Update VERSION to 1.3.2-rc2
  ee207f8 (packaging) Update VERSION to 1.3.2

Ryan McKern (1):
  6e236c1 Add initial support for building in a RHEL 7 mock

-- 
Melissa Stone
Release Engineer, Puppet Labs

*Join us at PuppetConf 2014, September 23-24 in San Francisco* -*
http://bit.ly/pupconf14
*
Register now and save $350!

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAHEe_koXamP2%2B%2BN%3D2kg84C9HDEwJBGc%3D4LDzFXDd5MF_ctj1Ag%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] recovery from foreman

2014-02-26 Thread mjackson
I am new to puppet.

running puppet 2.7.19

didn't know that you couldn't install foreman and dashboard on the same 
system/puppet master.
I've uninstalled both of them.

puppet nodes are complaining about not being able to get their catalogs.

puppet.conf has:

snippet:

[main]
# The Puppet var directory.
vardir = /var/lib/puppet

# The Puppet log directory.
# The default value is '$vardir/log'.
logdir = /var/log/puppet

# Where Puppet PID files are kept.
# The default value is '$vardir/run'.
rundir = /var/run/puppet

# Where SSL certificates are kept.
# The default value is '$confdir/ssl'.
ssldir = $vardir/ssl

# Allow services in the 'puppet' group to access key (Foreman + proxy)
privatekeydir = $ssldir/private_keys { group = service }
hostprivkey = $privatekeydir/$certname.pem { mode = 640 }

# Puppet 3.0.x requires this in both [main] and [master] - harmless on 
agents
autosign   = $confdir/autosign.conf { mode = 664 }


[master]
autosign   = $confdir/autosign.conf { mode = 664 }
reports= store, http
external_nodes = /etc/puppet/node.rb
node_terminus  = exec
ca = true
[development]
modulepath = 
/etc/puppet/modules/development:/etc/puppet/modules/common:/usr/share/puppet/modules
[production]
modulepath = 
/etc/puppet/modules/production:/etc/puppet/modules/common:/usr/share/puppet/modules

/etc/puppet/manifests/site.pp
includes:

import "classes/*"
import "roles/*.pp"
import "nodes/*.pp"
import "users/*.pp"

---end snippet-

and yes /etc/puppet/manifests/nodes does contain node_$agent(fqdn).pp

ls /var/lib/puppet/yaml/facts

shows: $agent_hosts.yaml

in /var/log/messages, I find the following types of errors:

puppet puppet-master[16517]: Could not find node '$agent_hosts(fqdn)';   
cannot compile

# note: $agent_hosts(fqdn)  = a list of hosts that should be managed by 
puppet.  they all look like an fqdn.

my question:  where would the configuration be to tell where these machines 
are for compiling catalogs?




-- 


This email is intended solely for the person or entity to which it is 
addressed and may contain confidential and/or privileged information. If 
you are not the intended recipient and have received this email in error, 
please notify BroadSoft, Inc. immediately by replying to this message, and 
destroy all copies of this message, along with any attachment, prior to 
reading, distributing or copying it.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/f07723f1-f06f-4861-b87f-e368ea275e32%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Hiera isn't merging hashes

2014-02-26 Thread Andrey Kozichev
you need to use hiera 1.2 and enable deep merging
On 26 Feb 2014 22:19,  wrote:

> I have been doing some experimenting with Puppet + Hiera with some of my
> hashes, but when it is going through my hierarchy it is returning whatever
> hash it hits first and skipping the others.
>
> For my node 'sandbox1'
>
> sandbox.pp:
>
> node /^sandbox\d+/ {
>   class { 'php':}
>   notify { 'PHP hash':
> message => hiera('php::augeas',{})
>   }
>   $php_settings = hiera('php::augeas',{})
>   create_resources('php::augeas',$php_settings)
> }
>
>
> hiera.yaml:
>
> ---
> :backends:
>   - json
> :json:
>   :datadir: /etc/puppet/hiera
> :merge_behavior: "deeper"
> :hierarchy:
>   - "nodes/%{::hostname}"
>   - "roles/%{::role}"
>   - "provider/%{::provider}"
>   - "provider/%{::provider}/virtual/virtual_%{::is_virtual}"
>   - common
>
>
> hiera/nodes/sandbox1.json:
>
> {
> "php::augeas" : {
> "php-allow_url_fopen" : {
> "entry"   : "PHP/allow_url_fopen",
> "value"   : "On"
> }
> }
> }
>
>
> hiera/roles/sandbox.json:
>
> {
> "php::augeas" : {
> "php-log_errors" : {
> "entry"   : "PHP/log_errors",
> "value"   : "On"
> }
> }
> }
>
>
> hiera/common.json:
>
> {
> "php::augeas" : {
> "php-date_timezone" : {
> "entry"   : "Date/date.timezone",
> "value"   : "America/New_York"
> },
> "php-short_open_tag" : {
> "entry"   : "PHP/short_open_tag",
> "value"   : "On"
> },
> "php-error_log" : {
> "entry"   : "PHP/error_log",
> "value"   : "/var/log/php/php_error.log"
> }
> }
> }
>
>
> In this configuration, *only  "php-allow_url_fopen" **from the top-level
> nodes hash is returned*. If I remove that nodes/sandbox1.json, it only
> returns the "php-log_errors" from the next "roles" hiera level down.
> Finally, if the nodes and roles json's are removed it will apply all three
> from the common.json hash.
>
> I have tried both native and deeper merge behaviors with the same result.
> The strangest thing is that the hiera command line tool on the master
> returns the correct hash:
>
> # hiera -h php::augeas ::hostname=sandbox1 ::role=sandbox -c
> /etc/puppet/hiera.yaml
>
> {"php-date_timezone"=>
>   {"entry"=>"Date/date.timezone", "value"=>"America/New_York"},
>  "php-short_open_tag"=>{"entry"=>"PHP/short_open_tag", "value"=>"On"},
>  "php-error_log"=>
>   {"entry"=>"PHP/error_log", "value"=>"/var/log/php/php_error.log"},
>  "php-log_errors"=>{"entry"=>"PHP/log_errors", "value"=>"On"},
>  "php-allow_url_fopen"=>{"entry"=>"PHP/allow_url_fopen", "value"=>"On"}}
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/96454179-6cd7-4c54-9ec2-2bf553e319a9%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CACzr%3DFdpKn-AdW7Qpc9H43NNZZvNMfV9EOB%3D_ut4KLSxTzt4LA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: Puppet Dashboard Radiator view thru iframe

2014-02-26 Thread brettsw...@gmail.com
Got an answer directly as google showed this/my message as deleted. Firefox 
extension to show websites in a grid was the solution.  

Or stagger two Firefox browsers lol 

High tech! :)




Brett
Sent from my iPhone 


> On Feb 26, 2014, at 14:19, Brett Swift  wrote:
> 
> did you ever solve this?  I just tried the same setup - no luck. 
> 
> 
>> On Monday, 14 October 2013 12:20:26 UTC-6, Matt Shields wrote:
>> Is it possible to create an iframe in an html page and display the Radiator 
>> view in the Puppet Dashboard?  For some reason all my other NOC iframe's are 
>> displaying with the exception of the Radiator view
>> 
>> Matt
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Puppet Users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/puppet-users/Jw0-kwZD0WI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/bcb5c97d-56f8-4847-82ab-8cc033b3b8a7%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/683CC73E-6C07-4D43-93C6-5B6388CB5A67%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Hiera isn't merging hashes

2014-02-26 Thread paul . lewis
I have been doing some experimenting with Puppet + Hiera with some of my 
hashes, but when it is going through my hierarchy it is returning whatever 
hash it hits first and skipping the others.

For my node 'sandbox1'

sandbox.pp:

node /^sandbox\d+/ {
  class { 'php':}
  notify { 'PHP hash':
message => hiera('php::augeas',{})
  }
  $php_settings = hiera('php::augeas',{})
  create_resources('php::augeas',$php_settings)
}


hiera.yaml:

---
:backends:
  - json
:json:
  :datadir: /etc/puppet/hiera
:merge_behavior: "deeper"
:hierarchy:
  - "nodes/%{::hostname}"
  - "roles/%{::role}"
  - "provider/%{::provider}"
  - "provider/%{::provider}/virtual/virtual_%{::is_virtual}"
  - common


hiera/nodes/sandbox1.json:

{
"php::augeas" : {
"php-allow_url_fopen" : {
"entry"   : "PHP/allow_url_fopen",
"value"   : "On"
}
}
}


hiera/roles/sandbox.json:

{
"php::augeas" : {
"php-log_errors" : {
"entry"   : "PHP/log_errors",
"value"   : "On"
}
}
} 


hiera/common.json:

{
"php::augeas" : {
"php-date_timezone" : {
"entry"   : "Date/date.timezone",
"value"   : "America/New_York"
},
"php-short_open_tag" : {
"entry"   : "PHP/short_open_tag",
"value"   : "On"
},
"php-error_log" : {
"entry"   : "PHP/error_log",
"value"   : "/var/log/php/php_error.log"
}
}
} 


In this configuration, *only  "php-allow_url_fopen" **from the top-level 
nodes hash is returned*. If I remove that nodes/sandbox1.json, it only 
returns the "php-log_errors" from the next "roles" hiera level down. 
Finally, if the nodes and roles json's are removed it will apply all three 
from the common.json hash.

I have tried both native and deeper merge behaviors with the same result. 
The strangest thing is that the hiera command line tool on the master 
returns the correct hash:

# hiera -h php::augeas ::hostname=sandbox1 ::role=sandbox -c 
/etc/puppet/hiera.yaml

{"php-date_timezone"=>
  {"entry"=>"Date/date.timezone", "value"=>"America/New_York"},
 "php-short_open_tag"=>{"entry"=>"PHP/short_open_tag", "value"=>"On"},
 "php-error_log"=>
  {"entry"=>"PHP/error_log", "value"=>"/var/log/php/php_error.log"},
 "php-log_errors"=>{"entry"=>"PHP/log_errors", "value"=>"On"},
 "php-allow_url_fopen"=>{"entry"=>"PHP/allow_url_fopen", "value"=>"On"}}


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/96454179-6cd7-4c54-9ec2-2bf553e319a9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] ensure user and group created

2014-02-26 Thread Tim Dunphy
Hey all,

 I've created a puppet module to control LDAP in my environment. The ldap
packages on both the centos and ubuntu hosts seem to require a user and
group called 'ldap' (respectively).

in my ldap::install class I have the following defined:

user { "ldap":
ensure => present,
  }

  group { "ldap":
ensure => present,   }


But on each puppet run after the user and group is created the following
error occurs:

err: /Stage[main]/Ldap::Install/User[ldap]/ensure: change from absent to
present failed: Could not create user ldap: Execution of '/usr/sbin/usera
dd -M ldap' returned 9: useradd: group ldap exists - if you want to add
this user to that group, use -g.

Is there any way to achieve being able to create this user and group and
avoid the error on each run thereafter?

Thanks
Tim

-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAOZy0emKOwegFtsqftuue9x5EgTLK3ZYUUDzNj%2B1iR9i0CzVpw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Puppet Dashboard Radiator view thru iframe

2014-02-26 Thread Brett Swift
did you ever solve this?  I just tried the same setup - no luck. 


On Monday, 14 October 2013 12:20:26 UTC-6, Matt Shields wrote:
>
> Is it possible to create an iframe in an html page and display the 
> Radiator view in the Puppet Dashboard?  For some reason all my other NOC 
> iframe's are displaying with the exception of the Radiator view
>
> Matt
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/bcb5c97d-56f8-4847-82ab-8cc033b3b8a7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] puppet agent SRC for AIX?

2014-02-26 Thread Ryan Anderson
Has anyone successfully created a puppet agent SRC (system resource 
controller) for AIX? It is an AIX-specific subsystem like Solaris SMF or 
traditional sysV init, but with more bells 'n whistles. I've created them, 
and can start up the puppet agent successfully, but status and stop do not 
work. I've tried these two variations with the same effect:

mkssys -s puppet -p /opt/freeware/bin/ruby -u 0 -a 
"/opt/freeware/bin/puppet agent --verbose" -R -S -f 9 -n 15 -G puppet_agent
mkssys -s puppet -p /opt/freeware/bin/puppet -u 0 -a "agent --verbose" -R 
-S -f 9 -n 15 -G puppet_agent

Any pointers appreciated. If I can't get this to work, I will just setup a 
sysV init script instead, but it would like to make one more go at a SRC.


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/62bceace-7f55-4c61-bb91-0d6e59566f82%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] debugging puppet/hiera-eyaml decryption problems?

2014-02-26 Thread Christopher Wood
I am getting this error with a manifest run in puppet:

Feb 26 12:05:46 cwt1 puppet-master[30680]: Hiera eyaml backend: Unable to 
decrypt hiera data. Do the keys match and are they the same as those used to 
encrypt?

Unfortunately I get that same line with no additional details with "puppet 
master --debug". The keys haven't been changed on disk since yesterday and I 
definitely used them to encrypt the value with "eyaml edit". They are pkcs7 
format keys.

Do any of you know how I would get more verbose debugging out of this thing? 
Conversely, if you've gotten this working what did you have to do?



More details:

As with other people, I am able to "eyaml edit" and "eyaml decode" the yaml 
file in question. (I need my current working directory as /etc/puppet or to use 
the --pkcs7-public-key and --pkcs7-private-key parameters.)

This is my /etc/puppet/hiera.yaml eyaml section:

--
:backends:
  - eyaml

:eyaml:
  :datadir: '/etc/puppet/environments/%{environment}/hieradata'
  :private_key: '/etc/puppet/keys/private_key.pkcs7.pem'
  :public_key: '/etc/puppet/keys/public_key.pkcs7.pem'
  :pkcs7_private_key: '/etc/puppet/keys/private_key.pkcs7.pem'
  :pkcs7_public_key: '/etc/puppet/keys/public_key.pkcs7.pem'
--

It looks like private_key/public_key pkcs7_private_key/pkcs7_public_key are 
used by puppet and command-line hiera respectively. I do get different errors 
when I move the files or comment out some of those lines, implying that puppet 
can find the actual key files and read them.

The puppet user can definitely read those files:

-bash-4.1$ id
uid=52(puppet) gid=52(puppet) groups=52(puppet) 
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
-bash-4.1$ cat /etc/puppet/keys/private_key.pkcs7.pem >/dev/null
-bash-4.1$ cat /etc/puppet/keys/public_key.pkcs7.pem >/dev/null
-bash-4.1$ 

Everything is fine when I'm not using encrypted values.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20140226181839.GA25494%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Best practices: client/server VS Git

2014-02-26 Thread Julien Deloubes
Very interesting , thanks for your feedbacks.

Le mardi 25 février 2014 15:09:43 UTC+1, Ken Barber a écrit :
>
> > This is the approach we are currently taking and it allows you to use 
> > virtual resources. This is the only thing which should drive you to this 
> > setup - the other is much simpler in my opinion. Of course there might 
> > be a way to use a central PuppetDB service in masterless setup but at 
> > least I am unaware of how to do this. 
>
> It is possible: 
>
> http://docs.puppetlabs.com/puppetdb/1.6/connect_puppet_apply.html 
>
> ken. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9ee26935-c8d8-4b99-8901-6fde6173f294%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Provider macports is not functional on this host error

2014-02-26 Thread Pascal Robert
Hi,

I'm working on our first Puppet deployment, and one of the things we want 
to install is the NRPE (Nagios agent) on our CentOS, Ubuntu and OS X boxes. 
The problem is: MacPorts don't get installs, and I get:

Error: /Stage[main]/Nagios/Package[${nagios_plugins}]: Provider macports is 
not functional on this host
Error: /Stage[main]/Nagios/Package[${$nrpe}]: Provider macports is not 
functional on this host
Error: /Stage[main]/Macosx/Package[smartmontools]: Provider macports is not 
functional on this host

Structure:

site.pp:

node 'agent-puppet-os-x.local' {
  include macosx
  
  file_line { 'apple raid':
ensure => present,
line   => 
'command[check_raid]=/opt/local/libexec/nagios/check_apple_raid 
0B6D5A7C-7EF1-4775-8F73-9D8EB912560E',
path   => '/opt/local/etc/nrpe/nrpe.cfg',
require => Package['nrpe'],
  }
}

modules/macosx/manifests/init.pp:

class macosx {

  include macosx::macports
  include nagios::client

}

modules/macosx/manifests/macports.pp:

class macosx::macports {

  package { 'CommandLineTools':
ensure=> installed, 
provider  => pkgdmg, 
source=> "http://192.168.1.157/CommandLineTools_10_8.dmg";, 
  } 

  package { 'macports':
ensure=> installed, 
provider  => pkgdmg, 
source=> 
"https://distfiles.macports.org/MacPorts/MacPorts-2.2.1-10.8-MountainLion.pkg";, 
require   => Package['CommandLineTools'],
before=> Package['nrpe','nagios-plugins'],
  } 

}

modules/macosx/nagios/init.pp:

class nagios {

  include macosx::macports

  $provider = $operatingsystem ? {
ubuntu=> 'apt',
centos=> 'yum',
darwin=> 'macports',
default   => 'yum'
  }

  package { '${$nrpe}':
ensure=> installed,
alias => 'nrpe',
provider  => $provider,
  }

}


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9bbabee7-d2c9-47dc-90f9-533f4bc01b7b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: How to purge and install package on same run?

2014-02-26 Thread jcbollinger


On Tuesday, February 25, 2014 8:17:56 AM UTC-6, kbrede wrote:
>
> I've got a situation where I need to remove a set of packages and then 
> install the upgraded versions.  I can't just upgrade.  It's rare that I 
> have to upgrade the software but I'd like to have something in place to 
> upgrade when I have to.  What's the best way to handle these types of 
> situations with Puppet?
>


The best way is to use decent packages, which for this purpose means ones 
that don't require previous versions to be removed first.  Packages that do 
not support that are fairly rare, even on Windows, which overall has 
sub-par package management capabilities (through no fault of Puppet's).

 

>
> Is there anyway to force $purge_pkgs to run and then have $install_pkgs 
> run after on the same run?
>


You can tell puppet to apply some resources before others, but you cannot 
put two resources of the same type and having the same name or title into 
the same catalog.

 

>   As written below, I think what happens is the packages are uninstalled 
> but when the compile runs, $install_pkgs are already installed, so it does 
> nothing.   
>


Nope.  What happens is one of these things:

   - None of the packages in $install_pkgs is also in $purge_pkgs (and note 
   that these need to be single package names or arrays, not delimited lists)
   - $upg != 'yes'
   - Catalog compilation fails.  Either no catalog or a cached catalog is 
   applied.
   
If the packages to be purged and those to be installed all have different 
names, then you have a comparatively simple problem.  You can use 
relationship (chaining) arrows together with resource collectors to declare 
that Puppet should perform the purges before the installs.

If you want to purge and then reinstall the same package in the same run, 
then I suggest you give up using Package resources for any of it.  Use one 
or more Execs for the whole thing, instead.


John

 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/a5a34299-2d8b-49d3-bcbd-45c4e455525f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Condition on class existence on agent

2014-02-26 Thread zerozerounouno
On Wednesday, February 26, 2014 2:47:32 PM UTC+1, nikolavp wrote:
 

> What is the reason for the definition of those classes on the same host? 
>

That's because I have some more general "role A" to which some hosts 
belong, but I also have "role B" which is some sort of further 
specification of role A, and host B belongs to it and thus needs a more 
specific configuration file.
 

> Can't it just be a single class with a parameter moved to hiera or


Er... I never used hiera until now.
I had a look at the doc but it seemed to me a bit overkill for this 
requirement.

something else? My other suggestion would be to create a fact that 
> changes the setting on the machine based on the fact value. 
>

Would be a good idea, but can a fact be created with a value which depends 
on puppet classes assigned to the host?
Uhm... maybe assign the fact value based on the output of a command like 
"puppet resource user "?
I'm afraid the result would be based on existence on the master again, not 
on the agent.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/7fdf4cc4-9c21-45ef-8afc-4884f927c81e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: How to use puppet modules on the forge on vagrant

2014-02-26 Thread James Stallings
http://docs.vagrantup.com/v2/provisioning/puppet_apply.html

On Monday, February 24, 2014 6:12:53 PM UTC-5, bko...@ucr.edu wrote:
>
> I am trying to use this module 
> https://forge.puppetlabs.com/puppetlabs/ntp#usage
> on vagrant but when I copy the manifests to the  puppet module path on 
> vagrant I get this error
>
> Could not find parent resource type 'ntp::params' of type hostclass in 
> production at /tmp/vagrant-puppet-1/modules-0/ntp/manifests/init.pp:1 on 
> node ubuntu
>
> params.pp is in the manifest so I have no idea whats causing this error.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/29209c6f-aea7-4f49-931e-debd59b4c12d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: puppet agent gives error undefined method `empty?' for nil:NilClass

2014-02-26 Thread jcbollinger


On Tuesday, February 25, 2014 5:17:04 PM UTC-6, Tom Hanstra wrote:
>
> I have a puppet master which has over 50 puppet agents talking to it just 
> fine.  But I have one particular server on which the agent, after 
> connecting and exchanging keys, gives the following error:
>
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> undefined method `empty?' for nil:NilClass at 
> /etc/puppet/modules/server/iptables/manifests/init.pp:7 on node 
> curatevanilla.library.nd.edu
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
>
> Having read other posts, and knowing that we do use hiera, this looks like 
> a hiera problem.
>


That's a reasonable possibility, but it's by no means the only one.  All 
the error really tells you is that at some point during compilation of the 
affected node's catalog, Puppet is running into an uninitialized Puppet 
variable.

 

>  If I comment out classes which don't use hiera, the agent will run them 
> all.  But add any in which use hiera and that will be the class which fails 
> (iptables above is just the first one it hits).
>


So that does seem to tie the problem to hiera, but it's odd that it doesn't 
matter which hiera-using class you try to use.  That suggests a problem 
with your overall hiera configuration, rather than a problem with the data 
or any particular class.

 

>
> How do I best track down where the problem really is?  I have made sure 
> that the /etc/hiera.yaml file is in place and it matches other servers 
> which work.  I've tried clearing out /var/lib/puppet on the server and 
> letting that get rebuilt.  If I move /var/lib/hiera out of the way, it does 
> not get rebuilt, probably because the download does not get that far.  Any 
> suggestions on what might allow me to find the conflict. 
>
>
Have a look at your hiera.yaml, and carefully consider any variable 
interpolations in it.  When compiling a catalog for the affected node, are 
all those variables defined?  Such interpolations are usually based on node 
facts, but maybe your node is not providing one of the needed facts.

If that doesn't yield fruit, then create a separate node block just for the 
affected node, so that you can troubleshoot without affecting management of 
your other nodes.  Then use that node block to find a minimum set of 
classes that will trigger the error (perhaps just one).  Prefer simple 
classes for this purpose over more complex ones.  That should narrow the 
scope of the problem.  You can narrow it further by figuring out based on 
one or more failing classes the minimum it takes to build a class that will 
fail.

If you are still flummoxed after figuring out what minimum combination of 
declarations causes the failure then bring it back here.  We can probably 
help work out the specifics.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d16bffa1-9bbc-47ee-afb0-13ac5ee288b0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet module template mentioned at contributor summit

2014-02-26 Thread Alessandro Franceschi
Craig,
Not sure to have understood the difference between a defaults.pp pattern 
and a params.pp pattern, given that I suppose that if there were parameters 
in the main module class of Gareth's example they would inherit values in 
params.pp exactly as the defaults example you've written.
Can be elaborate or link examples of this defaults.pp pattern?

To the list of public modules skeletons let me add this one, that follows 
stdmod naming conventions:
https://github.com/stdmod/puppet-skeleton-standard

and this alternative with Rip's data in module approach:
https://github.com/stdmod/puppet-skeleton-standard/tree/hiera

Al

On Wednesday, February 26, 2014 10:37:59 AM UTC+1, Craig Dunn wrote:
>
>
> This is cool, though I realise that it's a (self confessed) opinionated 
> module design, the only thing that really stands out for me is that it 
> follows a rather old, and limited, 'params.pp' pattern.   There is no place 
> for Hiera in this model without hard coding hiera lookup functions in the 
> classes.  Personally I think a 'defaults.pp' pattern is more sensible in 
> todays Puppet.
>
> Eg:
>
> class base (
>$parameter = $base::defaults::$parameter
> ) inherits base::defaults {
>   ...
> }
>
> class base::defaults {
>$parameter = $logic ? {
>   'foo' => 'bar'
>}
> }
>
>
> Your classes can then look up values as $base::parameter.  This allows the 
> module to default (rather than dictate) attributes based on whatever logic 
> you want to implement but allows the implementer to override the values 
> either at the resource declaration or using Hiera data mapping for 
> base::parameter.
>
> Regards
> Craig
>
>
>
> On Wed, Feb 5, 2014 at 5:38 PM, Gareth Rushgrove 
> 
> > wrote:
>
>> This came up in discussion a couple of times at the Puppet contributor
>> summit at Config Management Camp in Gent over the last couple of days
>> so I thought I'd write up.
>>
>> A while ago I put together a pretty complete/opinionated skeleton for
>> puppet modules. Especially if you're not too familiar with ruby or the
>> ruby ecosystem, or just getting started with testing it should be a
>> useful starting point.
>>
>> https://github.com/garethr/puppet-module-skeleton
>>
>> I've added a bunch more features (including a Guardfile, resource
>> coverage and support for Beaker integration tests) and got round to
>> writing up a blog post about what and why:
>>
>> http://www.morethanseven.net/2014/02/05/a-template-for-puppet-modules/
>>
>> Hopefully it's useful to a few people. Any features or issues let me know.
>>
>> Gareth
>>
>> --
>> Gareth Rushgrove
>> @garethr
>>
>> devopsweekly.com
>> morethanseven.net
>> garethrushgrove.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to puppet-users...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/CAFi_6y%2BiRQPPKk8yTLBMiHCNOsLdNFYeaPO8oTCCcuaASj6SaQ%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> *Enviatics *| Automation and configuration management
> http://www.enviatics.com | @Enviatics
> Puppet Training http://www.enviatics.com/training/
>
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/feaadcb3-cc99-45c3-825d-57ba26dc4dc0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] hiera variable and "if statements" in manifest not working

2014-02-26 Thread Kenton Brede
On Wed, Feb 26, 2014 at 8:26 AM, Felix Frank <
felix.fr...@alumni.tu-berlin.de> wrote:

> Hi,
>
> On 02/26/2014 03:18 PM, Kenton Brede wrote:
> > vmw_tools_purge:
> > - 'PURGE'
>
> not that you are defining an array here, not a string. That would look like
>
> vm_tools_purge: 'PURGE'
>
> > $vmw_tools_purge = hiera('vmw_tools_purge')
> > notify { $vmw_tools_purge: }
>
> This works because puppet helpfully converts the array to a string by
> concatenating all elements.
>
> > if $vmw_tools_purge == 'PURGE' {
>
> This would not work the same way, though. You may verify whether
>
> if $vmw_tools_purge == [ 'PURGE' ]
>
> does in fact work, but it would be a funny construct anyway. It should
> be fixed in YAML.
>

Doh!  That was it, thanks.

-- 
Kent Brede

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CA%2BnSE39%2BVBSFp5UMWhw2B9TckqqDcQ3TAJs6oG_tuVSWTj8_aQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Custom service status not working

2014-02-26 Thread jcbollinger


On Tuesday, February 25, 2014 5:31:32 PM UTC-6, Guy Knights wrote:
>
> I have a service set up with a custom status check, but when I run puppet 
> it ignores my custom status command and runs the standard upstart status 
> check. 
>
> My service definition is as follows:
>
> service { "gamedeploy-${title}":
>   ensure => running,
>   provider   => upstart,
>   start  => "/sbin/initctl start gamedeploy-${title} GAME=${game} 
> COMPONENT=${title} ENVIRONMENT=${::environment} DELAY=${delay}",
>   stop   => "/sbin/initctl stop gamedeploy-${title} 
> COMPONENT=${title}",
>   status => "/sbin/initctl status gamedeploy-${title} 
> COMPONENT=${title}",
>   hasstatus  => false,
>   hasrestart => false,
>   require=> File["gamedeploy_init_${title}"],
> }
>
> And here's the puppet debug output:
>
> Debug: Executing '/sbin/status gamedeploy-frontend'
> Debug: Executing '/sbin/initctl start gamedeploy-frontend GAME=test 
> COMPONENT=frontend ENVIRONMENT=stage DELAY=5'
> Error: Could not start Service[gamedeploy-frontend]: Execution of 
> '/sbin/initctl start gamedeploy-frontend GAME=test COMPONENT=frontend 
> ENVIRONMENT=stage DELAY=5' returned 1:
> Error: 
> /Stage[main]/Deploy/Deploy_service[frontend]/Service[gamedeploy-frontend]/ensure:
>  
> change from stopped to running failed: Could not start 
> Service[gamedeploy-frontend]: Execution of '/sbin/initctl start 
> gamedeploy-frontend GAME=test COMPONENT=frontend ENVIRONMENT=stage DELAY=5' 
> returned 1:
> Debug: Executing '/sbin/initctl start gamedeploy-frontend GAME=test 
> COMPONENT=frontend ENVIRONMENT=stage DELAY=5'
>
> As you can see, it should be using "/sbin/initctl status 
> gamedeploy-frontend COMPONENT=frontend" as the check, but instead just uses 
> "/sbin/status gamedeploy-frontend".
>
> Anyone know why?
>
>
Your Service declaration looks OK to me.  The only strange thing is that 
you are explicitly declaring a provider, which should not be necessary.

It is conceivable that the 'upstart' Service provider is buggy in this way, 
as I think custom status commands are not widely used with service managers 
that normally can rely on services to have their own (correct) status 
commands.

Do check that the catalog being applied actually contains the custom status 
command as you wanted it.  The agent caches a local copy before applying 
it, and it's YAML, so you can examine it with text-based tools.  If you 
find that your node's catalog is not as you expect then that's an 
altogether different sort of problem than if the agent behaves wrongly.

Since you are specifying all three service management commands anyway, you 
could consider switching to the 'base' provider.  If the problem is in the 
'upstart' provider then that should resolve the issue (and in that case, 
please file a ticket).

Overall, though, I still stand by my recommendation in your other thread to 
set up a separate, conformant init configuration for each distinct 
service.  You can do this without duplication of non-boilerplate code 
currently found in your single shared script.  It shouldn't be hard to do, 
and once done I see only upside relative to what you are doing now.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8784cbc9-f334-4f5e-a5fd-878281ba6fb8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] hiera variable and "if statements" in manifest not working

2014-02-26 Thread Felix Frank
Hi,

On 02/26/2014 03:18 PM, Kenton Brede wrote:
> vmw_tools_purge:
> - 'PURGE'

not that you are defining an array here, not a string. That would look like

vm_tools_purge: 'PURGE'

> $vmw_tools_purge = hiera('vmw_tools_purge')
> notify { $vmw_tools_purge: }

This works because puppet helpfully converts the array to a string by
concatenating all elements.

> if $vmw_tools_purge == 'PURGE' {

This would not work the same way, though. You may verify whether

if $vmw_tools_purge == [ 'PURGE' ]

does in fact work, but it would be a funny construct anyway. It should
be fixed in YAML.

Regards,
Felix

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/530DF98D.4060403%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] hiera variable and "if statements" in manifest not working

2014-02-26 Thread Kenton Brede
So I've got a variable set in Hiera:

---
vmw_tools_purge:
- 'PURGE'

In the manifest, the following works fine:

$vmw_tools_purge = hiera('vmw_tools_purge')
notify { $vmw_tools_purge: }

But this does not work.  The "if statement" is just ignored and notify
isn't triggered.  What am I doing wrong?

if $vmw_tools_purge == 'PURGE' {
notify { $vmw_tools_purge: }
}

Thanks,

-- 
Kent Brede

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CA%2BnSE38yx9srQ-R6e-J%2Bd10Yg4s-Tccm8prJkNL7k%2BBM1_SF%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: notify on agent from puppet function

2014-02-26 Thread jcbollinger


On Tuesday, February 25, 2014 10:50:51 AM UTC-6, bazil wrote:
>
> Unfortunately, the message could be computed only in function. Do I 
> understand correctly that it is impossible to push Notify in catalog from 
> function during compilation.
>
>

No, you do not:

notify { 'a-message-from-our-sponsors':
  message => my_function($the_data)
}

The potential issue is not about the means of computing the message, it is 
about where the computation is performed, and a bit about when.  In 
particular, if the point of using a function is for it to use data or 
software available only on the target node, or to modify the target node 
directly, then the fact that Puppet custom functions are evaluated on the 
master will render your plan inoperable.

Similarly, if you need the computation to be performed only after one or 
more resources have been applied to the target node, then a Puppet custom 
function cannot help you.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/917fb6e8-300d-498a-ba23-1fa7022b6850%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Condition on class existence on agent

2014-02-26 Thread Nikola Petrov
Hmm not sure what but there is something smelly here going on...

What is the reason for the definition of those classes on the same host?
Can't it just be a single class with a parameter moved to hiera or
something else? My other suggestion would be to create a fact that
changes the setting on the machine based on the fact value.

-- 
Nikola

On Wed, Feb 26, 2014 at 05:25:39AM -0800, zerozerouno...@gmail.com wrote:
> Hi,
> how can I create a condition based on the presence of a specific puppet 
> class on the host?
> 
> I'm using Foreman, some hosts have myclass_a applied, while others have 
> myclass_a AND myclass_b.
> Resources in myclass_b are applied after resources in myclass_a.
> 
> Both classes change a parameter inside a configuration file, using augeas. 
> But this causes two changes in the file on each puppet run (from state b to 
> a, and then from state a to b again).
> 
> So I'm trying to do something like this, to prevent myclass_a from applying 
> the modification if also myclass_b is present:
> 
> class myname::myclass_a {
> 
>   if defined("myname::myclass_b") {
> $confchanges = [
>  'set anotherpath_b anothervalue_b', # if class B is 
> present, I only apply my specific edits
> ]
>   }
>   else {
> $confchanges = [
>  'set anotherpath_b anothervalue_b',
>  'set mypath myvalue_a', # if class B is absent, I also 
> apply the conflicting edit
> ]
>   }
> 
>   augeas { 'myconffile_a':
> lens=> 'Puppet.lns',
> incl=> '/etc/myconf.conf',
> changes => $confchanges,
>   }
> 
> }
> 
> class myname::myclass_b {
> 
>   augeas { 'myconffile_b':
> lens=> 'Puppet.lns',
> incl=> '/etc/myconf.conf',
> changes => 'set mypath myvalue_b',
>   }
> 
> }
> 
> ...but this does not work, it never gets to the "else" section. Probably 
> because the "defined" function is evaluated on the puppet master, where the 
> class always exists.
> 
> I cannot use a condition on the existence of the "myconffile_b" resource, 
> because this is parse order dependent and would always return false when 
> evaluated inside myclass_a.
> 
> Any suggestions?
> I'm looking into alternatives like virtual resources or defined types, but 
> I cannot see anything better suited at the moment.
> 
> Thanks.
> Marco
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/6d3c91d0-f70a-45dc-8dfe-d9309570425c%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20140226134732.GK26036%40nikolavp-desktop.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Condition on class existence on agent

2014-02-26 Thread zerozerounouno
Hi,
how can I create a condition based on the presence of a specific puppet 
class on the host?

I'm using Foreman, some hosts have myclass_a applied, while others have 
myclass_a AND myclass_b.
Resources in myclass_b are applied after resources in myclass_a.

Both classes change a parameter inside a configuration file, using augeas. 
But this causes two changes in the file on each puppet run (from state b to 
a, and then from state a to b again).

So I'm trying to do something like this, to prevent myclass_a from applying 
the modification if also myclass_b is present:

class myname::myclass_a {

  if defined("myname::myclass_b") {
$confchanges = [
 'set anotherpath_b anothervalue_b', # if class B is 
present, I only apply my specific edits
]
  }
  else {
$confchanges = [
 'set anotherpath_b anothervalue_b',
 'set mypath myvalue_a', # if class B is absent, I also 
apply the conflicting edit
]
  }

  augeas { 'myconffile_a':
lens=> 'Puppet.lns',
incl=> '/etc/myconf.conf',
changes => $confchanges,
  }

}

class myname::myclass_b {

  augeas { 'myconffile_b':
lens=> 'Puppet.lns',
incl=> '/etc/myconf.conf',
changes => 'set mypath myvalue_b',
  }

}

...but this does not work, it never gets to the "else" section. Probably 
because the "defined" function is evaluated on the puppet master, where the 
class always exists.

I cannot use a condition on the existence of the "myconffile_b" resource, 
because this is parse order dependent and would always return false when 
evaluated inside myclass_a.

Any suggestions?
I'm looking into alternatives like virtual resources or defined types, but 
I cannot see anything better suited at the moment.

Thanks.
Marco

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/6d3c91d0-f70a-45dc-8dfe-d9309570425c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Hiera to define an array of packages that should be installed

2014-02-26 Thread Richard Fussenegger
Right now my init.pp contains the following code block:

package { [ 'package-1', 'package-2', '...' ]:
  ensure => 'present',
  require => *Exec*['apt_update'],
}

This works great — no problem there — but I'd love to use a single init.ppfor 
production and development and control the behavior of everything via 
my Hiera files. This would also allow me to exchange some packages 
depending on the operating system without writing modules for simple 
package installations. I tried a few things and searched for answers; 
without luck.

Maybe you guys have an idea on how to solve this.

Regards
Richard

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8e7e2a29-287a-4f2b-b1e3-dcb673ec497f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Get Fedora 19 client working with CentOS 6.4 master

2014-02-26 Thread xbglowx


I have a CentOS 6.4 puppet masters that has 
puppet-server-3.3.1-1.el6.noarch installed. I am trying to get a puppet 
client fedora19 working, which has puppet-3.3.1-1.fc19.noarch installed.

If I run puppet agent:

/usr/bin/puppet agent --onetime --no-daemonize --verbose 
--server= --environment=development --tags  
--color=false

I get a bunch of "incorrect header check" like the following during my 
puppet runs:

Error: /File[/var/lib/puppet/lib/puppet/parser/functions/gsub.rb]/ensure: 
change from absent to file failed: Could not set 'file' on ensure: 
incorrect header check
Error: Could not set 'file' on ensure: incorrect header check
Error: Could not set 'file' on ensure: incorrect header check
Wrapped exception:
incorrect header check
Error: 
/File[/var/lib/puppet/lib/puppet/provider/database_grant/mysql.rb]/ensure: 
change from absent to file failed: Could not set 'file' on ensure: 
incorrect header check
Error: Could not set 'file' on ensure: incorrect header check
Error: Could not set 'file' on ensure: incorrect header check
Wrapped exception:
incorrect header check
Error: 
/File[/var/lib/puppet/lib/puppet/parser/functions/values_at.rb]/ensure: 
change from absent to file failed: Could not set 'file' on ensure: 
incorrect header check
Error: Could not set 'file' on ensure: incorrect header check
Error: Could not set 'file' on ensure: incorrect header check
Wrapped exception:
incorrect header check
Error: /File[/var/lib/puppet/lib/puppet/parser/functions/getvar.rb]/ensure: 
change from absent to file failed: Could not set 'file' on ensure: 
incorrect header check
Error: Could not set 'file' on ensure: incorrect header check
Error: Could not set 'file' on ensure: incorrect header check

Not sure where to go from here. I see the respective files on the puppet 
master, but not sure what is going on under the cover.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/2a7637d3-ba56-4cb1-af4d-44645ff9516f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Puppet for ubuntu

2014-02-26 Thread Gokul Skumar
Hi,

I am trying to setup puppet master and agent in Ubuntu(VM). Please help 
with setup details.

1. Installed Virtual box and connected with Ubuntu
2.Installed puppet as master.

When i trying to connect web console, not working.I believe some config 
needs update.

Please help on this.

 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d794fa8a-20d4-4310-ad84-028e9d00ccea%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet module template mentioned at contributor summit

2014-02-26 Thread Craig Dunn
This is cool, though I realise that it's a (self confessed) opinionated
module design, the only thing that really stands out for me is that it
follows a rather old, and limited, 'params.pp' pattern.   There is no place
for Hiera in this model without hard coding hiera lookup functions in the
classes.  Personally I think a 'defaults.pp' pattern is more sensible in
todays Puppet.

Eg:

class base (
   $parameter = $base::defaults::$parameter
) inherits base::defaults {
  ...
}

class base::defaults {
   $parameter = $logic ? {
  'foo' => 'bar'
   }
}


Your classes can then look up values as $base::parameter.  This allows the
module to default (rather than dictate) attributes based on whatever logic
you want to implement but allows the implementer to override the values
either at the resource declaration or using Hiera data mapping for
base::parameter.

Regards
Craig



On Wed, Feb 5, 2014 at 5:38 PM, Gareth Rushgrove
wrote:

> This came up in discussion a couple of times at the Puppet contributor
> summit at Config Management Camp in Gent over the last couple of days
> so I thought I'd write up.
>
> A while ago I put together a pretty complete/opinionated skeleton for
> puppet modules. Especially if you're not too familiar with ruby or the
> ruby ecosystem, or just getting started with testing it should be a
> useful starting point.
>
> https://github.com/garethr/puppet-module-skeleton
>
> I've added a bunch more features (including a Guardfile, resource
> coverage and support for Beaker integration tests) and got round to
> writing up a blog post about what and why:
>
> http://www.morethanseven.net/2014/02/05/a-template-for-puppet-modules/
>
> Hopefully it's useful to a few people. Any features or issues let me know.
>
> Gareth
>
> --
> Gareth Rushgrove
> @garethr
>
> devopsweekly.com
> morethanseven.net
> garethrushgrove.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAFi_6y%2BiRQPPKk8yTLBMiHCNOsLdNFYeaPO8oTCCcuaASj6SaQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
*Enviatics *| Automation and configuration management
http://www.enviatics.com | @Enviatics
Puppet Training http://www.enviatics.com/training/

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CACxdKhFbERo4%3DqREz_MCbGAjaYfLe2WNfN_-zPAupG3Ryz6DOg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: Does r10k play nicely with Puppet Enterprise gems?

2014-02-26 Thread Steven James
Another r10k related question - is repo sync (or will repo sync) from SVN
be supported?

There appears to be some evidence that it was in the codebase a while back,
but may have been removed e.g. https://github.com/adrienthebo/r10k/issues/58

If no SVN support now, I suppose alternate workaround may be to install
https://github.com/drrb/puppet-library to act as a local Forge repo,
publishing our modules there for Puppetfile to find?

e.g.

forge 'forge.internalmydomain.com'

# Install joeblow-module from the local Forge
mod 'joeblow/module', '2.5.1'

Your feedback appreciated!


Thanks

Steven


On Wed, Feb 26, 2014 at 4:56 PM, Steven James <
pullingthestrings...@gmail.com> wrote:

> Thanks Adrien!
>
> On Wednesday, February 26, 2014 10:41:28 AM UTC+11, Adrien Thebo wrote:
>>
>> Hi Steven,
>>
>> I'm glad that you've found r10k useful!
>>
>> r10k has pretty a lightweight set dependencies that should play nicely
>> with the rest of Puppet Enterprise, and it's important to me that r10k can
>> easily be installed and behave well in PE. I know that r10k is frequently
>> deployed in PE environments and I haven't heard of any issues with r10k
>> that are due to being installed in the PE rubygems environment. Installing
>> r10k via `/opt/puppet/bin/gem install r10k` should work, and Zack Smith's
>> r10k module has first class support for PE (https://github.com/acidprime/
>> r10k/blob/master/manifests/params.pp#L29-L39) which are pretty
>> encouraging indications that it should work well for you if you install it
>> into the PE stack.
>>
>>
>> On Tuesday, February 25, 2014 2:06:42 AM UTC-8, Steven James wrote:
>>>
>>> As r10k is a gem install, and has quite a few gem dependenciesdoes
>>> anybody know if it plays nicely with Puppet Enterprise?
>>>
>>> As long as I use PE's /opt/puppet/bin/{bundle,rake} when doing the
>>> builds, should all be fine?
>>>
>>> Anybody have any stories or woe and dispair, or just lots of associated
>>> happiness?
>>>
>>> Thanks for your input!
>>>
>>> StevenJ
>>> PS R10Kwell done Adrien! Great product!
>>>
>>>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Puppet Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/puppet-users/GFXaLYXZOgI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/d36eb856-69c6-4465-8420-e74c1a59ecd3%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAB_ORUvGyu60%3DRL0XMRpgmp1NPwRNejZ-OJ0FGc91fvENGEd_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.