From 7218eb738f4d4cbcade57cdf72c7cd6c878cd60e Mon Sep 17 00:00:00 2001 From: Antoine Beaupré Date: Wed, 16 Oct 2013 15:06:00 -0400 Subject: split into separate file according to autoloading rules --- manifests/import_key.pp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 manifests/import_key.pp (limited to 'manifests/import_key.pp') diff --git a/manifests/import_key.pp b/manifests/import_key.pp new file mode 100644 index 0000000..ec00fee --- /dev/null +++ b/manifests/import_key.pp @@ -0,0 +1,16 @@ +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" + } +} -- cgit v1.2.3