Issue #12418 has been updated by Daniel Pittman.

Garrett Honeycutt wrote:
> I was using symlinks to deal with using $operatingsystem in file sources and 
> having to account for CentOS and RedHat having the same content and not 
> wanting to have separate files in the module. Though this could all be 
> replaced thanks to the new $osfamily fact.

You wanted the content that symlink pointed to as a regular file on the agent, 
right, and not that sysctl.conf was a symlink pointing to the (non-existent) 
`sysctl.RedHat` file?

That behaviour will be the *only* option, if we remove this.  Previously you 
could have added `links => manage` and had that create the symbolic link on the 
agent.  We want to remove that specific behaviour, only.  Using a symlink to 
point to another file that is deliver on the agent as a file?  Fine.

----------------------------------------
Bug #12418: links => follow can't replace existing symlinks in the destination 
directory
https://projects.puppetlabs.com/issues/12418#change-54618

Author: Nick Fagerlund
Status: Needs Decision
Priority: Normal
Assignee: Daniel Pittman
Category: file
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


When serving a directory recursively, setting the `links` attribute to `follow` 
is supposed to dereference symlinks in the source and serve their targets to 
the destination as normal files. However, it can't replace existing symlinks in 
the destination directory, so it's not idempotent.

Assume that `$modulepath/fistfuloflinks/files/links` is a directory containing 
directories that contain symlinks. 

### Step 1

Apply the following resource:

    file {'/tmp/fistfuloflinks':
      ensure  => directory,
      source  => "puppet:///modules/fistfuloflinks/links",
      recurse => true,
      links   => follow,
      force   => true,
    }

As expected, the directories it creates contain normal files.

### Step 2:

Change the value of "links" to "manage," then apply the modified resource. As 
expected, the directories now mimic the source directories -- instead of normal 
files, they have symlinks. 

### Step 3:

Change "links" back to "follow" and apply again. Whoops: they stay symlinks 
instead of turning back to normal files. You can only get back to the results 
of step 1 if you delete the files out of band before applying the resource. 

Tested in puppet 2.7.6. Of course, it only now occurs to me that probably no 
one is actually using this feature, since putting symlinks inside a module is 
kind of brittle and deranged. 


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to