Hi
My code looks like that:
# == Class: lpsc::config
class lpsc::config inherits lpsc {
define lpsc::builder (
String $ssh_file,
String $ssh_key,
$ensure => present,
) {
file_line { "${ssh_key}":
line => "${ssh_key}",
path => "${ssh_file}",
ensure => $ensure,
}
}
file { '/etc/ssh/sshd_config':
ensure => present,
owner => 'root',
group => 'root',
mode => '0600',
}
if ($lpsc::ssh_keys == undef)
{
notify{"Pas de clef à rajouter":}
}
else
{
notify{"On peut rajouter une clef ${lpsc::ssh_keys}":}
$demofiles = "/root/.ssh/test"
# file {$demofiles:
# ensure => present,
# replace => 'no',
# owner => 'root',
# group => 'root',
# mode => '0600',
# content => $lpsc::ssh_keys[0],
#}
$lpsc::ssh_keys.each |$key|{
lpsc::builder{"$key":
ensure => 'present',
ssh_file => $demofiles,
ssh_key => "$key",
}
}
}
But i have a synthax error near the define functions. I can't understand
how can i do that i want.
Thx again for your answer
Quentin Lenglet
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/08c137b2-4431-44f2-bdab-9aeb541e4c8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.