[ansible-devel] Re: How to check version of ansible before execution begins

2018-08-29 Thread Jon Zeolla
My callback function attempt in more detail: 1. Write and implement a callback plugin that fails if you are using ansible < 2.4.0 (similar to this

[ansible-devel] Re: How to check version of ansible before execution begins

2018-08-29 Thread Jon Zeolla
Sorry to bring back such an old post, but I'm experiencing the same issue. >From what I can tell, the ansible parser will fail in cases where syntax has changed or new syntax has been introduced (like the move away from include in 2.4.0), causing the logic you provided to never be run. I also

Re: [ansible-devel] Re: How to check version of ansible before execution begins

2017-08-30 Thread Karol Czeryna
HI guys! I’m using that snippet to see if the local ansible is in the allowed range of versions (some time ago ansible has been updated to 2.3 without our knowledge and because of that our prod deployment failed) > tasks: > - name: Check for Ansible version > assert: >

[ansible-devel] Re: How to check version of ansible before execution begins

2017-08-30 Thread N. Bailey
Sure! Well the example playbook I posted will do that, it's just that I feel like the proper solution is to standardise Ansible versions across your different control servers and save yourself from ever hitting this issue again. I realise that's sometimes easier said than done though! :) On

[ansible-devel] Re: How to check version of ansible before execution begins

2017-08-30 Thread Vinod Kumar
Thanks Nikki for your inputs. Apologies if I am unable to explain the problem correctly. Let me put in short words: 1. I am using ansible 2.3.1 version and designed my playbooks (used 'tempfile' resource which starts supporting from this version).They are working as expected in development

[ansible-devel] Re: How to check version of ansible before execution begins

2017-08-30 Thread N. Bailey
Hi Vinod, I don't quite understand your use case - only the Ansible version on the controller that you run the playbook from matters; Ansible runs commands by SSH on the nodes you manage with it, and at that point sends them executable scripts that don't need any Ansible-specific packages