image-builder: capi image-builder broken
Looks like due to PR https://github.com/kubernetes-sigs/image-builder/pull/68 merged
particularly
set_fact:
ecr: "{{ kubernetes_container_registry is regex('^[0-9]{12}.dkr.ecr.[^.]+.amazonaws.com\/') }}"
error log:
[0;32m ubuntu-1804: ERROR! Syntax Error while loading YAML.[0m
[0;32m ubuntu-1804: found unknown escape character[0m
[0;32m ubuntu-1804:[0m
[0;32m ubuntu-1804: The error appears to be in '/home/imgbuilder-ova/workspace/run-image-builder/62/image-builder/images/capi/ansible/roles/kubernetes/tasks/main.yml': line 40, column 92, but may[0m
[0;32m ubuntu-1804: be elsewhere in the file depending on the exact syntax problem.[0m
[0;32m ubuntu-1804:[0m
[0;32m ubuntu-1804: The offending line appears to be:[0m
[0;32m ubuntu-1804:[0m
[0;32m ubuntu-1804: set_fact:[0m
[0;32m ubuntu-1804: ecr: "{{ kubernetes_container_registry is regex('^[0-9]{12}.dkr.ecr.[^.]+.amazonaws.com\/') }}"[0m
[0;32m ubuntu-1804: ^ here[0m
[0;32m ubuntu-1804: We could be wrong, but this one looks like it might be an issue with[0m
[0;32m ubuntu-1804: missing quotes. Always quote template expression brackets when they[0m
[0;32m ubuntu-1804: start a value. For instance:[0m
cc @aaroniscode
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (21 by maintainers)
I’m 100% in agreement. I think swapping the
"
and'
in the Ansible command works. Going to put in a PRbtw, @CecileRobertMichon Thank you for sharing your result.
@aaroniscode I also think you could simplify the regex to
dkr\.ecr\..+\.amazonaws\.com
if that helps (although maybe it still doesn’t like the slashes).@figo if you take my small playbook above and run it like
ansible-playbook -vv test.yml
, you should see something like this (or an error):