ansible lineinfile colon

При добавлении таска:

- name: "Grant zabbix user perms to exec docker command"
lineinfile: path="/etc/sudoers" line='zabbix ALL=(ALL) NOPASSWD: /bin/docker'

вывалилась ошибка :

ERROR! Syntax Error while loading YAML.

The error appears to have been in '/opt/ansible/roles/xxx/tasks/main.yml': line 46, column 68, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: "Grant zabbix user perms to exec docker command"
lineinfile: path="/etc/sudoers" line='zabbix ALL=(ALL) NOPASSWD\\: /bin/docker'
^ here

Легкий хак для этого дела. Меняем

:

на

{{':'}}

и парсер съедает нормально

Tags: , ,

Leave a Reply