Dear all
I would like to generate one file on a certain server with the hostname of
all server that have puppet. But the collection of the hosts does not work.
First try with the error duplicate resource
class check_mk::agent::serverlist {
@@file { '/tmp/checkmkhosts':
content => "$::hostname|$::operatingsystem\n",
tag => 'serverlist',
}
}
class check_mk::server::serverlist {
Export_server_list <<| |>>
}
Then I found an idea with a define
class check_mk::agent::serverlist {
@@export_server_list { "$::hostname":
filename => '/tmp/checkmkhosts',
}
}
define check_mk::agent::export_server_list ( filename ) {
ensure_resource ( 'file', $filename, {} )
}
class check_mk::server::serverlist {
check_mk::agent::export_server_list <<| |>>
}
but I get the error Syntax error at '<<|'; expected '|>>' at
.../check_mk/manifests/server/serverlist.pp:2
Can somebody please help me?
Andreas
--
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/c77bb768-8898-49ae-8053-a338782491e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.