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

odd behavior of module 2.5.0 #20

Open
vchepkov opened this issue Aug 20, 2015 · 1 comment
Open

odd behavior of module 2.5.0 #20

vchepkov opened this issue Aug 20, 2015 · 1 comment

Comments

@vchepkov
Copy link

After upgrading to module 2.5.0 we experience an odd behavior of the sshkey resource.

Here is the code we use:

  unless empty($::sshdsakey) {
    @@sshkey { "${::certname}_dsa":
      host_aliases => [$::fqdn, $::hostname],
      type         => dsa,
      key          => $::sshdsakey,
      tag          => "sshkey_${::environment}"
    }
  }
  unless empty($::sshrsakey) {
    @@sshkey { "${::certname}_rsa":
      host_aliases => [$::fqdn, $::hostname],
      type         => rsa,
      key          => $::sshrsakey,
      tag          => "sshkey_${::environment}"
    }
  }
  resources { 'sshkey':
    purge    => true,
  }
Sshkey <<| tag == "sshkey_${::environment}" |>> -> File['/etc/ssh/ssh_known_hosts']

Each run now the catalog is 'changed':

... type changed 'ssh-dss AND ssh-rsa' to 'ssh-dss'
... key changed ...

I have tried to use ensure => hashed , but results were pretty much the same
Please advice.
Thanks

@raphink
Copy link
Member

raphink commented Sep 1, 2015

Since 2.5.0, the type is able to manage hashed entries. When using hashed entries, aliases are not kept on the same line as the main entry, but instead kept appart. When this happens, we still need to manage the type of the host_alias key (which is a property), but it can only be made to converge to a single value (in your case, either "ssh-rsa" OR "ssh-dss").

I think you might be able to fix this by not using host_aliases and creating a resource for each host alias instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants