Re-using a pre_task and post_task using roles?

Let’s say I need to deploy two sets of applications - PHP vs PERL.

I want to be able to re-use the pre_tasks and post_tasks snippet so that i dont have to make changes to multiple scripts if I modify a value for the netscaler module. I guess my question is what’s the point of using “pre_tasks” and “post_tasks” if I can put them inside a role as dependencies?

See below for original script. I would essentially do the same thing for my perl deploys. I would like to throw the “pre_tasks” and “post_tasks” into one file and call them when I need to. What’s the best way to handle that?

You can create additional lb/disable_host and lb/enable_host roles.
You can also try parameterizing the deploy role name and then using playbook-level includes, but I’m not sure if that’ll work

Samnang Sen samnang.sen@gmail.com napisał: