Re: [Puppet Users] Custom Windows Fact (match ipaddress)

2013-11-11 Thread cko
I still can't get it to work:


 Facter::Util::Resolution.exec("C:\\Windows\\System32\\cmd.exe /c 
'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe ipconfig | 
Select-String -pattern '192.168.20[567]' | %{$_.line.split()} | FINDSTR 
192.168.20[567]'")




On Wednesday, October 30, 2013 4:23:45 PM UTC+1, Josh Cooper wrote:
>
> The second issue is that findstr is a shell builtin, so you have wrap the 
> entire command in:
>
> cmd.exe /c 
>
> You may have to quote the original command and adjust the interior quotes 
> accordingly.
>
> Josh
>
> On Wednesday, October 30, 2013, cko wrote:
>
>> Still no effect.
>>
>>
>> Facter::Util::Resolution.exec("C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe
>>  
>> ipconfig | Select-String -pattern '192.168.20[567]' | %{$_.line.split()} | 
>> FINDSTR 192.168.20[567]")
>>
>> Is there anything else i need to escape?
>>
>>
>>
>>
>> On Tuesday, October 29, 2013 3:07:12 PM UTC+1, cko wrote:
>>>
>>> Hi everybody,
>>>
>>> I'm trying to write a custom fact that gets the IP Address of any given 
>>> NIC if it matches a specific IP range.
>>>
>>> On Linux i use this (works fine) 
>>>
>>> Facter.add("ip_foo") do
>>>setcode do
>>>   Facter::Util::Resolution.exec("/sbin/ifconfig | /bin/grep 
>>> '192.168.20[567].' | /bin/awk '{ print $2 }' | /bin/cut -d':' -f2")
>>>end
>>> end
>>>
>>> Now my Windows Version:
>>>
>>> Facter.add("ip_foo_windows") do
>>>confine :operatingsystem => :windows
>>>setcode do
>>>   Facter::Util::Resolution.exec("C:\Windows\System32\
>>> WindowsPowerShell\v1.0\powershell.exe ipconfig | Select-String -pattern 
>>> '192.168.20[567]' | %{$_.line.split()} | FINDSTR 192.168.20[567]")
>>>   end
>>> end
>>>
>>>
>>> When i run the command 
>>> C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe 
>>> ipconfig | Select-String -pattern '192.168.20[567]' | %{$_.line.split()} | 
>>> FINDSTR 192.168.20[567] on the box it works perfectly fine. It returns the 
>>> value that i need.
>>>
>>> But it seems that puppet doesn't get that value into the fact.
>>>
>>>
>>>  -- 
>> 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/f0fbe47f-5bc0-4fc3-bc2a-5eb8d6cad367%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
> -- 
> Josh Cooper
> Developer, Puppet Labs
>
>

-- 
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/4e1302b5-1fdb-4a72-b696-9df65f586460%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Simplest manner to print a node's catalog

2013-11-11 Thread Tom Noonan
Nice, I didn't think to check the master arguments.  Gracias!

On Mon, 11 Nov 2013 19:21:43 -0600
Joe Esposito  wrote:

> Hey Tom,
> 
> This works on puppet 2.6.3 (on Ubuntu 10.04)
> 
> #puppet master --compile nodename
> 
> Joe Esposito
> 
> 
> On Mon, Nov 11, 2013 at 1:44 PM, Thomas Noonan II 
> wrote:
> 
> > Hello, list:
> > Today a coworker and I were trying to find the easiest way
> > to print the catalog for a node running Puppet 2.6.x (I know, I
> > advised an upgrade) and were coming up empty handed.  On a Puppet
> > 3.2.4 node I
> > found /var/lib/puppet/client_data/catalog/${fqdn}.json, but that
> > didn't exist on the 2.6.x host.  I couldn't find any "puppet
> > [argument]" commands that worked.  I was hoping to find something
> > easier than hitting the PuppetDB API with curl. Can someone advise
> > on commands to print the catalog on a node, preferably backwards
> > compatible with Puppet 2.6? Thanks.
> >
> > --Tom Noonan II
> >
> > --
> > 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/2013134423.19010a07%40TJNII-Desktop.rackspace.corp
> > .
> > 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/2013194749.16da0f22%40vncBox.tjnii.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Simplest manner to print a node's catalog

2013-11-11 Thread Joe Esposito
Hey Tom,

This works on puppet 2.6.3 (on Ubuntu 10.04)

#puppet master --compile nodename

Joe Esposito


On Mon, Nov 11, 2013 at 1:44 PM, Thomas Noonan II  wrote:

> Hello, list:
> Today a coworker and I were trying to find the easiest way to
> print the catalog for a node running Puppet 2.6.x (I know, I advised an
> upgrade) and were coming up empty handed.  On a Puppet 3.2.4 node I
> found /var/lib/puppet/client_data/catalog/${fqdn}.json, but that didn't
> exist on the 2.6.x host.  I couldn't find any "puppet [argument]"
> commands that worked.  I was hoping to find something easier than
> hitting the PuppetDB API with curl.
> Can someone advise on commands to print the catalog on a node,
> preferably backwards compatible with Puppet 2.6? Thanks.
>
> --Tom Noonan II
>
> --
> 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/2013134423.19010a07%40TJNII-Desktop.rackspace.corp
> .
> 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/CAKgN-qoB0phwqvbkq0vyx0XnkThsDDaJvSAbXP0_RbgQUAWuUw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] augeas onlyif problem

2013-11-11 Thread Dominic Cleal
On 11/11/13 15:18, Jist Anidiot wrote:
> 
> 
> On Friday, November 8, 2013 12:23:11 PM UTC-5, Dominic Cleal wrote:
> 
> On 06/11/13 21:17, Jist Anidiot wrote:
> > I'm trying to make sure a specific user has a special ssh key used as
> > his identity file.
> >
> > so I'm trying something like:
> >
> >  augeas{"user_second_key":
> > context => "/files/home/user/.ssh/config",
> > changes => [ "ins IdentityFile after
> > /files/home/user/.ssh/config/IdentityFile[last()]",
> >  " set
> /files/home/user/.ssh/config/IdentityFile[last()]
> > ~/.ssh/user2nd_rsa",
> >  ],
> > onlyif => "match /files/home/user/.ssh/config/IdentityFile
> > not_include ~/.ssh/user2nd_rsa",
> >
> >   }
> >
> > However it adds the line every puppet run.  I'm wondering what I
> might
> > be doing wrong.
> 
> Try:
> 
> onlyif => "match
> /files/home/user/.ssh/config/IdentityFile[.='~/.ssh/user2nd_rsa']
> size == 0"
> 
> 
> 
> Thanks that works.  
> 
> So what's the point of include and not_include if you have to do this
> weird size thing? 

include/not_include check the return value of the "match " command
and whether it includes or doesn't include the argument.

A match API call in Augeas' API returns a list of paths that match the
argument you pass, so you're actually checking whether those paths
include or don't include a certain value.  It doesn't return the values
of those nodes, which is what you expected.

It's possible the "get " command would work better with
include/not_include, except that API call will only match a single path
and return one value value - so isn't much help with include.

We could do with something better here in the provider for sure, care to
raise a feature request?  Please add me to the watchlist if you do.

-- 
Dominic Cleal
Red Hat Engineering

-- 
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/528154E6.2060206%40redhat.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Error: Could not retrieve catalog from remote server Puppet Enterprise

2013-11-11 Thread Sam Oehlert
We are trying to set up PE 3.1 on RHEL 6 boxes. We were able to install the 
clients fine and they were listed as working in the console. After a while, 
we started to see a bunch of errors that look like this: 

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Puppet::Parser::Compiler failed with error NoMethodError: undefined method 
`[]' for nil:NilClass on node (hostname here)

They don't seem to really give any useful information. Other googling 
usually shows some error in a manifest at the end of the line that points 
to a specific line number in a .pp file, but we don't get that help even. 
Any ideas? If more information is needed, let me know and I'll find 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/9a65faa4-30ee-4edc-95b6-33c7544e3699%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet/Nagios/PuppetDB slow performance

2013-11-11 Thread Chris Handy
If you are looking to implement it via the puppetdbquery module that Ken 
was referring to earlier, here is some code to do so with.  I recently 
implemented this approach with my own setup and it worked out great.  About 
2500 nagios_service resources went from taking 20-30 minutes to about 2. 
 Only issue i ran into was with puppet dashboard when the size of the 
report log became too big to save for one run.  I had to alter the mysql DB 
columns from text to mediumtext and now its all good.

https://gist.github.com/richardc/4714701

On Wednesday, June 5, 2013 3:57:22 PM UTC-4, David Schmitt wrote:
>
> On 2013-06-05 15:53, Jonathan Gazeley wrote: 
> > On 25/05/13 17:24, David Schmitt wrote: 
> >> On 2013-05-25 10:11, Alexander Bien wrote: 
> >>> On 24.05.2013 16:58, Ken Barber wrote: 
>  Its probably the nagios resource, its well known for not scaling when 
>  the files contain a lot of entries. That would explain why your 
>  PuppetDB is showing low load - as its probably not the bottleneck. 
> >>> 
> >>> I second that. We have mysql storeconfigs, about 5000 Services, 2,5 MB 
> >>> nagios_* files and >50k lines of config. The puppet run takes aprox 45 
> >>> minutes. I have heard people on irc say that its not uncommon. 
> >> 
> >> You can cut quite a bit off that time by using templates and files 
> >> (one per service/host) and purging on the base directory. 
> >> 
> > 
> > Hi David, 
> > 
> > Sorry to reply to a stale thread. Please could you explain a bit more on 
> > your solution? Presumably I need to pas some extra arguments to my 
> > spaceship operator that collects the Nagios resources, but how is the 
> > directory-level purging done? 
>
> I'm doing it this way: 
>
> file { 
> "/etc/nagios/conf.d": 
> ensure => directory, 
> source => "puppet:///modules/nagios/empty", 
> ignore => [ '.gitkeep' ], 
> recurse => true, 
> force => true, 
> purge => true; 
> } 
>
> File<<| tag == 'nagios::service' |>> 
>
> define nagios::service(...) { 
> @@file { 
> "/etc/nagios/conf.d/${host}_service_${name}": 
> content => template("nagios/service.erb"), 
> tag => 'nagios::service', 
> ...; 
> } 
>
> This way you collect a minimal number of simple resources. This still is 
> dog slow when you have a couple of thousand services, but it sure beats 
> the heck out of parsing the complete nagios config for each nagios_* 
> resource. 
>
>
>
> Regards, David 
>

-- 
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/2858c151-1647-4bcd-bd3d-6071451aedf1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: Unable to specify hierarchy for data-in-modules

2013-11-11 Thread chengkai liang
Thanks.


On Mon, Nov 11, 2013 at 10:30 AM, Rob Reynolds  wrote:

> I believe this was updated in this ARM
> https://github.com/puppetlabs/armatures/blob/master/arm-9.data_in_modules/index.md
>
> But you may want to check to see if this is still something we are moving
> forward with.
>
>
> On Mon, Nov 11, 2013 at 10:16 AM, MM  wrote:
>
>> Where can I find this updated examples?
>>
>>
>> On Thursday, September 19, 2013 1:03:17 PM UTC-7, Rob Reynolds wrote:
>>
>>> Henrik posted some updates/fixes to his examples. Can you check that
>>> first?
>>>
>>>
>>> On Wed, Sep 18, 2013 at 10:57 AM, Igor Berger wrote:
>>>
 Any ideas?


 On Monday, September 16, 2013 11:30:42 AM UTC-4, Igor Berger wrote:
>
> Hello,
>
> I'm running Puppet agent stand-alone on Windows.
>
> I got data-in-modules working. However, no matter what I put into the
> module hiera.yaml,
> I can only override the defaults from common.yaml by osfamily (and
> not, e.g., by environment).
>
> In the setup below the following command outputs:
>
> >puppet apply --binder -e "notice lookup ('my_key')"
> --environment=local
> Notice: Scope(Class[main]): windows-value
> Notice: Compiled catalog for myhostname in environment local in 1.40
> seconds
>
> And if I delete the osfamily directory, the same command outputs
> "common-value".
>
> So, even though osfamily is not part of the hierarchy, it's used to
> override the common value.
> Conversely, environment is part of the hierarchy, but it's not used.
>
> Did I miss anything?
>
> Thanks,
> Igor.
>
>
> Module structure:
>
> my_module/
> hiera.yaml
> data/
> common.yaml
> environment/
> local.yaml
> osfamily/
> windows.yaml
>
>
> hiera.yaml contains:
>
> ---
> version: 2
> hierarchy:
>   [
>['environment', '${environment}', 'data/environment/${environmen
> t}'],
>['common', 'true', 'data/common']
>   ]
>
>
> data/common.yaml contains:
>
> ---
> my_key: 'common-value'
>
>
> data/osfamily/windows.yaml contains:
>
> ---
> my_key: 'windows-value'
>
>
> data/environment/local.yaml contains:
>
> ---
> my_key: 'local-value'
>
>  --
 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 post to this group, send email to puppet...@googlegroups.com.

 Visit this group at http://groups.google.com/group/puppet-users.
 For more options, visit https://groups.google.com/groups/opt_out.

>>>
>>>
>>>
>>> --
>>> Rob Reynolds
>>> Developer, 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/96546f73-d70b-4057-99cd-307ffc902ad2%40googlegroups.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> Rob Reynolds
> Developer, Puppet Labs
>
> Join us at PuppetConf 2014, September 23-24 in San Francisco
>
> --
> 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/Z_6ehvPEm98/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/CAMJiBK7sxcjhCXJLwOf3mD%2Baq%3DV33NM3C0qD3ZSN%3D2VbmRPfZQ%40mail.gmail.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/CANTbHr_mgF3p-fMAGCUwWL4L-JOX1d%2BBDnA9csnWURGEXNXATg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Module Testing

2013-11-11 Thread John
I've written a module I'd like to test on a puppet client

This is the command and process I am using:

[root@myhost puppet]# /usr/bin/puppet apply 
--modulepath=/etc/puppet/modules/ssh -e "include ssh" --noop --verbose 
--debug
Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
Info: Loading facts in /var/lib/puppet/lib/facter/vrsn.rb
Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/gateway.rb
Info: Loading facts in /var/lib/puppet/lib/facter/uuid.rb
Error: Could not find class ssh for myhost.mydomain.com on node 
myhost.mydomain.com
Error: Could not find class ssh for myhost.mydomain.com on node 
myhost.mydomain.com

The test works in dev, I'm testing on a production "client".  Why does that 
fail?

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/5a5cc2fa-55a6-49e0-bd10-1fdef9a0e06c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Catalogue graph building; nodes *then* edges?

2013-11-11 Thread Ken Coar
Unfortunately, we have many dozen modules and hundreds of classes, with a 
disjoint set of people using and maintaining them.  What you suggest simply 
isn't practical. :-(  Asking the human element to keep track of what 
relevant changes have been made, and alter scripts accordingly, is not only 
error-prone but the sort of thing computers are supposed to do for us..

Thanks, though!


-- 
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/af8023d9-9e42-4d15-bba0-982ca53f2475%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Simplest manner to print a node's catalog

2013-11-11 Thread Thomas Noonan II
Hello, list:
Today a coworker and I were trying to find the easiest way to
print the catalog for a node running Puppet 2.6.x (I know, I advised an
upgrade) and were coming up empty handed.  On a Puppet 3.2.4 node I
found /var/lib/puppet/client_data/catalog/${fqdn}.json, but that didn't
exist on the 2.6.x host.  I couldn't find any "puppet [argument]"
commands that worked.  I was hoping to find something easier than
hitting the PuppetDB API with curl.
Can someone advise on commands to print the catalog on a node,
preferably backwards compatible with Puppet 2.6? Thanks.

--Tom Noonan II

-- 
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/2013134423.19010a07%40TJNII-Desktop.rackspace.corp.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Deployed custom facts with module do not show up

2013-11-11 Thread Matthaus Owens
/etc/puppet/modules is used for deploying needed providers, functions
and facts to agents during a catalog application. The master uses it
to serve those providers, functions, and facts and if modulepath is
passed to a puppet apply, it will also pluginsync those files to the
puppet libdir. `facter -p` only adds the puppet libdir to its load
path, so facts in the modulepath won't be available.

On Wed, Nov 6, 2013 at 5:27 PM, Sergey Sudakovich  wrote:
> Aha, I see so my puppet libdir is /var/lib/puppet/lib, but why when I
> install a module, it goes into /etc/puppet/modules?
>
>
> On Wednesday, November 6, 2013 5:07:39 PM UTC-8, Matthaus Litteken wrote:
>>
>> Sergey,
>> `facter -p` adds puppet's libdir to the load path to load module based
>> facts. When running against a master, facts are pluginsynced into this
>> directory prior to facter running. You need to make sure that the
>> facter directory from your module is in your puppet libdir (you can
>> find out what yours is set to by running `puppet agent --configprint
>> libdir`). So if your puppet libdir was /var/lib, your libdir should
>> look like the following to ensure custom facts are loaded.
>>
>> var
>> └── lib
>> └── facter
>> ├── custom_fact.rb
>> ├── license
>> │   └── thing.rb
>> ├── moar_facts.rb
>> ├── other_fact.rb
>> └── root_home.rb
>>
>> On Wed, Nov 6, 2013 at 1:37 PM, Sergey Sudakovich 
>> wrote:
>> > Do deploy the module, I just do this:
>> > puppet module install -f license-0.1.0.tar.gz
>> > Then to test, i run
>> > puppet module list
>> > /etc/puppet/modules
>> > └──my-license (v0.1.0)
>> >
>> > facter -p gives me the same output and facter with no parameters.
>> >
>> >
>> > On Tuesday, November 5, 2013 5:48:46 PM UTC-8, Matthaus Litteken wrote:
>> >>
>> >> How are you deploying the module? Facter won't load module based facts
>> >> by
>> >> default, you need to use 'facter -p' to have Facter load those facts.
>> >>
>> >> On Tuesday, November 5, 2013, Sergey Sudakovich wrote:
>> >>>
>> >>> When I deploy a module I wrote with couple of custom facts, those
>> >>> facts
>> >>> do not show up in factor.
>> >>> But when I point FACTORLIB to the directory with those factor, they
>> >>> work
>> >>> just fine.
>> >>> I am running a masterless puppet version 2.7.22 and factor 1.7.1
>> >>> The module structure looks like so:
>> >>>
>> >>> -license
>> >>> ---lib
>> >>> -facter
>> >>> ---license.rb
>> >>> ---hardware_serial.rb
>> >>> -puppet
>> >>>
>> >>>
>> >>> Any idea what is causing this problem or at least where to start the
>> >>> debugging?
>> >>>
>> >>> --
>> >>> 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/58f49f57-f55c-425f-b408-1b286336ddb7%40googlegroups.com.
>> >>> For more options, visit https://groups.google.com/groups/opt_out.
>> >>
>> >>
>> >>
>> >> --
>> >> Matthaus Owens
>> >> Release Manager, 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...@googlegroups.com.
>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/puppet-users/6aa31c1c-e492-43ae-9d79-e1acc84760a0%40googlegroups.com.
>> >
>> > For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>> --
>> Matthaus Owens
>> Release Manager, 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/6535d35d-aef4-4dce-9675-67c5c44d3e99%40googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.



-- 
Matthaus Owens
Release Manager, 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/CACD%3DwAfQyaHO%3D_g8h9pb6EiQJe--%3DS8AQkg1WOgjBqmZq-pcMA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: Unable to specify hierarchy for data-in-modules

2013-11-11 Thread Rob Reynolds
I believe this was updated in this ARM
https://github.com/puppetlabs/armatures/blob/master/arm-9.data_in_modules/index.md

But you may want to check to see if this is still something we are moving
forward with.


On Mon, Nov 11, 2013 at 10:16 AM, MM  wrote:

> Where can I find this updated examples?
>
>
> On Thursday, September 19, 2013 1:03:17 PM UTC-7, Rob Reynolds wrote:
>
>> Henrik posted some updates/fixes to his examples. Can you check that
>> first?
>>
>>
>> On Wed, Sep 18, 2013 at 10:57 AM, Igor Berger  wrote:
>>
>>> Any ideas?
>>>
>>>
>>> On Monday, September 16, 2013 11:30:42 AM UTC-4, Igor Berger wrote:

 Hello,

 I'm running Puppet agent stand-alone on Windows.

 I got data-in-modules working. However, no matter what I put into the
 module hiera.yaml,
 I can only override the defaults from common.yaml by osfamily (and not,
 e.g., by environment).

 In the setup below the following command outputs:

 >puppet apply --binder -e "notice lookup ('my_key')"
 --environment=local
 Notice: Scope(Class[main]): windows-value
 Notice: Compiled catalog for myhostname in environment local in 1.40
 seconds

 And if I delete the osfamily directory, the same command outputs
 "common-value".

 So, even though osfamily is not part of the hierarchy, it's used to
 override the common value.
 Conversely, environment is part of the hierarchy, but it's not used.

 Did I miss anything?

 Thanks,
 Igor.


 Module structure:

 my_module/
 hiera.yaml
 data/
 common.yaml
 environment/
 local.yaml
 osfamily/
 windows.yaml


 hiera.yaml contains:

 ---
 version: 2
 hierarchy:
   [
['environment', '${environment}', 'data/environment/${environmen
 t}'],
['common', 'true', 'data/common']
   ]


 data/common.yaml contains:

 ---
 my_key: 'common-value'


 data/osfamily/windows.yaml contains:

 ---
 my_key: 'windows-value'


 data/environment/local.yaml contains:

 ---
 my_key: 'local-value'

  --
>>> 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 post to this group, send email to puppet...@googlegroups.com.
>>>
>>> Visit this group at http://groups.google.com/group/puppet-users.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>>
>> --
>> Rob Reynolds
>> Developer, 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/96546f73-d70b-4057-99cd-307ffc902ad2%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Rob Reynolds
Developer, 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/CAMJiBK7sxcjhCXJLwOf3mD%2Baq%3DV33NM3C0qD3ZSN%3D2VbmRPfZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: Difference btw. 3.1.1 and 0.25.5

2013-11-11 Thread Aurélien Degrémont

Le 11/11/2013 16:07, jcbollinger a écrit :


  * Puppet 3 seems to have poorer performance, though it's not
entirely clear whether that's a core problem or whether it arises
from use of new features.

When migrating from 0.25 to 3.1, we only adapt our modules to workaround 
compatibility changes. We did not use any new features introduced since 
0.25 and Puppet 2.7 & 3  is significantly slower than 0.25

This does not come from *using* new features.



Aurélien

--
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/5281095B.1050806%40cea.fr.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: Unable to specify hierarchy for data-in-modules

2013-11-11 Thread MM
Where can I find this updated examples?

On Thursday, September 19, 2013 1:03:17 PM UTC-7, Rob Reynolds wrote:
>
> Henrik posted some updates/fixes to his examples. Can you check that first?
>
>
> On Wed, Sep 18, 2013 at 10:57 AM, Igor Berger 
> > wrote:
>
>> Any ideas?
>>
>>
>> On Monday, September 16, 2013 11:30:42 AM UTC-4, Igor Berger wrote:
>>>
>>> Hello,
>>>
>>> I'm running Puppet agent stand-alone on Windows.
>>>
>>> I got data-in-modules working. However, no matter what I put into the 
>>> module hiera.yaml,
>>> I can only override the defaults from common.yaml by osfamily (and not, 
>>> e.g., by environment).
>>>
>>> In the setup below the following command outputs:
>>>
>>> >puppet apply --binder -e "notice lookup ('my_key')" --environment=local
>>> Notice: Scope(Class[main]): windows-value
>>> Notice: Compiled catalog for myhostname in environment local in 1.40 
>>> seconds
>>>
>>> And if I delete the osfamily directory, the same command outputs 
>>> "common-value".
>>>
>>> So, even though osfamily is not part of the hierarchy, it's used to 
>>> override the common value.
>>> Conversely, environment is part of the hierarchy, but it's not used.
>>>
>>> Did I miss anything?
>>>
>>> Thanks,
>>> Igor.
>>>
>>>
>>> Module structure:
>>>
>>> my_module/
>>> hiera.yaml
>>> data/
>>> common.yaml
>>> environment/
>>> local.yaml
>>> osfamily/
>>> windows.yaml
>>>
>>>
>>> hiera.yaml contains:
>>>
>>> ---
>>> version: 2
>>> hierarchy:
>>>   [
>>>['environment', '${environment}', 'data/environment/${environment}'],
>>>['common', 'true', 'data/common']
>>>   ]
>>>
>>>
>>> data/common.yaml contains:
>>>
>>> ---
>>> my_key: 'common-value'
>>>
>>>
>>> data/osfamily/windows.yaml contains:
>>>
>>> ---
>>> my_key: 'windows-value'
>>>
>>>
>>> data/environment/local.yaml contains:
>>>
>>> ---
>>> my_key: 'local-value'
>>>
>>>  -- 
>> 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 post to this group, send email to puppet...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/puppet-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Rob Reynolds
> Developer, 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/96546f73-d70b-4057-99cd-307ffc902ad2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] augeas onlyif problem

2013-11-11 Thread Jist Anidiot


On Friday, November 8, 2013 12:23:11 PM UTC-5, Dominic Cleal wrote:
>
> On 06/11/13 21:17, Jist Anidiot wrote: 
> > I'm trying to make sure a specific user has a special ssh key used as 
> > his identity file. 
> > 
> > so I'm trying something like: 
> > 
> >  augeas{"user_second_key": 
> > context => "/files/home/user/.ssh/config", 
> > changes => [ "ins IdentityFile after 
> > /files/home/user/.ssh/config/IdentityFile[last()]", 
> >  " set /files/home/user/.ssh/config/IdentityFile[last()] 
> > ~/.ssh/user2nd_rsa", 
> >  ], 
> > onlyif => "match /files/home/user/.ssh/config/IdentityFile 
> > not_include ~/.ssh/user2nd_rsa", 
> > 
> >   } 
> > 
> > However it adds the line every puppet run.  I'm wondering what I might 
> > be doing wrong. 
>
> Try: 
>
> onlyif => "match 
> /files/home/user/.ssh/config/IdentityFile[.='~/.ssh/user2nd_rsa'] size == 
> 0" 
>
>
>
Thanks that works.  

So what's the point of include and not_include if you have to do this weird 
size thing? 

-- 
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/88458230-d854-4d01-a548-0294357de04c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Difference btw. 3.1.1 and 0.25.5

2013-11-11 Thread jcbollinger


On Saturday, November 9, 2013 4:37:08 AM UTC-6, ytmp123 wrote:
>
> Hi guys,
>
> Can you tell me what advantages / differences / new Features Puppet 3.1.1 
> has in comparins to Puppet 0.25.5? I did a lot of research, but your 
> englithenment would 
> be much better. 
>
>
Key features added between Puppet 0.25.x and 3.1.x:

   - Parameterized classes
   - Hiera, integrated into the Puppet core
   - automatic class parameter binding

Key features deprecated or removed:

   - Dynamic variable scoping

Other considerations:

   - Puppet 0.25 is no longer supported.
   - Substantially *all* continued development in the Puppet ecosystem is 
   directed at the Puppet 3 series, not only by PL but also by third-party 
   developers.
   - Puppet 3 seems to have poorer performance, though it's not entirely 
   clear whether that's a core problem or whether it arises from use of new 
   features.


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/000a5830-b5df-4991-a51b-5e2c42526c99%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Some resources not applied on first run

2013-11-11 Thread jcbollinger


On Friday, November 8, 2013 1:53:28 PM UTC-6, Guy Knights wrote:
>
> I've noticed from time to time, and with certain manifests, that sometimes 
> there are resources that won't be applied on first run. There's no errors 
> during the initial run to say that a dependency failed, the resource just 
> isn't applied. If I then run puppet again after the first run, the resource 
> seems to then be applied ok.
>
> Does anyone know why this might happen? As I said, it's only an occasional 
> occurrence, and only with some manifests.
>
>

If a resource is not applied, and there is no error message indicating that 
it or one of its dependencies failed, then either that resource is already 
in sync or it is not in the catalog at all.  Running the agent in --debug 
mode should allow you to distinguish those alternatives.

Do note, however, that "one of its dependencies failed" includes not just 
related resources, but also the requirements of the resource's provider.  
Most providers depend on external programs, and Puppet will check for their 
existence when trying to choose providers for all the resources in the 
catalog, before applying any resources.  It cannot apply a resource for 
which there is no applicable provider, but if the binaries required by some 
provider are installed by Puppet then that provider will be available 
during the next Puppet run.


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/0bac0e3d-9efe-48d5-9dcc-53b0ed4139a3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] What the correct way to downgrade version with puppet? (CentOS 6.4)

2013-11-11 Thread Derek Harkness
You can specify a version string for each package.

package { [ ‘php-xml’, ‘php-common’ ]:
ensure => “5.3.3”,
}

You might have to break them out and add in some dependency.

On Nov 10, 2013, at 6:08 , shlo.af...@gmail.com wrote:

> Hi,
> I'm using Puppet to downgrade php from 5.5.5 to 5.3.3. It failed because yum 
> command failed.
> It has dependencies that need to removed or downgrade.
>...
>php-common(x86-64) = 5.5.5-2.el6.remi is needed by (installed) 
> php-xml-5.5.5-2.el6.remi.x86_64
>...
> 
> How can I tell Puppet to remove the php-xml, php-common etc from the higher 
> version and to install php  and those packages  (php-xml, php-common etc) he 
> just remove in  lower version?
> 
> 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/8147ba9c-3f34-4b99-a02e-fd23909fb553%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/1480C2B3-3A5D-4A07-BB85-B9CCA4AF8266%40mac.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Catalogue graph building; nodes *then* edges?

2013-11-11 Thread jcbollinger


On Friday, November 8, 2013 1:18:04 PM UTC-6, Ken Coar wrote:
>
> Puppet 2.7 (primarily; soon going to 3).
>
> When a host's catalogue is built, Puppet collects all
> the graph nodes first, correct?  And **then** adds the
> dependency edges between them?
>
> Why do I ask?  Because I keep coming up against a desire
> for one class to know whether another one is in the
> catalogue before it declares a dependency relationship.
> defined() doesn't cut it, since the class in question may not
> have been scanned yet.
>
> If it's collect **then** connect, I'll be adding a FREQ for
> a function (or other means) to access/check the collection
> prior to the connexion phase..
>
>

You are wise to avoid defined() here, but I think you would be wiser still 
to give up the whole idea of testing the catalog under construction to 
guide decisions about what (other) resources need to be declared.  It is 
always possible to write your configuration such, though some manifest set 
architectures may lend themselves better to that than do others.

If you have a resource A that you want to declare only if resource B is 
also declared, then the key is to pull up the logic controlling B's 
declaration to encompass the scope of A's declaration as well (which may be 
subject to additional conditions).  The "roles and profiles" pattern is 
well suited to this sort of arrangement, though you can surely find other 
viable approaches as well.


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/29272f7b-bfc6-4fd2-8f42-b67a99e68283%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Check the output of a exec

2013-11-11 Thread jcbollinger


On Friday, November 8, 2013 9:06:08 AM UTC-6, giovanni possemato wrote:
>
> Hi all,
>
> i'm making a manifest for an agent on windows.
> I have to make some actions ONLY if a file already exists.
> I tried in this way, but it seems dowsn't work..
>
> class sql2008{
>
>   package { sql2008:
> ensure => present,
>   }
>
>   exec {'check_dotnet':
> command => 'IF EXIST 
> c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll (echo 1) ELSE 
> (echo 0)',
> returns => $check_dotnet_exist
> 
>   }
>
>   notice("  __ $check_dotnet_exist __ ")
>
> }
>
> When i call the agent, the notice message is "__ __"
> How can i save the output of the exec in a variable?
>
>

You can't.  You can, however, create a custom fact that will contain the 
output generated by your command.   The fact will be evaluated before each 
Puppet run, so it will be available to all your classes.  See 
http://docs.puppetlabs.com/guides/custom_facts.html.


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/5f1751f8-c7f8-47fe-ad2b-33fdeadba40e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: Few questions about Puppet

2013-11-11 Thread jcbollinger


On Monday, November 11, 2013 3:30:36 AM UTC-6, shazni nazeer wrote:
>
> Hi Rich,
>
> Thanks for the reply. May be I'm trying to do what puppet is not designed 
> for. I had the requirement of replacing a directory with another directory 
> and then run a script to test certain things with that directory content, 
> and once that completed I wanted the same directory to be replaced with a 
> completely different directory and run another script. The problem is how 
> do I replace the same directory twice at two different times?
>


Puppet is not a script engine; it is a state management service.  You 
describe a target machine state to Puppet, and Puppet puts the machine into 
that state.  You cannot declare two different target states for the same 
physical resource because it does not make sense.  The longstanding system 
design in fact enforces a stronger constraint that you cannot declare the 
same resource twice, even with the same properties.

You cannot manage the same resource into two or more different states 
during the same Puppet run.  You could conceivably perform multiple runs, 
perhaps selecting which test to perform via tags, but at that point you 
have to consider why you are using Puppet for the job instead of some other 
system for which it is a more natural fit.

 

> That's why I told, this may not be achievable in puppet, because it's not 
> designed to perform these sort of works.
>
>

Oh, it's achievable.  At worst, you can write up a shell script that 
performs the whole job, including file manipulation, and have Puppet run it 
via an Exec resource.  I think, however, that you might be looking for an 
automated testing framework as your top-level system.  You could perhaps 
integrate Puppet into your system at a lower level, using it (say) on a 
per-test-case basis to set up your test fixtures.


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/4aee8fee-b74f-449a-80ce-c7fd76fbbe9c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Difference btw. 3.1.1 and 0.25.5

2013-11-11 Thread Aurélien Degrémont

Hello

I'm currently in the process of studying how upgrade our 0.25 puppet 
installation to Puppet 3. I'm currently working on 3.1.1.


I've first looked at incompatibility aspects and I'm know this area 
pretty well now.

After that, I will have a closer look to new feature.

So far, quickly, few advantages:
 - Puppet 3 is supported, with security fixes and under active development
 - New feature like parameterized classes seems very useful
On the drawback sides
 - Puppet 2.6 is slower, 2.7 is even worst and 3.1 is still far from 0.25
 - Some changes in manifest parsing could requires some changes 
depending how you write them.


(this is a very limited scope of differences between those 2 versions)

Aurélien

Le 09/11/2013 11:37, ytmp123 a écrit :

Hi guys,

Can you tell me what advantages / differences / new Features Puppet 
3.1.1 has in comparins to Puppet 0.25.5? I did a lot of research, but 
your englithenmentwould be much better.


Thank's very much!
--
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/41b23dcc-da91-4111-9698-e3930c763675%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/5280BFAA.5000909%40cea.fr.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: Few questions about Puppet

2013-11-11 Thread shazni nazeer
Hi Rich,

Thanks for the reply. May be I'm trying to do what puppet is not designed 
for. I had the requirement of replacing a directory with another directory 
and then run a script to test certain things with that directory content, 
and once that completed I wanted the same directory to be replaced with a 
completely different directory and run another script. The problem is how 
do I replace the same directory twice at two different times? That's why I 
told, this may not be achievable in puppet, because it's not designed to 
perform these sort of works.

thanks,

Shazni

On Friday, October 25, 2013 4:32:03 AM UTC+5:30, Rich Burroughs wrote:
>
> It's not clear to me exactly what you're trying to do. Unless I'm 
> misreading something, both of those file resources are exactly the same. 
> I'm not sure why you would need to manage the same resource twice with the 
> same settings, but as the earlier person said, you can't.
>
> Maybe part of the confusion comes from you thinking of manifests as 
> scripts. They're not. With Puppet what you're doing is specifying what you 
> want the running state of the system to be. And for a given resource, like 
> a file, that's one state. And every time the agent runs, it will make sure 
> the resource is in that state.
>
> In fact by default Puppet may not do things in a given manifest in the 
> order that they appear in the manifest, unless you do something 
> specifically to control that. There's a doc on resource ordering here:
>
> http://docs.puppetlabs.com/learning/ordering.html
>
>
> Rich
>
>
>
> On Wed, Oct 23, 2013 at 5:28 AM, shazni nazeer 
> 
> > wrote:
>
>>
>> Thank Rahul for your responses.
>>
>> I would like to know how do I achieve my requirements. The second one 
>> seems a bit trickier
>>
>>
>> On Wednesday, October 23, 2013 3:41:08 PM UTC+5:30, shazni nazeer wrote:
>>>
>>> Hi All,
>>>
>>> I'm new to puppet and I've three requirements to achieve using puppet. 
>>>
>>> 1. I've a json file shown below that I need to modify, when I run my 
>>> puppet script. 
>>>
>>> {
>>> "assets":{
>>>
>>> "ignore":[],
>>> "icons":{
>>> "gadget":"icon-dashboard",
>>> "ebook" :"icon-ebook",
>>> "site" :"icon-site",
>>> "default":"icon-dashboard"
>>> }   
>>>  }   
>>> }
>>>
>>> I need to add a new entry in the mid of "icons", say "a":"b". 
>>> How do I do this?
>>>
>>> 2. I replace a directory using another directory. And I need to do the 
>>> same after doing some other additions to configuration. I get the following 
>>> error when I apply the 'file" resource twice.
>>>
>>> Duplicate declaration: File[/home/shazni/Documents/
>>> Junk/wso2greg-4.6.0/samples/asset-models/ApplicationModel/] is already 
>>> declared in file /home/shazni/.puppet/modules/gregstore/manifests/init.pp 
>>> at line 85; cannot redeclare at /home/shazni/.puppet/modules/
>>> gregstore/manifests/init.pp:108 on node wso2-thinkpad-t530.private.
>>> wso2.com
>>>
>>> My script does this.
>>>
>>> file { "$StoreHome/repository/deployment/server/jaggeryapps/
>>> store/extensions/assets/servicex":
>>> ensure => directory,
>>> recurse => true,
>>> purge => true,
>>> force => true,
>>> source => "puppet:///modules/gregstore/
>>> setup-beta2/store/servicex/",
>>> }  
>>>
>>>   // Some more work 
>>>
>>> file { "$StoreHome/repository/deployment/server/jaggeryapps/
>>> store/extensions/assets/servicex":
>>> ensure => directory,
>>> recurse => true,
>>> purge => true,
>>> force => true,
>>> source => "puppet:///modules/gregstore/
>>> setup-beta2/store/servicex/",
>>> }  
>>>
>>> How to solve this issue?
>>>
>>> 3. I want to run a script file, which in turn invoke some java class 
>>> files. How to to do it in the same 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...@googlegroups.com .
>> To post to this group, send email to puppet...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/puppet-users.
>> 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/a2db6aed-a5df-4946-994f-890e92278fff%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.