I have the following playbook:
---
- hosts: debian
order: sorted
tasks:
-name: postfix - set debconf defaults before postfix install
shell: debconf-set-selections <<< "postfix postfix/mailname string {{ inventory_hostname }}" executable=/bin/bash
tags: postfix
But i get the error:
ERROR! Syntax Error while loading YAML.
mapping values are not allowed in this context
The error appears to have been in '/opt/ansible/playbooks/postfix.yml': line 6, column 12, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
-name: postfix - set debconf defaults before postfix install
shell: debconf-set-selections <<< "postfix postfix/mailname string {{ inventory_hostname }}" executable=/bin/bash
^ here
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 }}"
Help, please! What am i doing wrong?