Skip to content

Commit

Permalink
Don't create absent ssh_authorized_key resources if purge_ssh_keys is…
Browse files Browse the repository at this point in the history
… enabled
  • Loading branch information
mcanevet committed Oct 19, 2015
1 parent 2c4a61b commit 53228fb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions manifests/account.pp
Expand Up @@ -133,12 +133,14 @@
}
}

$keys_to_remove = suffix(keys(absents($::accounts::ssh_keys)), "-on-${name}")
accounts::authorized_key { $keys_to_remove:
ensure => absent,
account => $name,
target => $authorized_keys_target,
ssh_authorized_key_title => $ssh_authorized_key_title,
if ! $purge_ssh_keys {
$keys_to_remove = suffix(keys(absents($::accounts::ssh_keys)), "-on-${name}")
accounts::authorized_key { $keys_to_remove:
ensure => absent,
account => $name,
target => $authorized_keys_target,
ssh_authorized_key_title => $ssh_authorized_key_title,
}
}
}
}

0 comments on commit 53228fb

Please sign in to comment.