Skip to content

Instantly share code, notes, and snippets.

@GeoffWilliams
Last active January 16, 2018 03:13
Show Gist options
  • Select an option

  • Save GeoffWilliams/ba1bdf25b455ea93a596be775ef1cfd5 to your computer and use it in GitHub Desktop.

Select an option

Save GeoffWilliams/ba1bdf25b455ea93a596be775ef1cfd5 to your computer and use it in GitHub Desktop.
Puppet exec based "host if statement": Sometimes you want to run an action based on whether a command executes or not. Thats a 'fact' right? - but facts only execute every puppet run so if you want to do something like check that a port is open somewhere you would have to wait 30 minutes after configuring a fact with the destination before you c…
exec { "/bin/true":
before => Exec['tada'],
}
exec { "tada":
command => "/bin/touch /tada",
}
~> exec { "next":
refreshonly => true,
command => "/bin/touch /boom",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment