Created
December 4, 2015 15:36
-
-
Save tizzo/08f66ecf9b33ebbeea12 to your computer and use it in GitHub Desktop.
Puppet -> and ~> syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file { '/some/path': | |
ensure => 'file', | |
}-> | |
service { 'some-service': | |
ensure => 'running', | |
enable => true, | |
} | |
# This is equivalent to; | |
file { '/some/path': | |
ensure => 'file', | |
} | |
service { 'some-service': | |
ensure => 'running', | |
enable => true, | |
requires => File['/some/path'], | |
} | |
# And this | |
file { '/some/path': | |
ensure => 'file', | |
}~> | |
service { 'some-service': | |
ensure => 'running', | |
enable => true, | |
} | |
# Is equivalent to: | |
file { '/some/path': | |
ensure => 'file', | |
# Note, notify is also sets up an implicit require on service of this file. | |
# And when this file changes the service will get restarted. | |
notify => Service['some-service'], | |
} | |
service { 'some-service': | |
ensure => 'running', | |
enable => true, | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment