Hi Tim, The exec type has some attributes that can control this, such as "onlyif", "unless", and "creates".
Please review the documentation here: https://docs.puppetlabs.com/references/latest/type.html#exec ❧ Brian Mathis @orev On Fri, Mar 6, 2015 at 5:30 PM, Tim Dunphy <bluethu...@gmail.com> wrote: > Hey all, > > I've created a very basic puppet module to install bacula and ensure that > it's running. However one exec statement in my manifest gets applied every > time. > > Here's the manifest: > > class bacula::install { > > if $hostname == "ops" { > > file { "/var/bacula": > ensure => directory, > } > > file {"/backup/tapes": > ensure => directory, > } > > package { ["bacula-client", "bacula-common", "bacula-storage", > "bacula-libs", "bacula-libs-sql", "bacula-director", "bacula-console"] : > ensure => present, > require => [ File["/var/bacula"], File["/backup/tapes"]] > } > > * exec { "update_mysql_alternatives":* > * command => "alternatives --set libbaccats.so > /usr/lib64/libbaccats-mysql.so",* > * path => "/usr/local/bin/:/bin/:/usr/sbin"* > * }* > > } else { > package { ["bacula-client", "bacula-common"] : > ensure => present, > require => [ File["/var/bacula"], File["/backup/tapes"]] > } > } > } > > > Seems pretty straight forward. But how can I get the exec command to run > only once if it hasn't been run previously? > > Thanks! > Tim > > Thanks > > -- > GPG me!! > > gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B > > -- > 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/CAOZy0enBbzZCq5U%2B81fGGXPcNcuGDXcsHqtizDUcavheCaOJVQ%40mail.gmail.com > <https://groups.google.com/d/msgid/puppet-users/CAOZy0enBbzZCq5U%2B81fGGXPcNcuGDXcsHqtizDUcavheCaOJVQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CALKwpExw%3DbsTpYv%3DNVU1Q80zf72%3Dk7EPM%2BK31OCSf0oSu2q3OA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.