Closed jakevis closed 4 years ago
TASK [nusenu.relayor : Use a single private IPv4 address if we have no public IPv4 address] *** fatal: [tor1.eo]: FAILED! => {"msg": "The conditional check 'tor_v4ips == []' failed. The error was: An unhandled exception occurred while templating '{{ tor_available_public_ipv4s[0:tor_maxPublicIPs] }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: Unexpected templating type error occurred on ({{ tor_available_public_ipv4s[0:tor_maxPublicIPs] }}): 'bool' object has no attribute 'getitem'\n\nThe error appears to be in '/home/jake/.ansible/roles/nusenu.relayor/tasks/ip-list.yml': line 3, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Use a single private IPv4 address if we have no public IPv4 address\n ^ here\n"}
A similar config works against ubuntu fine, so I assume its an issue specific to *BSD
What python version does HBSD have vs. Ubuntu?
Version information (please include the following information):
- ansible version ansible 2.9.15
- ansible-relayor version (please try to reproduce the bug against the git master branch) nusenu.relayor (v20.1.0)
I suspect this is related to
https://github.com/ansible/ansible/issues/14829 https://github.com/ansible-collections/ansible.netcommon/issues/136
Does your ansible/netcommon version contain the fix? Can you reproduce the issue with ansible 2.9.13?
Hi @nusenu HBSD is running Python 3.7.9 Ubuntu is running Python 3.8.5
I have v1.4.1 of netcommon installed as well (installed from galaxy - but no idea how it should be integrated/used).
I never noticed an issue with 2.9.13; but I also cant get back to it either to verify (its not in the PPA anymore). jumping forward to ansible 2.10.3 results in a slightly different set of warnings - same gist:
TASK [nusenu.relayor : Use a single private IPv4 address if we have no public IPv4 address] ***********************************************************************************
[WARNING]: packaging Python module unavailable; unable to validate collection Ansible version requirements
fatal: [tor1.eo]: FAILED! => {"msg": "The conditional check 'tor_v4ips == []' failed. The error was: An unhandled exception occurred while templating '{{ tor_available_public_ipv4s[0:tor_maxPublicIPs] }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ ansible_all_ipv4_addresses| ipv4('address') | ipv4('public') }}'. Error was a <class 'ansible.errors.AnsibleFilterError'>, original message: The ipv4 filter requires python's netaddr be installed on the ansible controller\n\nThe error appears to be in '/home/jake/.ansible/roles/nusenu.relayor/tasks/ip-list.yml': line 3, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Use a single private IPv4 address if we have no public IPv4 address\n ^ here\n"}
So a little bit more testing overnight - I was wrong about it still working on Ubuntu, I dont know what I was seeing... but yes, its failing there as well.
I rolled all the way back to https://github.com/ansible/ansible/archive/v2.9.12.tar.gz using pip install methods and its still broken there unfortunately as well. Ill revert the version of ansible and relayor now and see what it does..
Now at: 2.9.1 nusenu.relayor, v19.1.7
And still getting the same set of errors.. so I guess this is outside of the realm of ansible (since I know we had it working here). Ill start walking python back here now...
ansible-playbook 2.9.15 python version = 2.7.17 (default, Sep 30 2020, 13:38:04) [GCC 7.5.0] nusenu.relayor, v20.1.0
This combo works - so I am unblocked ;) Happy for this to be closed - or I can pull other logs et al if it would help ID what the issue was when using python 3.7/3.8
Jake Vis:
ansible-playbook 2.9.15 python version = 2.7.17 (default, Sep 30 2020, 13:38:04) [GCC 7.5.0]
are you referring to the python version on the control machine or the relay?
Thanks, for your help debugging this.
original message: The ipv4 filter requires python's netaddr be installed on the ansible controller
looks like you are missing one of the requirements: python netaddr
Since I was unable to reproduce your issue I assume the following happened:
If you can confirm that assumption, we can close this issue.
Since I was unable to reproduce your issue I assume the following happened:
- You used to have python 2.x on your control machine with netaddr installed.
- you upgraded to python 3.x (which didn't have netaddr installed)
- the missing netaddr package caused the error
If you can confirm that assumption, we can close this issue.
Yeah let me close this out; now we are up and working again ill spend some time and upgrade + test in a more controlled manor. I know I stuffed up there in the first rebuild and didnt install netaddr; when I did, it started working on ubuntu with python 3.x (3.x on both the control machine, and tor node), but it didnt work for the HBSD boxes (also on 3.x). Dropping everything back to 2.X fixed everything... but its obviously not where we want to be.
Thanks again for your help and your tools @nusenu .
Describe the bug On a resent update we have started to see failures when running relayor against our HBSD hosts:
The config of the yaml file is:
A similar config works against ubuntu fine, so I assume its an issue specific to *BSD
To Reproduce ansible-playbook tor1.yaml
Version information (please include the following information):
Playbook information See above
OS information FreeBSD 12.1-STABLE-HBSD (HARDENEDBSD)
Debug information Please add the output of your
ansible-playbook
run using "-vvv".