Created
May 3, 2017 09:23
-
-
Save jacoelho/fdf31f86a822bc0b55edc594b25d8539 to your computer and use it in GitHub Desktop.
chef voodoo resources
This file contains hidden or 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
| %w(nginx php-fpm).each do |name| | |
| begin | |
| r = find_resource!(:service, name) | |
| r.subscribes(:restart, [ | |
| "file[/etc/newrelic/newrelic.cfg]", | |
| "file[/etc/php.d/newrelic.ini]"] | |
| ) | |
| rescue Chef::Exceptions::ResourceNotFound | |
| Chef::Log.error("newrelic_apm service #{name} not found, skipping restart") | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment