Answer the question
In order to leave comments, you need to log in
How to check the uniqueness of your resource parameters in puppet?
Created class lb
And defined resource lb::vhost Looks
like this:
define lb::vhost (
String $domain = $title,
String $project = "",
String $network = "",
String $ensure = present,
String $syslog_nginx_access = "localhost:518"
String $syslog_nginx_error = "localhost:518",
Boolean $syslog = false,
Hash $upstream_servvers = { '127.0.0.1:81' => 1 },
String $custom = "",
) {
if $project == "" or $network == "" {
fail("Require params \$project and \$network")
}
...
...
node 'test_server' {
class { 'lb': }
lb::vhost { 'a.example.com':
project => 'project1',
network => 'network1',
}
lb::vhost { 'b.example.com':
project => 'project1',
network => 'network1',
}
}
if
. if файл существует {
fail("project and network already exists")
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question