Cannot alias definition, duplicate declaration

448 views
Skip to first unread message

Julie Iaccarino

unread,
May 20, 2016, 8:04:53 AM5/20/16
to Puppet Users
Hey all! I've got a bit of an oddity.

I've upgraded from 3.7 to 4.4 and gone over the upgrade checklist for my code, but I'm still getting some catalog errors.


2016-05-19 15:06:51 +0000 Puppet (err): Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Resource Statement, Cannot alias Registry_value[register host key Debug.1.00.2073 build copy c:\webservicestore.zip] to ["HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\SshHostKeys\\################"] at /etc/puppetlabs/code/environments/production/modules/profiles/manifests/build/scp_copy.pp:5; resource ["Registry_value", "HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\SshHostKeys\\##############"] already declared at /etc/puppetlabs/code/environments/production/modules/profiles/manifests/build/scp_copy.pp:5 at /etc/puppetlabs/code/environments/production/modules/profiles/manifests/build/scp_copy.pp:5:5 at /etc/puppetlabs/code/environments/production/modules/profiles/manifests/build/util/zip_retrieve.pp:12 on node ##################


It's nothing super fancy, just a SCP script on puppet:
define profiles::build::scp_copy ($sharename = $title, $source, $destination) {
    
    # Add the host key to the server if it doesn't already exist.
    # Without this, scp will fail in batch mode because the host might be spoofed.
    registry_value { "register host key ${sharename}":
         ensure => present,
         path   => "HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\SshHostKeys\\######",         
         type   => string,   
         data   => "#######"         
    }
    
    # Copy the file specified in source to destination.
    exec { "copy build ${sharename}":
         provider => 'powershell',
         command  => "pscp -batch -pw ############## #############@##############:${source} ${destination}"
    }
}


Being utilized like:

profiles::build::scp_copy { "${buildType}.${buildNo} build copy ${zipSaveAbsolutePath}":
        source      => '${buildNo}\\${buildType}.${buildNo}.zip',
        destination => '${zipSaveAbsolutePath}'
    }

I'm sure it's something easy that I'm missing. But I'm quite stuck. Any ideas?

Henrik Lindberg

unread,
May 22, 2016, 9:14:17 PM5/22/16
to puppet...@googlegroups.com
The problem may be outside of these snippets. What the error is telling
you is that the path you are managing is also managed by some other
resource. Thus you may have a problem elsewhere where you now (because
of changes to the language in 4.x from 3.x (unless you ran 3.7 with
future parser)).

That is not much, but I hope it helps.

- henrik

> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/c695e60f-3bc6-4ab9-b197-b517139dc2e9%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/c695e60f-3bc6-4ab9-b197-b517139dc2e9%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/
Reply all
Reply to author
Forward
0 new messages