ansible lineinfile colon

Posted in Новости on августа 29, 2017 by admin

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

- 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: , ,