Ask Your Question

What does the '~' in '~>' do?

asked 2013-09-23 15:51:07 -0600

spuder gravatar image

updated 2013-09-24 10:15:36 -0600

Ancillas gravatar image

I came across an example manifest in the puppet certification practice test.

Package[‘mysql-server’] -> File[‘/etc/my.cnf’] ~> Service[‘mysqld’]

Notice how Package has a dash and arrow pointing to File. '->'

However File has a squiggle and arrow pointing to Service. '~>'

I can't find any examples of ~> in the docs.

How is ~> different than -> ?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2013-09-23 16:54:38 -0600

Ancillas gravatar image

updated 2013-09-23 16:55:00 -0600

It establishes a dependency, and a notify relationship. If the resource to the left changes, the resource to the right is notified. It's commonly used with a File on the left, and a Service on the right so that the service restarts when the config file changes so that the app picks up the changes.

edit flag offensive delete link more

answered 2013-09-23 22:33:24 -0600

spuder gravatar image

updated 2013-09-23 22:33:55 -0600

require and before use the -> syntax
notify and subscribe use the ~> syntax

This is covered about 4 minutes into the training video

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-09-23 15:51:07 -0600

Seen: 276 times

Last updated: Sep 24 '13