Ask Your Question
0

Removing a service with dependencies

asked 2013-10-14 03:15:27 -0500

Foezjie gravatar image

Hello everyone.

Say I have a resource X provides a service for resource Y. (For example, a database helps a web server) X has no other use in the system expect helping Y. In my manifests, I state that Y requires X.

Now, my question is twofold.

  1. How do you remove a resource in puppet in a clean way? You can do ensure => absent but when you have many resource that you removed over time, your manifests are filled with "ensure => absent"s. If you just remove the resource declaration from your manifest, the resource isn't managed anymore, but ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-10-14 08:50:24 -0500

Ancillas gravatar image

There's not a very clean way to do this, unfortunately. You could probably come up with some complicated logic in your manifests such that if on the last run, Y was removed, then X should be removed as well. This would use PuppetDB to track state, but honestly, it would be way more complicated than its worth.

I've handled this in two ways.

  1. I've created a module that asks as an uninstaller. All is does is do a bunch of ensure => absent calls on packages, but it keeps the logic in your main module cleaner. You can ...

(more)
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-10-14 03:15:27 -0500

Seen: 356 times

Last updated: Oct 14 '13