# NameError: global name 'fw offline' is not defined

**URL:** <https://forum.ansible.com/t/nameerror-global-name-fw-offline-is-not-defined/33352>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [July 8, 2020, 11:15pm UTC](https://forum.ansible.com/t/nameerror-global-name-fw-offline-is-not-defined/33352 "2020-07-08T23:15:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![knowosielski-SJSU](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@knowosielski-SJSU](https://forum.ansible.com/u/knowosielski-SJSU)\
**Post date:** [July 8, 2020, 11:15pm UTC](https://forum.ansible.com/t/nameerror-global-name-fw-offline-is-not-defined/33352/1 "2020-07-08T23:15:54Z")

</div>

I’m working on Ubuntu 18.04.4 LTS using ansible 2.5.1.

I’m trying to get [this project](https://redhatnordicssa.github.io/ansible-podman-containers-2)to work as its exactly what I’m trying to do.

I’ve stumbled through and did some troubleshooting and I managed to get the pod created and the instances to run, however it’s still not functional. I’m getting an error when running the test.yml (plane Jane no changes) when it reaches the task [podman\_container\_systemd : ensure container’s exposed ports firewall state]

This is the traceback:

TASK [podman\_container\_systemd : ensure container’s exposed ports firewall state] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /etc/ansible/roles/podman\_container\_systemd/tasks/main.yml:185  
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/system/firewalld.py  
\<127.0.0.1\> ESTABLISH LOCAL CONNECTION FOR USER: root  
\<127.0.0.1\> EXEC /bin/sh -c ‘echo ~ && sleep 0’  
\<127.0.0.1\> EXEC /bin/sh -c ‘( umask 77 && mkdir -p “`echo /home/keith/.ansible/tmp/ansible-tmp-1594249242.13-25587175827255`” && echo ansible-tmp-1594249242.13-25587175827255=“`echo /home/keith/.ansible/tmp/ansible-tmp-1594249242.13-25587175827255`” ) && sleep 0’  
\<127.0.0.1\> PUT /home/keith/.ansible/tmp/ansible-local-15286mEGZvX/tmpgPhc5F TO /home/keith/.ansible/tmp/ansible-tmp-1594249242.13-25587175827255/firewalld.py  
\<127.0.0.1\> EXEC /bin/sh -c ‘chmod u+x /home/keith/.ansible/tmp/ansible-tmp-1594249242.13-25587175827255/ /home/keith/.ansible/tmp/ansible-tmp-1594249242.13-25587175827255/firewalld.py && sleep 0’  
\<127.0.0.1\> EXEC /bin/sh -c ‘/usr/bin/python /home/keith/.ansible/tmp/ansible-tmp-1594249242.13-25587175827255/firewalld.py && sleep 0’  
\<127.0.0.1\> EXEC /bin/sh -c ‘rm -f -r /home/keith/.ansible/tmp/ansible-tmp-1594249242.13-25587175827255/ \> /dev/null 2\>&1 && sleep 0’  
The full traceback is:  
Traceback (most recent call last):  
File “/tmp/ansible\_XfqmOo/ansible\_module\_firewalld.py”, line 1017, in   
main()  
File “/tmp/ansible\_XfqmOo/ansible\_module\_firewalld.py”, line 811, in main  
if fw\_offline:  
NameError: global name ‘fw\_offline’ is not defined

failed: [127.0.0.1] (item=80/tcp) =\> {  
“changed”: false,  
“item”: “80/tcp”,  
“module\_stderr”: “Traceback (most recent call last):\n File "/tmp/ansible\_XfqmOo/ansible\_module\_firewalld.py", line 1017, in \n main()\n File "/tmp/ansible\_XfqmOo/ansible\_module\_firewalld.py", line 811, in main\n if fw\_offline:\nNameError: global name ‘fw\_offline’ is not defined\n”,  
“module\_stdout”: “”,  
“msg”: “MODULE FAILURE”,  
“rc”: 1  
}  
to retry, use: --limit @/etc/ansible/roles/awx\_pod/tests/test.retry

Thanks in advanced for any assistance!  
Keith

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [July 9, 2020, 4:02am UTC](https://forum.ansible.com/t/nameerror-global-name-fw-offline-is-not-defined/33352/2 "2020-07-09T04:02:50Z")

</div>

That would be the first place to reach out for support.

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [July 9, 2020, 5:09am UTC](https://forum.ansible.com/t/nameerror-global-name-fw-offline-is-not-defined/33352/3 "2020-07-09T05:09:53Z")

</div>

I think this issue is already fixed in Ansible [https://github.com/ansible/ansible/issues/38161](https://github.com/ansible/ansible/issues/38161). Please update.

---

<div class="post-metadata">

**Author:** ![knowosielski-SJSU](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@knowosielski-SJSU](https://forum.ansible.com/u/knowosielski-SJSU)\
**Post date:** [July 9, 2020, 4:14pm UTC](https://forum.ansible.com/t/nameerror-global-name-fw-offline-is-not-defined/33352/4 "2020-07-09T16:14:12Z")

</div>

I did actually. I’ve been troubleshooting for a week now, and I’ve made some progress, however this seems to be a bug with Ansible.

---

<div class="post-metadata">

**Author:** ![knowosielski-SJSU](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@knowosielski-SJSU](https://forum.ansible.com/u/knowosielski-SJSU)\
**Post date:** [July 9, 2020, 4:25pm UTC](https://forum.ansible.com/t/nameerror-global-name-fw-offline-is-not-defined/33352/5 "2020-07-09T16:25:37Z")

</div>

I saw this, however this issue was posed and fixed back in 2018. I’m using a current version of Ansible. I can dig into the python script however from the comments I’m not clear on what would need to be done?

---

<div class="post-metadata">

**Author:** ![flowerysong1](https://avatars.discourse-cdn.com/v4/letter/f/ecae2f/32.png) [@flowerysong1](https://forum.ansible.com/u/flowerysong1)\
**Post date:** [July 9, 2020, 5:15pm UTC](https://forum.ansible.com/t/nameerror-global-name-fw-offline-is-not-defined/33352/6 "2020-07-09T17:15:36Z")

</div>

> I saw this, however this issue was posed and fixed back in 2018. I’m using a current version of Ansible. I can dig into the python script however from the comments I’m not clear on what would need to be done?

You said you were using Ansible 2.5.1, which is far from current. (It is, in fact, from 2018.) You should upgrade to a supported version of Ansible, preferably 2.9.x.

---

<div class="post-metadata">

**Author:** ![knowosielski-SJSU](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@knowosielski-SJSU](https://forum.ansible.com/u/knowosielski-SJSU)\
**Post date:** [July 9, 2020, 6:28pm UTC](https://forum.ansible.com/t/nameerror-global-name-fw-offline-is-not-defined/33352/7 "2020-07-09T18:28:08Z")

</div>

Sorry, that’s what I came up with on a quick google search. Also this is a fresh install… ugh

---

<div class="post-metadata">

**Author:** ![knowosielski-SJSU](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@knowosielski-SJSU](https://forum.ansible.com/u/knowosielski-SJSU)\
**Post date:** [July 9, 2020, 7:12pm UTC](https://forum.ansible.com/t/nameerror-global-name-fw-offline-is-not-defined/33352/8 "2020-07-09T19:12:06Z")

</div>

Updated to 2.9.10 (more trouble than it should have been). Then updating states that were deprecated “installed\>present”, It now seems to be working!

Thanks Everyone, and sorry I’m such a newbie at this!
