-define monkeysphere::import_key ( $scheme = 'ssh://', $port = '', $path = '/etc/ssh/ssh_host_rsa_key', $hostname = $fqdn ) {
+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 ? {
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"
+ require => [ Package["monkeysphere"], File["monkeysphere_host_conf"] ],
+ unless => "/usr/sbin/monkeysphere-host s | grep $key > /dev/null"
}
}
$keyserver = 'pool.sks-keyservers.net'
) {
# The needed packages
- package{'monkeysphere':
+ package { 'monkeysphere':
ensure => $ensure_version,
}
$key = "ssh://${::fqdn}${port}"
common::module_dir { [ 'monkeysphere', 'monkeysphere/hosts', 'monkeysphere/plugins' ]: }
- # This was the old way which the module checked monkeysphere keys
- file { "/usr/local/sbin/monkeysphere-check-key":
- ensure => absent,
- owner => root,
- group => root,
- mode => 0755,
- content => "#!/bin/bash\n/usr/bin/gpg --homedir /var/lib/monkeysphere/host --list-keys '=$key' &> /dev/null || false",
- }
- file { "monkeysphere_conf":
- path => "/etc/monkeysphere/monkeysphere.conf",
- mode => 644,
- ensure => present,
- content => template("monkeysphere/monkeysphere.conf.erb"),
- require => Package['monkeysphere'],
- }
- file { "monkeysphere_host_conf":
- path => "/etc/monkeysphere/monkeysphere-host.conf",
- mode => 644,
- ensure => present,
- content => template("monkeysphere/monkeysphere-host.conf.erb"),
- require => Package['monkeysphere'],
- }
- file { "monkeysphere_authentication_conf":
- path => "/etc/monkeysphere/monkeysphere-authentication.conf",
- mode => 644,
- ensure => present,
- content => template("monkeysphere/monkeysphere-authentication.conf.erb"),
- require => Package['monkeysphere'],
+ file {
+ # This was the old way which the module checked monkeysphere keys
+ '/usr/local/sbin/monkeysphere-check-key':
+ ensure => absent,
+ owner => root,
+ group => root,
+ mode => 0755,
+ content => "#!/bin/bash\n/usr/bin/gpg --homedir /var/lib/monkeysphere/host --list-keys '=$key' &> /dev/null || false";
+ 'monkeysphere_conf':
+ path => '/etc/monkeysphere/monkeysphere.conf',
+ mode => 644,
+ ensure => present,
+ content => template('monkeysphere/monkeysphere.conf.erb'),
+ require => Package['monkeysphere'];
+ 'monkeysphere_host_conf':
+ path => '/etc/monkeysphere/monkeysphere-host.conf',
+ mode => 644,
+ ensure => present,
+ content => template('monkeysphere/monkeysphere-host.conf.erb'),
+ require => Package['monkeysphere'];
+ 'monkeysphere_authentication_conf':
+ path => '/etc/monkeysphere/monkeysphere-authentication.conf',
+ mode => 644,
+ ensure => present,
+ content => template('monkeysphere/monkeysphere-authentication.conf.erb'),
+ require => Package['monkeysphere'];
}
}