Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-7393

stdlib : Duplicate declaration with ensure_resources

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • None
    • None
    • stdlib
    • None
    • stdlib >= 4.17.0

      Pupppet 4.6.1

    • Needs Assessment
    • Needs Assessment

    Description

      We're seeing duplicate declaration errors with a custom type that's creating a file using ensure_resource (https://github.com/puppetlabs/puppetlabs-docker/blob/master/manifests/image.pp#L58-L66 )

      docker::image { $image_a: }
      docker::image { $image_b: } 

      Duplicate declaration: File[/usr/local/bin/update_docker_image.sh] is already declared in file /etc/puppetlabs/code/modules/docker/manifests/image.pp:58; cannot redeclare at /etc/puppetlabs/code/modules/docker/manifests/image.pp:58 at /etc/puppetlabs/code/modules/docker/manifests/image.pp:58:3
        at /etc/puppetlabs/code/environments/production/modules/profile/manifests/docker/$redacted/packer.pp:11 on node redacted 

      This works fine with stdlib 4.16.0 and breaks with 4.17. and up. Puppet version 4.6.1.

      I've traced this down to the following difference:

      4.16  findresource(file[/usr/local/bin/update_docker_image.sh]) -> File[/usr/local/bin/update_docker_image.sh]
      4.17+ findresource(Puppet::Type::File, /usr/local/bin/update_docker_image.sh) -> not found

      It seems as puppet is not able to understand, that they should be the same type. Though, since 4.6 is still supported in stdlib, this needs to be addressed.

      Attachments

        Activity

          People

            Unassigned Unassigned
            beck Christian Becker
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Zendesk Support