[openstack-ansible] bootstap-aio.sh is failing with error :jinja2.exceptions.TemplateRuntimeError: No filter named 'ipaddr' found
Jonathan Rosser
jonathan.rosser at rd.bbc.co.uk
Tue Mar 8 09:11:49 UTC 2022
Hi Andrew,
Unfortunately it seems that the splitting out of ansible components into
collections opens us up to another set of external moving parts which
can break the deployment. Although we specify the precise version of
ansible and highest level collections (see
ansible-collection-requirements.yml) that we use on each branch of
openstack-ansible - this has not covered second-level dependencies such
as the one we encounter here.
There are already patches to fix this on all of our branches
https://review.opendev.org/q/topic:ipaddr_filter
You can run the latest stable branch code today including that fix by
checking out the stable/xena branch rather than the most recent tag.
If you are still stuck please join the #openstack-ansible IRC channel
where there should be some real time help available.
Jonathan.
On 07/03/2022 14:53, west, andrew wrote:
>
> Am trying to install openstack-ansible AIO (24.0.0.0rc1) on a recent
> ubuntu focal (20.04) cloud image VM
>
> kernel 5.4.0-99-generic
>
> ansible core 2.12.2
>
> jinja 3.0.3
>
> python 3.8.10
>
> the bootstap-aio.sh script is failing with error
>
> jinja2.exceptions.TemplateRuntimeError: No filter named 'ipaddr' found
>
> (I see the ipaddr filter moved (big changes separating modules >
> ansible2.10 I think) to the ansible.netcommon collection
>
> So following google:
>
> /ansible galaxy collection install ansible.netcommon /
>
> Also needs
>
> /pip install netaddr/
>
> //
>
> //
>
> However this still doesn’t solve it, add traceback to playbook:
>
> Seems some of core ansible_collections plugins need updating ?
> (sorry, I’m fairly new to ansible)
>
> <localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'
>
> <localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo
> /root/.ansible/tmp `"&& mkdir "` echo
> /root/.ansible/tmp/ansible-tmp-1646414479.2525613-38683-223155148734113
> `" && echo ansible-tmp-1646414479.2525613-38683-223155148734113="`
> echo
> /root/.ansible/tmp/ansible-tmp-1646414479.2525613-38683-223155148734113
> `" ) && sleep 0'
>
> redirecting filter ansible.builtin.ipaddr to ansible.netcommon.ipaddr
>
> redirecting filter ansible.builtin.ipaddr to ansible.netcommon.ipaddr
>
> redirecting filter ansible.builtin.ipaddr to ansible.netcommon.ipaddr
>
> <localhost> EXEC /bin/sh -c 'rm -f -r
> /root/.ansible/tmp/ansible-tmp-1646414479.2525613-38683-223155148734113/
> > /dev/null 2>&1 && sleep 0'
>
> The full traceback is:
>
> Traceback (most recent call last):
>
> File
> "/opt/ansible-runtime/lib/python3.8/site-packages/ansible/executor/task_executor.py",
> line 119, in run
>
> item_results = self._run_loop(items)
>
> File
> "/opt/ansible-runtime/lib/python3.8/site-packages/ansible/executor/task_executor.py",
> line 354, in _run_loop
>
> res = self._execute(variables=task_vars)
>
> File
> "/opt/ansible-runtime/lib/python3.8/site-packages/ansible/executor/task_executor.py",
> line 589, in _execute
>
> result = self._handler.run(task_vars=variables)
>
> File
> "/etc/ansible/ansible_collections/openstack/config_template/plugins/action/config_template.py",
> line 869, in run
>
> resultant = self._check_templar(data=template_data)
>
> File
> "/etc/ansible/ansible_collections/openstack/config_template/plugins/action/config_template.py",
> line 768, in _check_templar
>
> return self._templar.template(
>
> File
> "/opt/ansible-runtime/lib/python3.8/site-packages/ansible/template/__init__.py",
> line 869, in template
>
> result = self.do_template(
>
> File
> "/opt/ansible-runtime/lib/python3.8/site-packages/ansible/template/__init__.py",
> line 1139, in do_template
>
> res = j2_concat(rf)
>
> File "<template>", line 111, in root
>
> File "<template>", line 30, in t_3
>
> *jinja2.exceptions.TemplateRuntimeError: No filter named 'ipaddr' found*.
>
> fatal: [localhost]: FAILED! => {
>
> "msg": "Unexpected failure during module execution.",
>
> "stdout": ""
>
> }
>
> RUNNING HANDLER [systemd_networkd : Restart networkd]
> *****************************************************************************************************************
>
> task path: /etc/ansible/roles/systemd_networkd/handlers/main.yml:16
>
> Read vars_file '{{ playbook_dir
> }}/../playbooks/defaults/repo_packages/openstack_services.yml'
>
> <localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
>
> <localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'
>
> <localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo
> /root/.ansible/tmp `"&& mkdir "` echo
> /root/.ansible/tmp/ansible-tmp-1646414479.331306-38764-149355553789280
> `" && echo ansible-tmp-1646414479.331306-38764-149355553789280="` echo
> /root/.ansible/tmp/ansible-tmp-1646414479.331306-38764-149355553789280
> `" ) && sleep 0'
>
> Using module file
> /opt/ansible-runtime/lib/python3.8/site-packages/ansible/modules/systemd.py
>
> <localhost> PUT
> /root/.ansible/tmp/ansible-local-36177dradb42n/tmpeyfb1i4v TO
> /root/.ansible/tmp/ansible-tmp-1646414479.331306-38764-149355553789280/AnsiballZ_systemd.py
>
> <localhost> PUT
> /root/.ansible/tmp/ansible-local-36177dradb42n/tmpdkb43zb8 TO
> /root/.ansible/tmp/ansible-tmp-1646414479.331306-38764-149355553789280/async_wrapper.py
>
> <localhost> EXEC /bin/sh -c 'chmod u+x
> /root/.ansible/tmp/ansible-tmp-1646414479.331306-38764-149355553789280/
> /root/.ansible/tmp/ansible-tmp-1646414479.331306-38764-149355553789280/AnsiballZ_systemd.py
> /root/.ansible/tmp/ansible-tmp-1646414479.331306-38764-149355553789280/async_wrapper.py
> && sleep 0'
>
> <localhost> EXEC /bin/sh -c
> 'ANSIBLE_ASYNC_DIR='"'"'~/.ansible_async'"'"' /usr/bin/python3
> /root/.ansible/tmp/ansible-tmp-1646414479.331306-38764-149355553789280/async_wrapper.py
> 6737658312 45
> /root/.ansible/tmp/ansible-tmp-1646414479.331306-38764-149355553789280/AnsiballZ_systemd.py
> _ && sleep 0'
>
> changed: [localhost] => {
>
> "ansible_job_id": "6737658312.38783",
>
> "changed": true,
>
> "finished": 0,
>
> "results_file": "/root/.ansible_async/6737658312.38783",
>
> "started": 1
>
> }
>
> RUNNING HANDLER [systemd_networkd : (RE)Gather facts post setup]
> ******************************************************************************************************
>
> task path: /etc/ansible/roles/systemd_networkd/handlers/main.yml:29
>
> Read vars_file '{{ playbook_dir
> }}/../playbooks/defaults/repo_packages/openstack_services.yml'
>
> Using module file
> /opt/ansible-runtime/lib/python3.8/site-packages/ansible/modules/setup.py
>
> Pipelining is enabled.
>
> <localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
>
> <localhost> EXEC /bin/sh -c '/usr/bin/python3 && sleep 0'
>
> ok: [localhost]
>
> PLAY RECAP
> ************************************************************************************************************************************************************
>
> localhost : ok=105 changed=7 unreachable=0 failed=1
> skipped=26 rescued=0 ignored=0
>
> thanks for any help
>
> ------------------------------------------------------------------------
> “This e-mail and any accompanying attachments are confidential. The
> information is intended solely for the use of the individual to whom
> it is addressed. Any review, disclosure, copying, distribution, or use
> of the email by others is strictly prohibited. If you are not the
> intended recipient, you must not review, disclose, copy, distribute or
> use this e-mail; please delete it from your system and notify the
> sender immediately.”
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20220308/d6b502bb/attachment-0001.htm>
More information about the openstack-discuss
mailing list