Hi,
I would like to conditionally execute some tasks within a play (or even the entire play itself) only if I’m setting up a development environment. What is the best way to perform such conditional execution?
One way I can think of is to define a variable (say “deploy_env=true”) in my dev inventory file (hosts.dev), then use the “when” statement within the conditional tasks to look for that variable (i.e. when: deploy_env == true). Is this a good approach or is there a better way to define and run environment-specific tasks/plays?
Thanks,
Shaunak