Ask Your Question
0

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

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

spuder gravatar image

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

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
2

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

Ancillas gravatar image

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

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
1

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

spuder gravatar image

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

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

This is covered about 4 minutes into the training video

https://puppetlabs.com/learn/relationships

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

Stats

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

Seen: 255 times

Last updated: Sep 24 '13