Ansible failure: Invalid variable name in 'register' specified: 'import'
mloskot opened this issue · 0 comments
mloskot commented
While building Windows 2019 image (for sig-windows-dev-tools), I've noticed the following Ansible error:
...
virtualbox-iso: TASK [load_additional_components : Load additional Docker images] **************
virtualbox-iso: ERROR! Invalid variable name in 'register' specified: 'import'
virtualbox-iso: skipping: [default] => (item=)
virtualbox-iso: skipping: [default]
2023/05/03 20:21:14 [INFO] (telemetry) ending ansible
==> virtualbox-iso: Error executing Ansible: Non-zero exit status: exit status 1
==> virtualbox-iso: Step "StepProvision" failed
==> virtualbox-iso: [c] Clean up and exit, [a] abort without cleanup, or [r] retry step (build may fail even if retry succeeds)?
I have near-zero experience with Ansible and searching the web for this error does not return any useful results.
I started wondering if the import
used here is a reserved keyword in Python-powered Ansible:
I guess it would have been caught already, unless it's been changed in in the latest Ansible. The word import
is not listed as special keyword - https://docs.ansible.com/ansible/latest/reference_appendices/playbooks_keywords.html
Any ideas what is the error about?
$ ansible --version
ansible [core 2.14.5]
config file = None
configured module search path = ['/home/mloskot/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/mloskot/.local/lib/python3.10/site-packages/ansible
ansible collection location = /home/mloskot/.ansible/collections:/usr/share/ansible/collections
executable location = /home/mloskot/.local/bin/ansible
python version = 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] (/usr/bin/python3)
jinja version = 3.1.2
libyaml = True