Skip to content

Commit

Permalink
Sshkey: make hash_hostname default to :false
Browse files Browse the repository at this point in the history
  • Loading branch information
raphink committed May 21, 2015
1 parent b4104b4 commit 11601b0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/puppet/provider/sshkey/augeas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Puppet::Type::Sshkey
"The provider supports hashed hostnames."

newparam(:hash_hostname, :boolean => true, :required_features => :hashed_hostnames) do
defaultto :true
defaultto :false
end
end

Expand Down
26 changes: 14 additions & 12 deletions spec/unit/puppet/provider/sshkey/augeas_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@

it "should create simple new hashed entry" do
apply!(Puppet::Type.type(:sshkey).new(
:name => "foo.example.com",
:type => "ssh-rsa",
:key => "DEADMEAT",
:target => target,
:provider => "augeas"
:name => "foo.example.com",
:type => "ssh-rsa",
:key => "DEADMEAT",
:hash_hostname => :true,
:target => target,
:provider => "augeas"
))

aug_open(target, "Known_Hosts.lns") do |aug|
Expand All @@ -28,12 +29,13 @@

it "should create simple new hashed entry with aliases" do
apply!(Puppet::Type.type(:sshkey).new(
:name => "foo.example.com",
:type => "ssh-rsa",
:key => "DEADMEAT",
:host_aliases => [ 'foo', 'bar' ],
:target => target,
:provider => "augeas"
:name => "foo.example.com",
:type => "ssh-rsa",
:key => "DEADMEAT",
:hash_hostname => :true,
:host_aliases => [ 'foo', 'bar' ],
:target => target,
:provider => "augeas"
))

aug_open(target, "Known_Hosts.lns") do |aug|
Expand Down Expand Up @@ -70,7 +72,7 @@
:type => "ssh-rsa",
:key => "DEADMEAT",
:host_aliases => [ 'foo', 'bar' ],
:hash_hostname => false,
:hash_hostname => :false,
:target => target,
:provider => "augeas"
))
Expand Down

0 comments on commit 11601b0

Please sign in to comment.