On Tue, Jan 21, 2020 at 11:54 AM Gabriel Filion <gabs...@lelutin.ca> wrote:
> 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. > Exactly. Instead of saying "if this is a mysql server, then start mysql" you are authoritative and say with confidence "This is a mysql server". This means that Puppet should 1) install the packages 2) write configuration files 3) enable the service And the benefit of that is you have _all of those_ or you have _none of those_. Aka, a consistent state that you can trust. -- 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 puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACkW_L4t8z8xE%2BiBBv2qd1QcZp5ELQ%3DX0Dw%3Djp-YuGuu_7ik1Q%40mail.gmail.com.