eramm
eramm

Reputation: 241

Chef - triggering one block based on the results of another

I wrote a simple recipe (runs on a RHEL node) that after installing a rpm package it checks if it's running by running the service MyService status command and I capature the results via stdout and RegEx from a ruby block

My question is if that the regex does not match hence the service is not running how can i trigger a block that says

rpm_package 'MyService' do action :remove end

Upvotes: 0

Views: 48

Answers (1)

coderanger
coderanger

Reputation: 54211

The easiest way to do this is by making a custom resource instead of using a ruby_block or recipe-level code.

Upvotes: 1

Related Questions