Currently, the td-agent::default recipe is responsible for installing TD agent, and configuring the main config file along with starting and enabling the td-agent service.
Issue
The designated workflow suggests the recipe td-agent::default be included prior to using the custom resources (td_agent_match, etc) to setup the application based on your own requirements.
The problem is that if you incorrectly configure td-agent, Chef is unable to correct the problem due to the default recipe attempting to start the service. This causes failed Chef runs because the custom resources cannot change the offending configurations.
Solution
Split the configuration/service resources in td-agent::default into their own recipe, potentially called td-agent::configure. The default recipe logic will remain the same, and this solution will give more flexibility and reliability to the user on how to use the cookbook with custom resources.
Background
Currently, the
td-agent::default
recipe is responsible for installing TD agent, and configuring the main config file along with starting and enabling thetd-agent
service.Issue
The designated workflow suggests the recipe
td-agent::default
be included prior to using the custom resources (td_agent_match
, etc) to setup the application based on your own requirements.The problem is that if you incorrectly configure
td-agent
, Chef is unable to correct the problem due to thedefault
recipe attempting to start the service. This causes failed Chef runs because the custom resources cannot change the offending configurations.Solution
Split the configuration/service resources in
td-agent::default
into their own recipe, potentially calledtd-agent::configure
. Thedefault
recipe logic will remain the same, and this solution will give more flexibility and reliability to the user on how to use the cookbook with custom resources.