Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sshkey uses name instead of title for duplication check #95

Open
anarcat opened this issue Nov 21, 2024 · 0 comments
Open

sshkey uses name instead of title for duplication check #95

anarcat opened this issue Nov 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@anarcat
Copy link

anarcat commented Nov 21, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant