NameError: global name 'fw offline' is not defined

56 views
Skip to first unread message

Keith Nowosielski

unread,
Jul 8, 2020, 7:15:54 PM7/8/20
to Ansible Project
I'm working on Ubuntu 18.04.4 LTS using ansible 2.5.1. 

I'm trying to get this project 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 <module>
    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 <module>\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

Dick Visser

unread,
Jul 9, 2020, 12:03:16 AM7/9/20
to ansible...@googlegroups.com
On Thu, 9 Jul 2020 at 01:16, Keith Nowosielski <keith.no...@sjsu.edu> wrote:
I'm working on Ubuntu 18.04.4 LTS using ansible 2.5.1. 

I'm trying to get this project to work as its exactly what I'm trying to do. 

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


--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

Abhijeet Kasurde

unread,
Jul 9, 2020, 1:10:26 AM7/9/20
to ansible...@googlegroups.com
I think this issue is already fixed in Ansible https://github.com/ansible/ansible/issues/38161. Please update.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL8fbwNezRk9wfzq_yHfvg6r6UJ4TniD%3DwfE-1SK%3DxEtUwpByg%40mail.gmail.com.


--
Thanks,
Abhijeet Kasurde

Keith Nowosielski

unread,
Jul 9, 2020, 12:15:10 PM7/9/20
to ansible...@googlegroups.com
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. 

Keith



--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/LVrAJnyg46Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.

Keith Nowosielski

unread,
Jul 9, 2020, 12:26:34 PM7/9/20
to ansible...@googlegroups.com
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? 

Keith 



You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/LVrAJnyg46Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAFwWkHpT1bZbNOZx48wb-vUuMkHXbsEoA4tu6Eqyh7hic3Cdrw%40mail.gmail.com.

flowerysong

unread,
Jul 9, 2020, 1:15:36 PM7/9/20
to Ansible Project
On Thursday, July 9, 2020 at 12:26:34 PM UTC-4 keith.no...@sjsu.edu wrote:
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.

Keith Nowosielski

unread,
Jul 9, 2020, 2:29:04 PM7/9/20
to ansible...@googlegroups.com
Sorry, that's what I came up with on a quick google search. Also this is a fresh install.. ugh 

Keith 



--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/LVrAJnyg46Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.

Keith Nowosielski

unread,
Jul 9, 2020, 3:13:07 PM7/9/20
to ansible...@googlegroups.com
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!

Keith 


Reply all
Reply to author
Forward
0 new messages