You can check if you have a valid syntax at http://www.yamllint.com/
In YAML, sequences must have a dash followed by a space. On Friday, May 3, 2019 at 2:38:51 AM UTC-7, [email protected] wrote: > > 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? > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d37ee369-fd15-49ed-919c-bf55af44728a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
