Skip to content

sshkey uses name instead of title for duplication check #95

@anarcat

Description

@anarcat

Describe the Bug

With 2 resources named pxe-example.com and dhcp-example.com I get duplicate definition error. The target and title are different in both. The rest is the same.

sshkey { 'pxe-example.com':
    ensure => 'present',
    name   => 'example.com',
    type   => 'ssh-rsa',
    key    => '<redacted>',
    target => '/var/lib/<user>/.ssh/known_hosts',
}

In an environment where sshd is intentionally configured to not read a global known hosts file, attempting to change the resource title for the same key installed into different locations fails.

Cannot alias Sshkey[pxe-example.com] to ["example.com"] at /etc/puppetlabs/code/environments/dhcp/site/role/manifests/pxe.pp:56; resource ["Sshkey", "example.com"] already declared at /etc/puppetlabs/code/environments/dhcp/site/role/manifests/dhcp.pp:73 at /etc/puppetlabs/code/environments/dhcp/site/role/manifests/pxe.pp:56:3 on node dhcp-failover.err.internal

Expected Behavior

Expected behavior is that changing the title suffices in it being a different resource.

Steps to Reproduce

See above.

Environment

  • Version puppetserver-2.7.2-1.el6.noarch (2.7.2)/puppet-agent-1.9.3-1.el6.x86_64 (4.9.4)
  • Platform CentOS 6.8/6.9

Additional Context

This was originally filed as MODULES-7610.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions