Fix lint errors
Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
parent
1f0c4c4ac7
commit
dd2f7c5ba2
@ -21,12 +21,14 @@ class authorized_keys ($keys, $account='root', $home = '') {
|
|||||||
# If $home is empty, the default is used.
|
# If $home is empty, the default is used.
|
||||||
$rhome = $account ? {'root' => '/root', default => $home}
|
$rhome = $account ? {'root' => '/root', default => $home}
|
||||||
$homedir = $rhome ? {'' => "/home/${account}", default => $rhome}
|
$homedir = $rhome ? {'' => "/home/${account}", default => $rhome}
|
||||||
|
|
||||||
file { "${homedir}/.ssh":
|
file { "${homedir}/.ssh":
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
owner => $ensure ? {'present' => $account, default => undef },
|
owner => $ensure ? {'present' => $account, default => undef },
|
||||||
group => $ensure ? {'present' => $account, default => undef },
|
group => $ensure ? {'present' => $account, default => undef },
|
||||||
mode => '0755',
|
mode => '0755',
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${homedir}/.ssh/authorized_keys":
|
file { "${homedir}/.ssh/authorized_keys":
|
||||||
owner => $ensure ? {'present' => $account, default => undef },
|
owner => $ensure ? {'present' => $account, default => undef },
|
||||||
group => $ensure ? {'present' => $account, default => undef },
|
group => $ensure ? {'present' => $account, default => undef },
|
||||||
@ -41,5 +43,6 @@ class authorized_keys ($keys, $account='root', $home = '') {
|
|||||||
require => File["${homedir}/.ssh/authorized_keys"],
|
require => File["${homedir}/.ssh/authorized_keys"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addkey{$keys:;}
|
addkey{$keys:;}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user