On 2020-01-20 2:34 a.m., Joaquin Veira wrote:
> I understand what you mean but I guess there must be any way to check if I
> file exists on the client and act in consecuence.
>
> I mean, if I want to identify a MySQL server by the existance of
> /etc/my.cnf and execute a systemctl enable mysql && systemctl start mysql
> that should work, right?
I guess you could write a boolean custom fact that is true if the file
exists and false otherwise.
but I guess what Ben was trying to expose was that this makes the logic
somewhat reversed for what ppl usually do with puppet.
with puppet you usually want to dictate what a machine should have, e.g.
your logic would read somewhat like "This host is a mysql server".
If you have some manifest that configures something if a certain file
exists it means that puppet is not authoritative about what a server is
but is merely reacting to what sysadmins do directly on the machine. It
also means that if someone installs mysql by mistake or somehow gets an
/etc/my.cnf file created, then your manifests might wrongly install some
things as though this machine was supposed to be a production mysql
server, but without a clear decision about this in your infrastructure code.
> El sábado, 18 de enero de 2020, 1:12:57 (UTC+1), Ben Ford escribió:
>>
>> But when I execute this from a server-client infrastructure it seems like
>>> the conditionals don't work They are not even processed:
>>
>>
>> Oh, they're processed just the same. But the key part that you've missed
>> is that the catalog is compiled on the *master*. That's where all
>>> email to
puppet...@googlegroups.com <javascript:>.
>>> <
https://groups.google.com/d/msgid/puppet-users/a13df78f-e816-47e8-92d7-3cc46c316276%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>