Skip to content

Commit

Permalink
Merge pull request #250 from tuxmea/remove_user_with_custom_authfile
Browse files Browse the repository at this point in the history
(MODULES-9849) wrong order when removing user with custom sshkey file
  • Loading branch information
florindragos authored Sep 4, 2019
2 parents 1258773 + 6a646e1 commit 8c783e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 6 additions & 3 deletions manifests/key_management.pp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,14 @@
group => $group,
mode => '0700',
}
$sshkey_require = File[$sshkey_dotdir]
}
if $sshkey_custom_path != undef {
$sshkey_require = File[$key_file]
} else {
$sshkey_require = undef
$sshkey_require = File[$sshkey_dotdir]
}
$sshkey_before = File[$key_file]
$sshkey_before = undef

} else {
if $purge_user_home and $user_home {
file { $sshkey_dotdir:
Expand Down
8 changes: 6 additions & 2 deletions spec/acceptance/accounts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,11 @@
},
'accounts::user_list' => {
'hunner' => {
'home' => '/test/hunner',
'sshkeys' => [
'home' => '/test/hunner',
'sshkey_custom_path' => '/test/sshkeys/hunner',
'sshkey_owner' => 'root',
'sshkey_group' => 'root',
'sshkeys' => [
"ssh-rsa #{test_key} vagrant",
"ssh-rsa #{test_key} vagrant2",
],
Expand Down Expand Up @@ -493,6 +496,7 @@
expect(file('/home/specd_user')).not_to exist
expect(file('/home/duplicate_user1')).not_to exist
expect(file('/home/duplicate_user2')).not_to exist
expect(file('/test/sshkeys/hunner')).not_to exist
expect(user('hunner')).not_to exist
expect(user('first.last')).not_to exist
expect(user('grp_flse')).not_to exist
Expand Down

0 comments on commit 8c783e3

Please sign in to comment.