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

Setting ensure=>directory with source as a file creates a file instead of a directory

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: PUP 3.6.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Template:

      Description

      When creating a file resource, setting ensure => directory and source to be a file, Puppet creates a file with the contents of the source, and doesn't ensure the new file is a directory.

      I'm not sure if this is intended behavior or a bug.

      Steps to reproduce:
      1. echo "I am a file" > /tmp/a_file
      2. Apply manifest

      Result:
      /tmp/a_directory is a file with "I am a file" inside it

      Manifest used:

      file { "/tmp/a_directory":
        ensure  => directory,
        source => '/tmp/a_file',
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              joe.pinsonault Joe Pinsonault
              QA Contact:
              Joe Pinsonault
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support