[Puppet Users] Re: seeing too many change messages.

2014-01-22 Thread Muhammad Yousuf Khan


On Tuesday, January 21, 2014 7:18:42 PM UTC+5, jcbollinger wrote:
>
>
>
> On Monday, January 20, 2014 8:25:18 AM UTC-6, Muhammad Yousuf Khan wrote:
>>
>> hello guys, 
>>
>> i am  new to puppet and few days back have installed motd module for 
>> testing this is my first module working great however i just see too many 
>> change messages since the day motd module has installed. 
>> this is what i see in all the messages
>> this message showed up as CHANGE in every agent run. on both puppet 
>> server and puppet client. 
>> notice  content changed '{md5}2efaxxb992815fe4852f6912' to 
>> '{md5}9f50436d1a3836baa8b'  
>> /Stage[main]/Motd/File[/etc/motd]/content  
>> /etc/puppetlabs/puppet/modules/motd/manifests/init.pp
>>
>> i have made some changes in below init.pp file. 
>> /etc/puppetlabs/puppet/modules/motd/manifests/init.pp
>>
>> do you guys think all those change event logs are fine?
>>
>>
>
> Probably not.  You don't seem to grasp what Felix is trying to tell you: 
> the log shows Puppet modifying one of the manifest files that describe to 
> it the target state of your nodes.  That's surely not the responsibility of 
> a motd module, and it would be a highly suspect behavior in *any*module.  I 
> have never heard a good use case for Puppet managing its own 
> manifests, and if there is one then it is by no means something a Puppet 
> newbie should be playing with.  The only file a well-made motd module 
> should manage is /etc/motd.
>
> As for frequency of change messages, you will get such messages in the log 
> every time Puppet changes something.  If it changes a given file every run, 
> then you will get such messages every run.  One of the traps that folks 
> sometimes fall into is putting a dynamic modification timestamp in managed 
> file content.  That causes the file to be modified on every run, if only to 
> update the timestamp.
>
>  

> If you post you 'motd' class then we will have something concrete to talk 
> about.
>
>
sorry i think i totally mess up the thread please forgive me as i am very 
new and trying to learn whole puppet structure which is kinda confusing me. 
and i i am motivated and with your guidance/advices i will achieve my 
required goal.

here is what i did.
1- i installed motd module.
2- i neno :/etc/puppetlabs/puppet/modules/motd/templates# nano motd.erb
here is my motd.erb look like.

The operating system is <%= operatingsystem %>
The free memory is <%= memoryfree %>
The domain is <%= domain %>
In case of any problem please consult your TL.
# i added this list line. for testing

3 -  i didnt made any change anything in manifests, here is my init.pp 

# Class: motd
#
# This module manages the /etc/motd file using a template
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#  include motd
#
# [Remember: No empty lines between comments and class definition]
class motd {
  if $kernel == "Linux" {
file { '/etc/mo# Class: motd
#
# This module manages the /etc/motd file using a template
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#  include motd
#
# [Remember: No empty lines between comments and class definition]
class motd {
  if $kernel == "Linux" {
file { '/etc/motd':
  ensure  => file,
  backup  => false,
  content => template("motd/motd.erb"),
}
  }
}

now here is my report which shows every puppet run sucessfully change 
something which i think is quite unnesassory since one change is updated i 
think there is no need to reupdate the change when nothing is actually 
change.
[image: Changed] 2014-01-22 08:55 
UTC 
puppet..com
 
194 0 1 193 0 0 0 10.42 s 29.74 s  [image: Changed] 2014-01-22 08:52 
UTC 
puppetagent..com
 
85 0 1 84 0 0 0 2.59 s 3.12 s  [image: Unchanged] 2014-01-22 08:25 
UTC 
puppet.xxx.com
 
194 0 0 194 0 0 0 7.63 s 29.17 s  [image: Changed] 2014-01-22 08:22 
UTC 
puppetagen.xxx.com
 
85 0 1 84 0 0 0 1.97 s 2.46 s  [image: Unchanged] 2014-01-22 07:55 
UTC 
puppet.xxx.com
 
194 0 0 194 0 0 0 7.80 s 26.62 s  [image: Changed] 2014-01-22 07:52 
UTC 
puppetagent.xxx.com
 
85 0 1 84 0 0 0 2.17 s 2.83 s  [image: Unchanged] 2014-01-22 07:25 
UTC 
puppet.xxx

Re: [Puppet Users] Re: seeing too many change messages.

2014-01-22 Thread Felix Frank
Hi,

On 01/22/2014 10:04 AM, Muhammad Yousuf Khan wrote:
> The free memory is <%= memoryfree %>

the $memoryfree fact is bound to have a different value on each puppet
run, I think.

Try and remove this line from your template.

HTH,
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/52DF8A80.2010600%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: Subquery, regular query difference?

2014-01-22 Thread ak0ska
Just did: https://tickets.puppetlabs.com/browse/PDB-341


On Tuesday, January 21, 2014 6:37:19 PM UTC+1, Ken Barber wrote:
>
> Yeah, that looks like a bug Akos. Can you file it? 
>
> On Tue, Jan 21, 2014 at 2:49 PM, jcbollinger 
> > 
> wrote: 
> > 
> > 
> > On Monday, January 20, 2014 9:17:39 AM UTC-6, ak0ska wrote: 
> >> 
> >> Hello, 
> >> 
> >> We wanted to created a query, which would check the hostgroup fact of 
> >> machines that apply a certain type of resource declared in a certain 
> >> manifest file. We wanted to use the 'select-resources' subquery as 
> follows: 
> >> 
> >> curl -G -H "Accept: application/json" localhost:8080/v3/facts 
> >> --data-urlencode 'query=["and",["=","name","hostgroup"], 
> >> ["in","certname",["extract","certname", ["select-resources", 
> ["and",["=", 
> >> "type", "Class"],["=","file","/path/to/mymanifest.pp"]]' 
> >> 
> >> This returns an error: "file is not a queryable object for resources". 
> >> According to the documentation, 'select-resources' takes any arguments 
> >> valid for /v3/resources endpoint. 
> >> 
> >> If we try the arguments of 'select-resources' directly to the resources 
> >> endpoint, we get valid results: 
> >> 
> >> curl -G -H "Accept: application/json" localhost:8080/v3/resources 
> >> --data-urlencode 'query=["and",["=", "type", 
> >> "Class"],["=","file","/path/to/mymanifest.pp"]]' 
> >> 
> >> lists all 'Class' type resources (and properties)  declared in 
> >> mymanifest.pp. 
> >> 
> >> If we try and query the "title" property, instead of the "file" 
> property 
> >> it works fine. Did we miss something? 
> > 
> > 
> > 
> > I read the docs the same way you do, and on that basis I see nothing 
> wrong 
> > with your query.  I would file a ticket. 
> > 
> > 
> > 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...@googlegroups.com . 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/puppet-users/3d02804b-7306-4671-a823-c40263448130%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/73834025-abab-4e22-a90b-93409e572139%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: seeing too many change messages.

2014-01-22 Thread Muhammad Yousuf Khan


On Wednesday, January 22, 2014 2:08:16 PM UTC+5, Felix.Frank wrote:
>
> Hi, 
>
> On 01/22/2014 10:04 AM, Muhammad Yousuf Khan wrote: 
> > The free memory is <%= memoryfree %> 
>
> the $memoryfree fact is bound to have a different value on each puppet 
> run, I think. 
>
Try and remove this line from your template. 
>
>
Thanks it resolved the issue. but i also learn something more, first i 
thought "<%= memoryfree %> " and other variables were directly written into 
the client "/etc/motd" and clients are responsible to replace the actual 
value with variable not puppet master.
however i was wrong. it seems like. first puppet master collect the 
information from all the client against these variable and then 
distributing it according to the value to every client node. please correct 
me if i am wrong. 
Thanks for your help.

MYk



 

> HTH, 
> 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/aedec8c7-e4a6-441c-aa00-679cb89d9f99%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: seeing too many change messages.

2014-01-22 Thread Felix Frank
Hi,

that's pretty much correct. Only to clarify, this is what happens when
the agent contacts the master:

1. the agent requests plugins (if pluginsync is enabled)
 -> this may introduce new fact code to the agent
2. the agent gathers all facts about its local machine (see facter)
3. the agent sends all facts to the master, and the master can use these
during compilation, both in templates and manifests
4. the master sends a catalog, including file contents generated from
templates
5. the agent verifies that the system state is synchronous with the
catalog specification, and performs update actions if there are
discrepancies

Hope this makes sense,
Felix

On 01/22/2014 11:46 AM, Muhammad Yousuf Khan wrote:
> however i was wrong. it seems like. first puppet master collect the
> information from all the client against these variable and then
> distributing it according to the value to every client node. please
> correct me if i am wrong.
> Thanks for your help.
> 
> MYk

-- 
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/52DFA29E.9010104%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Spacing in attributes

2014-01-22 Thread zerozerounouno
On Tuesday, January 21, 2014 4:05:48 PM UTC+1, jcbollinger wrote:
 

> Possible alternative explanations:
>
>- You are quoting the parameter name (which is fine), and at least 
>some of the added whitespace is going inside the quotes.  "ip " => 
>"192.168.1.1"
>- You are inserting at least one character different from those 
>enumerated above between the parameter name and comma.  There are several 
>that are normally rendered as a span of empty space, and there are many 
>others that normally are not rendered at all.  None of those is considered 
>whitespace for the DSL's purposes, but depending on where exactly they 
>appear, they might be syntactically valid.  Perhaps you changed the "ip" 
>parameter to "ip"
>
> Well, I did not quote the attribute name, so maybe I was in the second 
case you suggested.
I can't imagine how any different char might have ended up in there, but 
following your reply and also having found again in the docs that 
whitespace is not relevant I did a new test now, and puppet did not have 
any problems with added spaces after the attribute name.
So, who knows what happened. I'm also pretty sure I already tried adding 
the spaces back yesterday as a test, and it failed. But you never know.

Thank you, sorry for bothering.

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/ca478bf2-a527-422d-b994-e2c94647c559%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: seeing too many change messages.

2014-01-22 Thread Muhammad Yousuf Khan
Thanks Alot :)

On Wednesday, January 22, 2014 3:51:10 PM UTC+5, Felix.Frank wrote:
>
> Hi, 
>
> that's pretty much correct. Only to clarify, this is what happens when 
> the agent contacts the master: 
>
> 1. the agent requests plugins (if pluginsync is enabled) 
>  -> this may introduce new fact code to the agent 
> 2. the agent gathers all facts about its local machine (see facter) 
> 3. the agent sends all facts to the master, and the master can use these 
> during compilation, both in templates and manifests 
> 4. the master sends a catalog, including file contents generated from 
> templates 
> 5. the agent verifies that the system state is synchronous with the 
> catalog specification, and performs update actions if there are 
> discrepancies 
>
> Hope this makes sense, 
> Felix 
>
> On 01/22/2014 11:46 AM, Muhammad Yousuf Khan wrote: 
> > however i was wrong. it seems like. first puppet master collect the 
> > information from all the client against these variable and then 
> > distributing it according to the value to every client node. please 
> > correct me if i am wrong. 
> > Thanks for your help. 
> > 
> > MYk 
>

-- 
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/1e0c39c1-03d7-431d-9eb7-40e9d51ad2fe%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] hiera suggestion

2014-01-22 Thread Andrey Kozichev
Yes, I was thinking something like that.

Is there a %{module} variable ?
On 22 Jan 2014 07:39, "Jose Luis Ledesma" 
wrote:

> Copied from another thread:
>
> :hierarchy:
> ...
>   - "%{environment}/classes/%{calling_class}
>
> Perhaps it is easier that way.
>
> Regards
>
> --
> 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/8f785b3b-ea63-4004-be7b-5810d3fbdd38%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%3DFeUuECvH_Dy0eUW%3D2GVQNzRphz5TupdBtYJcCnpfZLCeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: puppetdb: how to install using the system ruby 1.9.3-p484

2014-01-22 Thread machete
Cory thanks for the response.

Ruby (1.9.3-484 with rails-express patch) was compiled/installed with bash 
script ( aka something else).  

While the most current ruby binary is in /usr/bin, yum/RPM must need 
additional stuff ( maybe that RPM DB entry you mentioned ). Ultimately,  I 
could see the moving the ruby to a RPM and letting puppet take care of 
that. Before that,  I've should figure out how to satisfy the yum/rpm 
dependency(s). Maybe get the entry(s) to RPM DB?



most current in /usr/bin


Thanks again,

You've given me direction! ...  
...
-rwxr-xr-x1 root root8114512 Jan 22 04:02 ruby
-rwxr-xr-x1 root root548 Jan 22 04:02 gem

# ./ruby -v
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]

On Tuesday, January 21, 2014 6:47:42 PM UTC-5, Cory Stoker wrote:
>
> So how did you install Ruby 1.9.3?  Did you create your own RPM or use 
> something else?  The RPM packages for puppet will have dependencies 
> and then yum will try to satisfy them by looking in it's configured 
> yum repositories.  It usually tries to find the latest version. 
> Looking at your output it looks like none of the Ruby dependencies 
> were installed so yum find versions for you.  For example these 2 are 
> looking for a Ruby greater than 1.8 installed and a file called 
> /usr/bin/ruby: 
> --> Processing Dependency: ruby >= 1.8 for package: 
> puppet-3.4.2-1.el6.noarch 
> --> Processing Dependency: /usr/bin/ruby for package: 
> puppet-3.4.2-1.el6.noarch 
>
> Since neither were found in the RPM DB it installed Ruby 1.8.7 for you. 
>
>
> On Tue, Jan 21, 2014 at 1:14 PM, machete > 
> wrote: 
> > 
> > 
> > On Tuesday, January 21, 2014 3:13:49 PM UTC-5, machete wrote: 
> >> 
> >> The 1.8.7 ruby, rubygems and its gems were uninstalled. The root .gem 
> and 
> >> user .gem directories were also removed.  I am hunting for what I am 
> >> overlooking. 
> >> 
> >> I am now looking at using the yum package to install puppet. Listed 
> below 
> >> are the results of the package install. Notice it's trying to install 
> 1.8.7, 
> >> when my goal is to use the shiny 1.9.3 ... 
> >> 
> >> 
> >> # sudo yum install puppetLoaded plugins: fastestmirror 
> >> Loading mirror speeds from cached hostfile 
> >>  * base: mirrors-pa.sioru.com 
> >>  * epel: www.gtlib.gatech.edu 
> >>  * extras: www.gtlib.gatech.edu 
> >>  * rpmforge: mirror.us.leaseweb.net 
> >>  * updates: centos.icyboards.com 
> >> puppetlabs-deps| 
> 1.9 
> >> kB 00:00 
> >> puppetlabs-deps/primary_db | 
>  21 
> >> kB 00:00 
> >> puppetlabs-products| 
> 1.9 
> >> kB 00:00 
> >> puppetlabs-products/primary_db | 
> 103 
> >> kB 00:00 
> >> Setting up Install Process 
> >> Resolving Dependencies 
> >> --> Running transaction check 
> >> ---> Package puppet.noarch 0:3.4.2-1.el6 set to be updated 
> >> --> Processing Dependency: ruby >= 1.8 for package: 
> >> puppet-3.4.2-1.el6.noarch 
> >> --> Processing Dependency: facter >= 1.6.11 for package: 
> >> puppet-3.4.2-1.el6.noarch 
> >> --> Processing Dependency: ruby-rgen >= 0.6.5 for package: 
> >> puppet-3.4.2-1.el6.noarch 
> >> --> Processing Dependency: ruby >= 1.8.7 for package: 
> >> puppet-3.4.2-1.el6.noarch 
> >> --> Processing Dependency: hiera >= 1.0.0 for package: 
> >> puppet-3.4.2-1.el6.noarch 
> >> --> Processing Dependency: ruby-augeas for package: 
> >> puppet-3.4.2-1.el6.noarch 
> >> --> Processing Dependency: /usr/bin/ruby for package: 
> >> puppet-3.4.2-1.el6.noarch 
> >> --> Processing Dependency: ruby-shadow for package: 
> >> puppet-3.4.2-1.el6.noarch 
> >> --> Running transaction check 
> >> ---> Package facter.x86_64 1:1.7.4-1.el6 set to be updated 
> >> --> Processing Dependency: virt-what for package: 
> >> 1:facter-1.7.4-1.el6.x86_64 
> >> ---> Package hiera.noarch 0:1.3.0-1.el6 set to be updated 
> >> --> Processing Dependency: rubygem-json for package: 
> >> hiera-1.3.0-1.el6.noarch 
> >> ---> Package ruby.x86_64 0:1.8.7.352-13.el6 set to be updated 
> >> --> Processing Dependency: ruby-libs = 1.8.7.352-13.el6 for package: 
> >> ruby-1.8.7.352-13.el6.x86_64 
> >> --> Processing Dependency: libruby.so.1.8()(64bit) for package: 
> >> ruby-1.8.7.352-13.el6.x86_64 
> >> ---> Package ruby-augeas.x86_64 0:0.4.1-1.el6 set to be updated 
> >> --> Processing Dependency: augeas-libs >= 0.8.0 for package: 
> >> ruby-augeas-0.4.1-1.el6.x86_64 
> >> --> Processing Dependency: libaugeas.so.0(AUGEAS_0.12.0)(64bit) for 
> >> package: ruby-augeas-0.4.1-1.el6.x86_64 
> >> ---> Package ruby-rgen.noarch 0:0.6.5-1.el6 set to be updated 
> >> ---> Package ruby-shadow.x86_64 0:1.4.1-13.el6 set to be updated 
> >> --> Running transaction check 
> >> ---> Package augeas-libs.x86_64 0:1.0.0-5.el6_5.1 set to be updated 
> >> ---> Package ruby-libs.x86_64 0:1.8.7.352-13.el6 set to be updated 
> >> ---> Package rubygem

[Puppet Users] Re: accessing variable from another manifest

2014-01-22 Thread jcbollinger


On Tuesday, January 21, 2014 11:49:15 PM UTC-6, bluethundr wrote:
>
> Hey all,
>
>  Sorry but I forgot to include a key piece of information in that last 
> email.
>
>  In the ssh class I have defined in the modules init.pp I had this 
> definition:
>
>  class ssh {
>   include ssh::install, ssh::config, ssh::service, ssh::params
> }
>
>
> But then I read on into the book a little more and found out about the 
> require function. So I changed the ssh class definition to this: 
>
> class ssh {
>   require ssh::params
>   include ssh::install, ssh::config, ssh::service
> }
>
> And that solved the problem! Still curious as to why the original class 
> definition failed to work with the include function specifying ssh::params. 
> So if anyone out there cares to enlighten on that issue, that'd be great. 
>
> Glad however that I was able to get this working.
>


You have a misapprehension.  It was not changing from 'include' to 
'require' that made the difference.  It was putting the 'require' statement 
before the 'include's in your manifest.  Provided you leave it positioned 
where it now is, you could change the 'require' back to an 'include' 
without breaking anything (and you should do).

The underlying problem is that class ssh::config depends on class 
ssh::params, but does not explicitly tell Puppet so.  Generally speaking, 
if class A uses class variables of class B, then class A should 'include' 
class B at the top of its body.  That expresses the compile-time dependency 
in a way that Puppet understands.  If it does not express the dependency to 
Puppet, then whether class B is evaluated first is unspecified.

The above comes with some qualifications and provisos, however, among them:

   1. If you use parameterized-style class declarations in your manifests 
   then other declarations of the same classes serve documentary purposes 
   only.  Compilation will fail if a parameterized-style declaration of class 
   P (class { 'p': [parameters ...] }) is encountered when class P has 
   already been declared, and no additional declaration is needed one has 
   already been evaluated.
   2. If class A has both compile-time and order-of-application 
   dependencies on class B, then both dependencies can be expressed together 
   via a 'require' statement.  For code clarity, you should avoid 'require' 
   except in such cases.

I have long maintained that (1) is an outstanding reason to avoid 
parameterized class declaration syntax.  In Puppet 3, you can rely instead 
on automated data binding via hiera, at least where you "must" use 
parameterized classes at all.  (There is never an absolute need to do so, 
but it may be convenient, especially when third-party modules are 
involved.)  With some care, parameterized-style declarations can safely be 
used within a module to declare internal classes of that same module, but 
that's about it.


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/6db92485-0ed9-449f-8fc2-cb9447fea71f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] How to manage SugarCRM config.php with Puppet?

2014-01-22 Thread jcbollinger


On Tuesday, January 21, 2014 4:58:55 PM UTC-6, Pete wrote:
>
>
> This is a perfect use case for hiera. 
> If you aren't using it I would suggest setting it up. 
> It will allow you to setup variables exactly how you describe above. 
>
> This will get you started. 
> http://docs.puppetlabs.com/hiera/1/ 
>
>

Indeed, hiera is just the ticket for feeding data to Puppet to inform it 
about details of each target node.  It's architecture is based on a 
priority hierarchy of data, so hiera makes it easy to, say, define a 
general base configuration, override some bits of that based on which group 
each node belongs to, and override the same or other bits on a per-node 
basis.  That could be perfect for populating a config file template.

If the OP insists that Puppet must avoid clobbering changes applied to 
nodes directly via Sugar's user interface, however, then that's not really 
a data problem.  Hiera cannot help with that part, unless by facilitating 
the removal of that requirement.


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/b2a696c2-b631-4835-a8c4-e4e7358c5850%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] roll back update

2014-01-22 Thread Muhammad Yousuf Khan
Hello All,

i have seen so many apt modules on puppet forge website. they are more like 
changing source list path defining. HTTP proxy blah blah but what i want is 
a bit more.
is there any apt module  which can help me to update only selective updates 
(like in Microsoft Wsus does, it list down all the updates and people can 
select and apply those patches on selective nodes and if they find it 
problematic then can remotely uninstall it too.i want this to be done on my 
Debian server farm and and i also want to roll back as needed (for example 
if any securety or OS update creating problem of some kind i can roll it 
back with puppet live management/manual run). 
i dont know how practical it is. however as i have already got the concept 
of Wsus therefore my mind is trying to think of wsus like puppet module.
Please help.
thanks,
MYK

-- 
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/46482f37-c6e1-4242-b87e-f689a3c11016%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Report processor failed: uninitialized constant Puppet::FileSystem::File

2014-01-22 Thread Felix Frank
Hi,

apparently puppet cannot load the Puppet::FileSystem::File
class from $RUBYLIB/puppet/file_system/file.rb

Have you installed puppet via rpm package? Can you verify the
consistency of your installation?

Failing that, locate the above mentioned file in your file system and
find out why it's not used (correctly) or what's wrong with it. This may
be a red herring, though.

HTH,
Felix

On 01/21/2014 03:53 PM, ro001 wrote:
> [r...@test-pm4.com puppet]# puppet apply manifests/site.pp
> Notice: Compiled catalog for TEST-PM4.com in environment production in
> 1.00 seconds
> Notice: /Stage[main]/my-puppetmaster/Package[puppet-server]/ensure: created
> Notice: Finished catalog run in 5.35 seconds
> Error: Report processor failed: uninitialized constant
> Puppet::FileSystem::File

-- 
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/52DFDCE7.8020605%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Get data from password protected file SSL

2014-01-22 Thread Gautam Chand Nutalapati
I have a key and file A.

usually to retrieve data from file, I guess we do something like  $var = 
File("path/A") 
How do we retrieve the data from same file if file "A" is protected by a 
key? (I have the Key)

(Related to SSL)
I have a private key file that i want to password protect and use puppet 
instead of user typing pass phrase every time.
Encrypting whole contents of file is not possible, so planning to encrypt 
pass phrase.

Any suggestions?

-- 
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/638dacbc-bed8-40f8-8729-2ab48329f4c8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


RE: [Puppet Users] roll back update

2014-01-22 Thread SHARNINDER_KHERA
Mohammad,

As far as I know, there is nothing in the puppet world that does what you want. 
On the other hand, puppet does give you the flexibility to manage packages to 
be installed (or uninstalled) on the managed nodes.

Whether you can use it for installing/removing patches, depends on how the 
patches are distributed.  On a redhat based system, puppet will use rpm to 
install/remove packages and on a debian based system it’ll use apt, so that 
intelligence is already built-in to puppet.

Puppet gives you a framework and leaves it up to your creativity (or lack of 
it) to go wild.

Take a look at the puppet cookbook for basic examples and in the end there is 
nothing better than to RTFM.

http://www.puppetcookbook.com/posts/install-package.html

--
Sharninder



From: puppet-users@googlegroups.com [mailto:puppet-users@googlegroups.com] On 
Behalf Of Muhammad Yousuf Khan
Sent: Wednesday, January 22, 2014 8:02 PM
To: puppet-users@googlegroups.com
Subject: [Puppet Users] roll back update

Hello All,

i have seen so many apt modules on puppet forge website. they are more like 
changing source list path defining. HTTP proxy blah blah but what i want is a 
bit more.
is there any apt module  which can help me to update only selective updates 
(like in Microsoft Wsus does, it list down all the updates and people can 
select and apply those patches on selective nodes and if they find it 
problematic then can remotely uninstall it too.i want this to be done on my 
Debian server farm and and i also want to roll back as needed (for example if 
any securety or OS update creating problem of some kind i can roll it back with 
puppet live management/manual run).
i dont know how practical it is. however as i have already got the concept of 
Wsus therefore my mind is trying to think of wsus like puppet module.
Please help.
thanks,
MYK
--
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/46482f37-c6e1-4242-b87e-f689a3c11016%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/C78F9D4A46AFAF4584E9A0EB442B3FCA494C3D%40NOIX10HMNOI03.AMER.DELL.COM.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Report processor failed: uninitialized constant Puppet::FileSystem::File

2014-01-22 Thread Mike Skint
yes I've seen it on ubuntu 12.04 and Debian 6 nodes installed from 
puppetlabs repo,  had to roll back to 3.4.0



On Tuesday, January 21, 2014 6:53:38 AM UTC-8, ro001 wrote:
>
>
> Hi,
>
> I am the deploying the puppet master rpm 3.4.2 onto a centos 6.3 VM using 
> the following script files but output reports the error 'Report processor 
> failed: uninitialized constant Puppet::FileSystem::File', has anyone seen 
> this error? 
>
>
> ** SITE.pp ***
>
> import "nodetypes/*.pp"
> Exec { path => "/bin:/sbin:/usr/bin:/usr/sbin" }
> node 'TEST-PM4.com'
> {
> class {'puppetmaster' : }
> }
> node default {
> }
> # Filebuckets
> filebucket { main: server => puppet }
> filebucket { local: path => "/var/lib/puppet/clientbucket" }
> class main {
> }
>
>
>  puppet master manifest 
>
> class puppetmaster {
> class { 'my-puppetmaster' : }
> }
>
>
>
> *** my-puppetmaster module ***
>
> class my-puppetmaster {
> $packages = [ 'puppet-server'
>  ]
>
> package { $packages:
> ensure => installed,
> }
> }
>
>
> When I create the puppetmaster, the output finished with an error (as 
> highlighted below). Has anyone else seen this Error? I have not spotted any 
> problems from it, but it would be great if someone could share what the 
> problem is?
>
>
> [r...@test-pm4.com puppet]# puppet apply manifests/site.pp
> Notice: Compiled catalog for TEST-PM4.com in environment production in 
> 1.00 seconds
> Notice: /Stage[main]/my-puppetmaster/Package[puppet-server]/ensure: created
> Notice: Finished catalog run in 5.35 seconds
> Error: Report processor failed: uninitialized constant 
> Puppet::FileSystem::File
>
>

-- 
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/9de2db92-667c-4ad8-94cb-fe0336f489d1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] AWS cloud provisioning on Puppet VM, Error: RequestExpired => Request has expired. Timestamp date is 2014-01-22T08:45:57Z

2014-01-22 Thread Venkata Ramana
I am configuring AWS cloud provisioning on Puppet VM, getting the below 
error. I configured ~/.fog with AWS access keys. I would like to know if 
anyone faced the same issue? If so, can you share your inputs?


[root@puppet ~]# vim .fog
[root@puppet ~]# puppet node_aws list
Error: RequestExpired => Request has expired. Timestamp date is 
2014-01-22T08:45:57Z
Error: Try 'puppet help node_aws list' for usage

-- 
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/acfe9e6a-c8d6-450f-9942-00b04d686850%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: "You need rubygems to use Hiera"

2014-01-22 Thread Moses Mendoza
Hi Jonathan,

It appears that dhoppe/puppet actually ships an entire copy of hiera
1.0.0 and hiera-puppet inside its lib directory, which is unfortunate
since hiera is now at 1.3.1 and hiera-puppet is part of puppet proper.
 I filed an an issue against the github repo, since this isn't an
ideal approach, to say the least.


On Mon, Jan 20, 2014 at 8:16 AM, Jonathan Gazeley
 wrote:
> I fixed my own problem. Seems that when I installed dhoppe/postfix, and it
> automatically included a dependency dhoppe/puppet which seems to have
> overwritten some components of puppet. I immediately removed dhoppe/postfix
> but didn't notice that dhoppe/puppet was still in situ. Removing this and
> doing "sudo yum reinstall puppet" put back the files and it now works again.
>
> Cheers,
> Jonathan
>
>
>
> On 20/01/14 12:19, Jonathan Gazeley wrote:
>
> Hi chaps,
>
> This morning I started running into an error. All my nodes started failing
> with:
>
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
> You need rubygems to use Hiera at
> /home/ispms/PUPPETROOT/environments/common/modules/uob_ntp/manifests/init.pp:5
> on node dhcp-dev.nomadic-core.bris.ac.uk
>
> The master log shows:
>
> Jan 20 12:08:38 puppet-prod puppet-master[30673]: Puppet.features.rubygems?
> is deprecated. Require rubygems in your application's entry point if you
> need it.
> Jan 20 12:08:38 puppet-prod puppet-master[30673]:(at
> /usr/lib/ruby/site_ruby/1.8/puppet/util/feature.rb:17:in `add')
>
> I also read this recent thread, and none of the recommendations helped:
>
> http://grokbase.com/t/gg/puppet-users/1419xmhyf3/error-testing-puppet-3-x-upgrade-you-need-rubygems-to-use-hiera
>
> This morning a colleague of mine wrote a custom function. It looked sane to
> me but I removed it in case it was broken, and it didn't help.
>
> I also installed a Forge module, which I later removed, and it didn't help.
>
> I'm running stock puppet-3.4.2 from the PL repo and we are using
> hiera-1.3.0. Everything worked normally until this morning and I'm not
> entirely sure where to go from here. Any suggestions of things to look at?
>
> Cheers,
> Jonathan
>
>
> --
> 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/52DD4BCB.30106%40bristol.ac.uk.
>
> For more options, visit https://groups.google.com/groups/opt_out.



-- 
Moses Mendoza
Puppet Labs

Join us at PuppetConf 2014, September 23-24 in San Francisco

-- 
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%2B421Wa_8-jb8DNTBGSONEHYqbroW4pN4hvvpca9%2B4uC8%2Btx%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Monitor configfiles of a package

2014-01-22 Thread Marco Schröder
Hi all,

I would like to monitor a configuration directory (a bunch of apache vhost 
config files) with puppet.
For several reasons it would be neccessary to deploy the configs with a RPM 
package which is built by a Jenkins CI server.

Using a package ressource and just ensure => latest would be easy of 
course, but what I want to make sure is that puppet recognizes when 
somebody or something changes the config files on the filesystem and then 
forces the contents of my RPM package.

I believe that RPM isn't designed to force overwrite of configs which it 
owns.

Is it possible to monitor a directory recursively with puppet and trigger a 
RPM reinstall or something like that?

Or am I completely on the wrong track?

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/733def47-82ae-462b-885c-deda1d056751%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Monitor configfiles of a package

2014-01-22 Thread Jose Luis Ledesma
You can exec a rpm verify against the package, it should display which files 
has changed and then reinstall it to if needed but i think this is not a 
"puppet solution"

Another option would be install the rpm in the puppet master, and create a 
module that deploy the files of the rpm( so no rpm installed on the servers)...

Regards

-- 
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/14ce75b2-ec71-4d1c-a58b-43742290aef6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] PuppetDB 1.6.0-rc3 Now available

2014-01-22 Thread Ken Barber
** Release Candidate **

PuppetDB 1.6.0-rc3
Prerelease: PuppetDB 1.6.0 is not yet released

* RC1: January 7th, 2014.
* RC2: January 14th, 2014.
* RC3: January 22nd, 2014.

PuppetDB 1.6.0-rc3 Downloads


Available in native package format in the pre-release repositories at:
http://yum.puppetlabs.com and http://apt.puppetlabs.com

For information on how to enable the Puppet Labs pre-release repos, see:
http://docs.puppetlabs.com/guides/puppetlabs_package_repositories.html#enabling-the-prerelease-repos

Binary tarball: http://downloads.puppetlabs.com/puppetdb/

Source: http://github.com/puppetlabs/puppetdb

Please report feedback via the Puppet Labs tickets site, using an
affected PuppetDB version of 1.6.0-rc3:
https://tickets.puppetlabs.com/browse/PDB

Documentation: http://docs.puppetlabs.com/puppetdb/1.6

Puppet module:
http://forge.puppetlabs.com/puppetlabs/puppetdb

PuppetDB 1.6.0 Release Notes


PuppetDB 1.6.0 is a performance and bugfix release.

Things to take note of before upgrading:

* There are a number of database migrations performed upon first
startup. This will require extra free disk space on your PostgreSQL
server while we rebuild some tables, so make sure you have enough free
space _before_ you start the upgrade. Since a full table migration
takes a copy of the old table, a good rule of thumb would be to check
your current database usage (using du -sh on the database directory
for example) and ensure you have as much free space on that partition.
While all migrations are protected by an atomic database transaction,
it never hurts to backup your database beforehand just in case.

* Also due to the migrations that will take place, it might take
several minutes (depending on the size of your database) before
PuppetDB can respond to requests again. Give the migration ample time
to complete and you should be fine.

* Make sure all your PuppetDB instances are shutdown and only upgrade
one at a time.

* As usual, don’t forget to upgrade your puppetdb-terminus package
also (on the host where your Puppet Master lives), and restart your
master service.

* This is primarily a performance release, so we’re interested in any
feedback (good or bad) as to how helpful these changes have been
especially around catalog hash-miss performance and general updates on
the database. Most of the performance improvements are around facts
and catalogs, so we don’t expect any improvements for report storage
this time around.

Changes specific to rc3:

* (PDB-313) Fix catalog resource metadata not updating with parameters change
* (PDB-307) Remedy unit test failures with latest mocha gem
* Fixed an issue with acceptance testing missing ruby-devel on EL5 (VirtualBox)

Changes specific to rc2:

* (PDB-303) Utilise final version of prismatic/schema 0.2.0
* (PDB-279) Sanitize report imports
* (PDB-247) Fixes the namespace override warnings from schema
* (PDB-107) Support chained CA certificates

Notable improvements and fixes:

* (PDB-81) Deprecate JDK6. It's been EOL for quite some time.

* (#21083) Differential fact storage

  Previously when facts for a node were replaced, all previous facts
  for that node were deleted and all new facts were inserted. Now
  existing facts are updated, old facts (no longer present) are
  deleted and new facts are inserted. This results in much less I/O,
  both because we have to write much less data and also because we
  reduce churn in the database tables, allowing them to stay compact
  and fast.

* (PDB-68) Differential edge storage

  Previously when a catalog wasn't detected as a duplicate, we'd have
  to reinsert all edges into the database using the new catalog's
  hash. This meant that even if 99% of the edges were the same, we'd
  still insert 100% of them anew and wait for our periodic GC to clean
  up the old rows. We now only modify the edges that have actually
  changed, and leave unchanged edges alone. This results in much less
  I/O as we touch substantially fewer rows.

* (PDB-69) Differential resource storage

  Previously when a catalog wasn't detected as a duplicate, we'd have
  to reinsert all resource metadata into the catalog_resources table
  using the catalog's new hash. Even if only 1 resource changed out of
  a possible 1000, we'd still insert 1000 new rows. We now only modify
  resources that have actually changed. This results in much less I/O
  in the common case.

* Streaming resource and fact queries. Previously, we'd load all rows
  from a resource or fact query into RAM, then do a bunch of sorting
  and aggregation to transform them into a format that clients
  expect. That has obvious problems involving RAM usage for large
  result sets. Furthermore, this does all the work for querying
  up-front...if a client disconnects, the query continues to tax the
  database until it completes. And lastly, we'd have to wait until all
  the query results have been paged into RAM before we could send
  anythin

Re: [Puppet Users] roll back update

2014-01-22 Thread Jason Antman
There's nothing existing that I know of that works in the GUI-based way
you seem to be talking about. Because, well, we *nix people usually
don't do that.

I've really only worked on RPM-based systems, so I'm not sure if this is
still applicable in the debian world...

There are 2 types of updates I do

1) updating one package or a set of packages (like, updating Puppet from
3.1.0 to 3.4.1) which I do with the "ensure" parameter on the Package
type. Some stuff is wrapped up in classes, and this can be done through
an ENC (parameterized classes, or global params if need be) or Hiera.
I'll change the version on one node, test it, then an environment, test
it, and eventually apply it everywhere. If you need to downgrade/roll
back, that *can* work... might work better in the apt/deb world than it
does in yum/rpm.

2) Full system updates/upgrades, what RHEL-derivatives term as
"distribution upgrades", i.e. updating all packages from CentOS 6.3 to
6.4. I rebuild the box. No reason to mess with doing this through the
distro, I just shut it down, clean the cert in puppet, do a fresh PXE
boot (and kickstart) and let Puppet do its thing. This has the added
benefit of reducing entropy, and even providing a nice DR test (like if
you just log in and poweroff immediately...)

-Jason

On 01/22/2014 09:31 AM, Muhammad Yousuf Khan wrote:
> Hello All,
>
> i have seen so many apt modules on puppet forge website. they are more
> like changing source list path defining. HTTP proxy blah blah but what
> i want is a bit more.
> is there any apt module  which can help me to update only selective
> updates (like in Microsoft Wsus does, it list down all the updates and
> people can select and apply those patches on selective nodes and if
> they find it problematic then can remotely uninstall it too.i want
> this to be done on my Debian server farm and and i also want to roll
> back as needed (for example if any securety or OS update creating
> problem of some kind i can roll it back with puppet live
> management/manual run).
> i dont know how practical it is. however as i have already got the
> concept of Wsus therefore my mind is trying to think of wsus like
> puppet module.
> Please help.
> thanks,
> MYK
> -- 
> 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/46482f37-c6e1-4242-b87e-f689a3c11016%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/52E04645.5010106%40jasonantman.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] roll back update

2014-01-22 Thread Steven VanDevender
Jason Antman writes:
 > There's nothing existing that I know of that works in the GUI-based way
 > you seem to be talking about. Because, well, we *nix people usually
 > don't do that.

 > I've really only worked on RPM-based systems, so I'm not sure if this is
 > still applicable in the debian world...

Debian-based distributions have interactive tools like "aptitude"
(curses-based) or "synaptic" (GNOME GUI) that can let you do selective
package installation and upgrades on a host, in addition to the
command-line "apt-get" and "dpkg" utilties.  These don't really offer
centralized management of a group of hosts, though.

In the RPM world there's Spacewalk (or the Red Hat Satellite Server
commercial product based on it) for doing centralized package
management.  There's probably some equivalent in the Debian world but
I'm not aware of what that is.  Setting up a local repository mirror can
let you control what packages are visible to hosts so you can control
package versions for installation and upgrades (in fact, I've seen
people set up multiple mirrors visible to different environments so they
can do things like staged upgrade testing).

 > There are 2 types of updates I do
 > 
 > 1) updating one package or a set of packages (like, updating Puppet from
 > 3.1.0 to 3.4.1) which I do with the "ensure" parameter on the Package
 > type. Some stuff is wrapped up in classes, and this can be done through
 > an ENC (parameterized classes, or global params if need be) or Hiera.
 > I'll change the version on one node, test it, then an environment, test
 > it, and eventually apply it everywhere. If you need to downgrade/roll
 > back, that *can* work... might work better in the apt/deb world than it
 > does in yum/rpm.


 > 2) Full system updates/upgrades, what RHEL-derivatives term as
 > "distribution upgrades", i.e. updating all packages from CentOS 6.3 to
 > 6.4. I rebuild the box. No reason to mess with doing this through the
 > distro, I just shut it down, clean the cert in puppet, do a fresh PXE
 > boot (and kickstart) and let Puppet do its thing. This has the added
 > benefit of reducing entropy, and even providing a nice DR test (like if
 > you just log in and poweroff immediately...)
 > 
 > -Jason
 > 
 > On 01/22/2014 09:31 AM, Muhammad Yousuf Khan wrote:
 > > Hello All,
 > >
 > > i have seen so many apt modules on puppet forge website. they are more
 > > like changing source list path defining. HTTP proxy blah blah but what
 > > i want is a bit more.
 > > is there any apt module  which can help me to update only selective
 > > updates (like in Microsoft Wsus does, it list down all the updates and
 > > people can select and apply those patches on selective nodes and if
 > > they find it problematic then can remotely uninstall it too.i want
 > > this to be done on my Debian server farm and and i also want to roll
 > > back as needed (for example if any securety or OS update creating
 > > problem of some kind i can roll it back with puppet live
 > > management/manual run).
 > > i dont know how practical it is. however as i have already got the
 > > concept of Wsus therefore my mind is trying to think of wsus like
 > > puppet module.
 > > Please help.
 > > thanks,
 > > MYK

-- 
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/21216.19881.358352.250354%40shell.uoregon.edu.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] puppet & augeas - where to put augeas definition?

2014-01-22 Thread Mike Reed
Hello all,

I'm looking to use a simple augeas definition per the below info:

 augeas { "sources_config":
context => "/files/etc/apt/sources.list" ,
changes => [
"set deb http://repo/ client main" ,
],
}

Per the snippet above, I'm simply trying to add in an extra entry into my 
/etc/apt/sources.list but I'm not sure where I would actually put the above 
piece of code.  I currently have it sitting in my init.pp file for the 
corresponding class but I'm not sure if that's really where it belongs.

Is the init.pp file the right place for this and if not, where would I put 
it?

My apologies if this is a stupid question as I'm having a hard time 
wrapping my head around this one.

Thanks in advance for all the help.

Cheers,

Mike

-- 
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/6a05ba6a-c3fd-4de1-abca-31593b6b233f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Using Virtual Resources and create_resource combination

2014-01-22 Thread CD
Hi John,

Thanks a lot for the information. I checked the variables and could not 
find anything defined twice.

In my workaround I updated the module code slightly and managed to fix the 
issue I face.

This is the original code
https://github.com/razorsedge/puppet-network/blob/master/manifests/if/static.pp

I changed the code by introducing parameter called interface. In the 
interface and I pass the value "eth0" etc and in title I pass a unique 
value.  

define network::if::static (
  $interface,
  $ensure,
  $ipaddress,
  $netmask,
  $gateway = '',
  $macaddress = '',
  $userctl = false,
  $mtu = '',
  $ethtool_opts = '',
  $peerdns = false,
  $dns1 = '',
  $dns2 = '',
  $domain = '',
)
..
..
  network_if_base { $interface:
ensure   => $ensure,
ipaddress=> $ipaddress,
netmask  => $netmask,
gateway  => $gateway,
macaddress   => $macaddy,
bootproto=> 'none',
userctl  => $userctl,
mtu  => $mtu,
ethtool_opts => $ethtool_opts,
peerdns  => $peerdns,
dns1 => $dns1,
dns2 => $dns2,
domain   => $domain,
  }

Though I haven't dive deep in module code it seems having title variable 
repeated with value "eth0" when it runs for each server seems. 

Thanks,
Chaminda 


On Friday, January 17, 2014 1:58:51 AM UTC+10, jcbollinger wrote:
>
>
>
> On Wednesday, January 15, 2014 9:57:41 PM UTC-6, CD wrote:
>>
>> Hi friends,
>>
>> I have an issue where that I receive error Error 400 on SERVER: Cannot 
>> reassign variable name on node app1. When I run the agent on admin1 it 
>> works fine, but when I run the agent on app1 it give me the error.
>>
>> Having read few forum posts it seems this is most likely that the same 
>> resource is used. resource network::if::static is used with eth0 in the 
>> same class when it runs for admin1 and app1. I believe when it run on 
>> admin1 variables are used without any problem and when it run on app1 it 
>> find the variable has been used for admin1.
>>
>
>
> No.  Puppet is complaining about a *variable*, not a resource.  That is, 
> something of the general form
>
> $some_var = 'a value'
>
> Each variable may be assigned a value at most once.  There are two likely 
> scenarios for how this might be happening:
>
>1. Most likely, you have a reassignment of the affected variable 
>inside a conditional statement, such that it is processed for node app1 
> but 
>not for node admin1.
>2. Alternatively, you may have a global variable assignment at top 
>scope in a manifest file that is not loaded for node admin1, but is loaded 
>for node app1.  Such an assignment in principle applies to all nodes (and 
>therefore is wrong for all nodes), but it won't be seen when node app1's 
>catalog is compiled (which makes such statement placement a very bad idea 
>in general, error notwithstanding).
>
> Example of (1):
>
> class site {
>   $is_app_node = false
>
>   if $hostname =~ /^app/ {
> # WRONG:
> $is_app_node = true
>   }
> }
>
>
> Example of (2):
> manifests/site.pp:
> ---
> # Top-scope declaration ok here:
> $is_app_node = false
>
> node app1 {
>   include myapp
> }
>
> modules/myapp/manifests/init.pp:
> ---
> # Top-scope declaration unwise here:
> $is_app_node = true
>
> class myapp {
>   # ...
> }
>
>
> It appears these kind of issues are addressed by creating virtual 
>> resources. However I cannot figure out how I can define virtual resources 
>> and combine that with create_resources. I need to use the create_resources 
>> because I was to pass the hieradata to the resource.
>>
>> *Any ideas how I can address this problem?*
>>
>> Details of the implementation given below:
>>
>> I have following hieradata which applied to each server:
>>
>> /etc/puppet/hieradata/admin1.json
>> {
>>"networks":{
>>   "eth0":{
>>  "ipaddress":"192.168.1.1",
>>  "netmask":"255.255.255.0"
>>   }
>>}
>> }
>>
>> /etc/puppet/hieradata/app1.json
>> {
>>"networks":{
>>   "eth0":{
>>  "ipaddress":"192.168.1.2",
>>  "netmask":"255.255.255.0"
>>   }
>>}
>> }
>>
>> I have a class call foundation and it has following files
>> /etc/puppet/modules/foundation/manifests/init.pp
>> class foundation {
>> include foundation::network
>> }
>>
>> /etc/puppet/modules/foundation/manifests/network.pp
>> class foundation::network{
>>
>> # Defaults for network configuration
>> $nic_default = {
>> 'ensure' => 'up'
>> }
>>
>> # Extract Data from Hiera for the host in concern
>> $nics   = hiera("networks",{})
>>
>> # Configure networks based on the parameters
>> create_resources(network::if::static, $nics, $nic_default)
>>
>> }
>>
>> Above class is included in base node and individual nodes has extended 
>> from the base node
>> /etc/puppet/manifests/nodes.pp
>> node base {
>>include foundation
>> }
>>
>> node admin1 inherits base {
>> }
>>
>> node app1 inherits base {

Re: [Puppet Users] Using hiera to separate code and data

2014-01-22 Thread CD
Hi Felix,

Thanks for the information. I used the create_resources and fixed the 
issue. Further I started using the individual host files as you suggested 
to make it more manageable. Thanks again for the tips. 

This is what I finally implemented. (Note: I came across another issue with 
this implementation and workaround is available in 
https://groups.google.com/forum/#!topic/puppet-users/aoGQQlND8Kw)

class foundation::network {

# Defaults for network configuration
$nic_default = {
'ensure' => 'up'
}

# Extract Data from Hiera for the host in concern
$nics   = hiera("networks",{})


# Configure networks based on the parameters
create_resources(network::if::static, $nics, $nic_default)

}

/etc/puppet/hieradata/viradamin2.json
{
   "networks":{
  "viradmin2-admin":{
 "interface":"eth0",
 "ipaddress":"10.10.1.2",
 "netmask":"255.255.255.0"
  }
}
}



On Wednesday, January 15, 2014 3:56:57 AM UTC+10, Felix.Frank wrote:
>
> On 01/12/2014 09:15 AM, CD wrote: 
> > 1. hiera($variable) returns a hash but for resource to iterate it 
> > requires and array. Any idea how to convert it to an array 
>
> Hiera returns whatever it reads from your data file. If your json 
> deserialized to an array, that is what Hiera will return to you. 
>
> > 2. How to specify ip so that it get the corresponding value from eth0 or 
> > eth1. 
>
> You might want to hand the whole respective data structure into your 
> define (all code untested): 
>
> $nic_list = keys($nics) 
> network_config { $nic_list: data => $nics } 
>
> define network_config($data) { 
>   $ip = $data[$name]["ip"] 
>   ... 
>   [ your implementation here ] 
> } 
>
> Depending on where else you need this specific data, you may 
> alternatively tailor it in a way that will enable you to just 
>
> create_resources("network_config", $nics) 
>
> As an aside, this design looks rather cumbersome and limiting you. I 
> found that hiera is most powerful and intuitive if it can itself figure 
> out which dataset to return (e.g. .json) and splitting things 
> out into many keys. 
>
> Of course, it's not a one-size-fits-all issue, if your mileage is better 
> this way, feel free to stick to it, of course. 
>
> HTH, 
> 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/d3c4295c-0ab7-4289-a63b-791588a0fdb3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Thoughts on roles/profiles class paradigm

2014-01-22 Thread Nathan Nobbe
On Wednesday, January 9, 2013 2:34:30 PM UTC-7, Wolf Noble wrote:
>
> Hi Gang, 
>
> My colleagues and I are contemplating refactoring our modules to take 
> advantage of the "roles/profiles" paradigm suggested by Craig Dunn in his 
> blog post found here: 
> http://www.craigdunn.org/2012/05/239/ 
>
> Before we jump feet-first into adopting this paradigm, I thought it a good 
> idea to reach out and see what everyone else thinks about this. 
>
> We're currently struggling with some problems that this paradigm seems to 
> solve quite nicely; but I'm not convinced it's the best abstraction / 
> organization paradigm out there. 
>
> If you've not read it, I think It's worth the few minutes it takes to 
> read.  Thanks Craig, for writing it. 
>
>
>
>
>  
>
> This message may contain confidential or privileged information. If you 
> are not the intended recipient, please advise us immediately and delete 
> this message. See http://www.datapipe.com/legal/email_disclaimer/ for 
> further information on confidentiality and the risks of non-secure 
> electronic communication. If you cannot access these links, please notify 
> us by reply message and we will send the contents to you. 
>

I read Craig's article numerous times and have recently published an 
articleon my 
thoughts. To summarize, I feel the big lesson from the article is 
composition is needed to define reusable grouped module declarations (aka 
*roles*). Whether or not you like the notion of the 2-layered approach 
(roles *and* profiles) is something else and a bit extra IMO.

That said I'm only managing tens of servers rather than hundreds or 
thousands so far, but for me one layer to represent 'roles' has worked 
great.

What it amounts to for me is a simple guideline - leverage inheritance (or 
the hiera hierarchy) as much as possible and introduce composition on a 
need-to basis. Composition is necessary though, unless all your systems are 
identical.

Thanks again Craig for the article. Neat to find you on the google group!

-nathan

-- 
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/c2c138f4-a703-43c9-8110-0522697063bc%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Exporting a resource only once....

2014-01-22 Thread Krist van Besien
Hello,


I have a need for an exported resource that only gets exported once. So a 
class that exports this resource should test first if it hasn't already 
been exported, and only then export it.

In pseudo code:

if
  !exists X
then 
  @@X


The problem is that I can't seem to find out how to test for the existence 
of an exported resource in puppet, without any side effects...

Any hints?

Krist


-- 
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/881aa1e9-f299-4be4-924a-c970bab2a9bd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.