jlafon / ansible-profile

An Ansible plugin for timing tasks
http://jlafon.io/ansible-profiling.html
MIT License
342 stars 57 forks source link

Run profiling only when ANSIBLE_PROFILE_RUN=1 #5

Closed xen0l closed 9 years ago

xen0l commented 9 years ago

Would it be possible to run this module only when environmental variable, e.g ANSIBLE_PROFILE_RUN is set? It would help in the situation when I have the module in my repository and I could turn it on/off as needed. At the moment, it is running every time I run some playbook.

udondan commented 9 years ago

I think it's a good idea, but I would invert the behavior. Run it when ANSIBLE_PROFILE_RUN is not set or set with true. Omit if false.