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 <mshazninaz...@gmail.com>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 "aaaaa":"bbbbb". 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 <http://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+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to