Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5830

Remove crazy symlink behavior


    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Do
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Template:
    • Team:
    • Sprint:
      Coremunity Hopper


      While digging around symlink behavior for direct Puppet, we discovered many strange and unexpected ways to use (or attempt to use) symlinks with Puppet. Many of these are clearly outright incorrect and shouldn't be allowed at all. See the comments for a full listing of behavior.

      As a breaking change in Puppet 5, we should disallow these crazy symlink scenarios.

      Setting ensure => link and using the source parameter.

      This never actually makes sense, but is currently allowed by Puppet with often surprising results. Depending on what source refers to, you may end up with a symlink, a flat file, or a broken symlink on the agent. The intended behavior of a manifest written with the source parameter can (and should) be obtained by using the target parameter instead.

      Example of some crazy behavior:

      file { '/tmp/a_file':
        ensure => link,
        links => manage,
        source => ‘file:///tmp/real_file’,

      The result of this is that /tmp/a_file is created as a regular file (not a symlink!) with the copied contents of /tmp/real_file. When source is set like this, the ensure parameter is ignored. This should not be allowed, and we think ensure => link and source should probably be mutually exclusive.

      Example 2:

      file { '/tmp/a_file':
        ensure => link,  
        links => manage,
        source => 'puppet:///modules/ntp/foo_link_file',

      In this case, /tmp/a_file becomes a broken symlink to whatever path foo_link_file points to on the master (unless a file happens to exist at the same path on the agent).


          Issue Links



              • Assignee:
                whopper William Hopper
              • Votes:
                0 Vote for this issue
                7 Start watching this issue


                • Created:

                  Zendesk Support