diff options
author | Micah <micah@riseup.net> | 2015-10-09 20:21:58 +0000 |
---|---|---|
committer | Micah <micah@riseup.net> | 2015-10-09 20:21:58 +0000 |
commit | ba81744a42548de60bb4f48c66a7e95cd050ad4a (patch) | |
tree | 664fea7e838b553ba0864b8dc61cc5323251c4c1 /manifests/import_key.pp | |
parent | f661c786095e99087773f01351cebe00837f68a7 (diff) | |
parent | 39631404dc41f706ad665ad2770e9c48b98a98fa (diff) | |
download | puppet-monkeysphere-master.tar.gz puppet-monkeysphere-master.tar.bz2 |
merge the mayfirst, koumbit and sarava changes
the monkeysphere module in shared is very old (2 years 4 months)! since then, sarava and koumbit have done significant work to improve on the module.
mayfirst did changes to allow choosing a keyserver, added flexibility, user configs and so on.
sarava fixed some bugs.
koumbit merged both with the shared modules, did a style cleanup and autoloading, added RAW_AUTHORIZED_KEYS, silence some warnings and randomized cron jobs.
this still fails in puppet 3.x, but is an improvement over what's already present.
See merge request !1
Diffstat (limited to 'manifests/import_key.pp')
-rw-r--r-- | manifests/import_key.pp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/manifests/import_key.pp b/manifests/import_key.pp new file mode 100644 index 0000000..ba965ce --- /dev/null +++ b/manifests/import_key.pp @@ -0,0 +1,20 @@ +define monkeysphere::import_key ( + $scheme = 'ssh://', + $port = '', + $path = '/etc/ssh/ssh_host_rsa_key', + $hostname = $fqdn ) { + + # if we're getting a port number, prefix with a colon so it's valid + $prefixed_port = $port ? { + '' => '', + default => ":$port" + } + + $key = "${scheme}${fqdn}${prefixed_port}" + + exec { "monkeysphere-host import-key $path $key": + alias => "monkeysphere-import-key", + require => [ Package["monkeysphere"], File["monkeysphere_host_conf"] ], + unless => "/usr/sbin/monkeysphere-host s | grep $key > /dev/null" + } +} |