оператор выбора со сбоями $servername

Это могло бы быть глупой альтернативой, поэтому отклонить, если это не то, что Вы ищете, но как насчет logwatch? Именно это мы используем, и это работает хорошо.

0
задан 12 September 2013 в 23:47
1 ответ

First, where is $servername being set? That's not a standard fact, so for it to have content you'd need to have either a custom fact or manifest variable. Do you want to be using $clientcert or $fqdn instead?

On your file resource.. I would think that should be erroring out, but maybe not, since /etc/ exists.. the problem there is that the resource as declared is trying to manage /etc/ instead of /etc/my.cnf. Either declare the full path to the file in the resource name and omit the path parameter:

file { '/etc/my.cnf':

Or, have the path parameter be the full path to the file (then the name is irrelevant):

file { 'MySQL Config':
    path    => '/etc/my.cnf',

But.. I'd really recommend against having the logic of "which config file does this server get" hardcoded in your manifest. Use Hiera or node definitions with parameterized classes instead.

2
ответ дан 4 December 2019 в 14:07

Теги

Похожие вопросы