В этом блоке кода работает ansible 2.9.6:
// System / group_vars / all / vars.yml
---
# AWS S3
# User Ansible
# Permissions put/get on arn:aws:s3:::snap/backup-db/*
# Plus d'infos: https://console.aws.amazon.com/iam/home?region=eu-west-2#/users/ansible?section=permissions
s3_access_key: {{ lookup('aws_ssm', '/iam/ansible/access-key', region='eu-west-2', aws_access_key=aws_access_key, aws_secret_key=aws_secret_key) }}
Выдает следующую ошибку:
ERROR! Syntax Error while loading YAML.
found unacceptable key (unhashable type: 'AnsibleMapping')
The error appears to be in 'System/group_vars/all/vars.yml': line 32, column 63, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
# Plus d'infos: https://console.aws.amazon.com/iam/home?region=eu-west-2
^ here
There appears to be both 'k=v' shorthand syntax and YAML in this task. Only one syntax may be used.
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:
with_items:
- {{ foo }}
Should be written as:
with_items:
- "{{ foo }}"
Он считает, что region=eu-west-2
- это ключевое значение, смешанное с синтаксисом YML.
Что я могу сделать, чтобы избежать Ansible выдачи этой ошибочной ошибки, поскольку она есть в комментарии YML?
Спасибо:)