So here is a scenario: I have a directory: ./foo ./foo/file1 ./foo/file2 ./foo/file3 … ./foo/fileN I populate this directory on a configured machine via a recursive file resource. What I would like to do is create a symlink from the parent directory to each filen in the foo subdirectory? Is there some easy way to get puppet to do that? Basically I would like to iterate thru ln -s ./foo/filen ./filen Short of writing a shell script, downloading it, and Exec''ing it? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Why not sync the files directly to that directory? On Dec 3, 2010, at 12:48 PM, Don Jackson wrote:> > So here is a scenario: > > I have a directory: > > ./foo > ./foo/file1 > ./foo/file2 > ./foo/file3 > … > ./foo/fileN > > I populate this directory on a configured machine via a recursive file resource. > > What I would like to do is create a symlink from the parent directory to each filen in the foo subdirectory? > > Is there some easy way to get puppet to do that? > > Basically I would like to iterate thru > > ln -s ./foo/filen ./filen > > Short of writing a shell script, downloading it, and Exec''ing it? > > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Dec 3, 2010, at 12:56 PM, Patrick wrote:> Why not sync the files directly to that directory?There are other files in the parent directory that are not managed by puppet. And the names of the files are dynamic enough that it would be painful to explicity manage each file in the puppet manifest. So, what I prefer to do, is tell puppet: Create a directory, and fill it with all contents of a comparable directory on the puppet file server. And then create links from the parent directory into this managed subdirectory.> On Dec 3, 2010, at 12:48 PM, Don Jackson wrote: > >> >> So here is a scenario: >> >> I have a directory: >> >> ./foo >> ./foo/file1 >> ./foo/file2 >> ./foo/file3 >> … >> ./foo/fileN >> >> I populate this directory on a configured machine via a recursive file resource. >> >> What I would like to do is create a symlink from the parent directory to each filen in the foo subdirectory? >> >> Is there some easy way to get puppet to do that? >> >> Basically I would like to iterate thru >> >> ln -s ./foo/filen ./filen >> >> Short of writing a shell script, downloading it, and Exec''ing it? >> >> >> -- >> You received this message because you are subscribed to the Google Groups "Puppet Users" group. >> To post to this group, send email to puppet-users@googlegroups.com. >> To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. >> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
The catalog that is shipped to the client is immediately applied without reevaluating the state of the client (that evaluation is done during catalog compilation on the master with the provided facts). I think what you''re looking for is for puppet to download a catalog, revise the resources that should be managed, then apply the catalog, which isn''t currently possible. You could create a custom fact that returns the list of files in the directory, but that fact is only evaluated at the start of the puppet run. -Hunter On Fri, Dec 3, 2010 at 14:15, Don Jackson <puppet-users@clark-communications.com> wrote:> > On Dec 3, 2010, at 12:56 PM, Patrick wrote: > > Why not sync the files directly to that directory? > > There are other files in the parent directory that are not managed by > puppet. > And the names of the files are dynamic enough that it would be painful to > explicity manage each file in the puppet manifest. > So, what I prefer to do, is tell puppet: > Create a directory, and fill it with all contents of a comparable directory > on the puppet file server. > And then create links from the parent directory into this managed > subdirectory. > > > > > On Dec 3, 2010, at 12:48 PM, Don Jackson wrote: > > > So here is a scenario: > > I have a directory: > > ./foo > > ./foo/file1 > > ./foo/file2 > > ./foo/file3 > > … > > ./foo/fileN > > I populate this directory on a configured machine via a recursive file > resource. > > What I would like to do is create a symlink from the parent directory to > each filen in the foo subdirectory? > > Is there some easy way to get puppet to do that? > > Basically I would like to iterate thru > > ln -s ./foo/filen ./filen > > Short of writing a shell script, downloading it, and Exec''ing it? > > > -- > > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > > To post to this group, send email to puppet-users@googlegroups.com. > > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Puppet won''t bother other files in a directory it manages unless you turn on "purge => true". On Fri, Dec 3, 2010 at 2:15 PM, Don Jackson < puppet-users@clark-communications.com> wrote:> > On Dec 3, 2010, at 12:56 PM, Patrick wrote: > > Why not sync the files directly to that directory? > > > There are other files in the parent directory that are not managed by > puppet. > > And the names of the files are dynamic enough that it would be painful to > explicity manage each file in the puppet manifest. > > So, what I prefer to do, is tell puppet: > > Create a directory, and fill it with all contents of a comparable directory > on the puppet file server. > > And then create links from the parent directory into this managed > subdirectory. > > > > > > On Dec 3, 2010, at 12:48 PM, Don Jackson wrote: > > > So here is a scenario: > > > I have a directory: > > > ./foo > > ./foo/file1 > > ./foo/file2 > > ./foo/file3 > > … > > ./foo/fileN > > > I populate this directory on a configured machine via a recursive file > resource. > > > What I would like to do is create a symlink from the parent directory to > each filen in the foo subdirectory? > > > Is there some easy way to get puppet to do that? > > > Basically I would like to iterate thru > > > ln -s ./foo/filen ./filen > > > Short of writing a shell script, downloading it, and Exec''ing it? > > > > -- > > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > > To post to this group, send email to puppet-users@googlegroups.com. > > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Fri, Dec 3, 2010 at 12:48 PM, Don Jackson < puppet-users@clark-communications.com> wrote:> > So here is a scenario: > > I have a directory: > > ./foo > ./foo/file1 > ./foo/file2 > ./foo/file3 > … > ./foo/fileN > > I populate this directory on a configured machine via a recursive file > resource. > > What I would like to do is create a symlink from the parent directory to > each filen in the foo subdirectory? > > Is there some easy way to get puppet to do that? > > Basically I would like to iterate thru > > ln -s ./foo/filen ./filen > > Short of writing a shell script, downloading it, and Exec''ing it? >Performing iteration through arrays is currently difficult using Puppet''s DSL. Starting in 2.6.x, it is possible to write manifests in Ruby. It is currently not documented sufficiently, but here is a blog that demonstrates the capability. http://www.puppetlabs.com/blog/ruby-dsl/ -Dan> > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 12/03/2010 09:48 PM, Don Jackson wrote:> > So here is a scenario: > > I have a directory: > > ./foo > ./foo/file1 > ./foo/file2 > ./foo/file3 > … > ./foo/fileN > > I populate this directory on a configured machine via a recursive file resource. > > What I would like to do is create a symlink from the parent directory to each filen in the foo subdirectory? > > Is there some easy way to get puppet to do that? > > Basically I would like to iterate thru > > ln -s ./foo/filen ./filen > > Short of writing a shell script, downloading it, and Exec''ing it?You should be able to come up with a shell one liner and exec that directly. That''s what I''d do, if I was desperate to not include the filenames in the manifest at all. Now, if I was free to have an array of filenames in the manifest, I could do something more elegant using a define... HTH, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.