# global name 'ANSIBLE\_VERSION' is not defined

**URL:** <https://forum.ansible.com/t/global-name-ansible-version-is-not-defined/21620>\
**Category:** Ansible Project\
**Created:** [May 31, 2016, 10:04pm UTC](https://forum.ansible.com/t/global-name-ansible-version-is-not-defined/21620 "2016-05-31T22:04:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolas\_Rusconi](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@Nicolas\_Rusconi](https://forum.ansible.com/u/Nicolas_Rusconi)\
**Post date:** [May 31, 2016, 10:04pm UTC](https://forum.ansible.com/t/global-name-ansible-version-is-not-defined/21620/1 "2016-05-31T22:04:23Z")

</div>

I am getting this error when running ansible 2.1.0.0

An exception occurred during task execution. The full traceback is:

Traceback (most recent call last):

File “/var/folders/c7/wbkyhcfj69dcsvp3464g0knh0000gn/T/ansible\_psAqud/ansible\_module\_blockinfile.py”, line 290, in

main()

File “/var/folders/c7/wbkyhcfj69dcsvp3464g0knh0000gn/T/ansible\_psAqud/ansible\_module\_blockinfile.py”, line 226, in main

if ANSIBLE\_VERSION.startswith(‘1.’):

NameError: global name ‘ANSIBLE\_VERSION’ is not defined

maybe this issue is happening again?

[https://github.com/ansible/ansible/issues/11545](https://github.com/ansible/ansible/issues/11545)

any recomendations on how to fix it?

Thanks!

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 1, 2016, 1:27pm UTC](https://forum.ansible.com/t/global-name-ansible-version-is-not-defined/21620/2 "2016-06-01T13:27:19Z")

</div>

ANSIBLE\_VERSION was removed in 2.1 and all modules that depended on it were fixed in devel, but it seems blockinfile in 2.1 still uses it.

I’ve pushed a fix to stable-2.1 and it should be out in a possible 2.1.1 or eventually in 2.2
