playbook YAML hash for module flags

Looks like you are indenting too much.

  • name: “creating a config file from a rendered template”
    template:
    dest: /tmp/foobar.conf
    group: bar
    mode: 493
    owner: foo
    src: /home/vagrant/ansible-templates/foobar.j2

Works.

yamllint.com can be useful at times.

It wasn’t the indention (I had tried several ones before) it was the missing spaces after the columns.
so

  • name: “creating a config file from a rendered template”
    template:
    dest: /tmp/foobar.conf
    group: bar
    mode: 493
    owner: foo
    src: /home/vagrant/ansible-templates/foobar.j2

works

but

  • name: “creating a config file from a rendered template”
    template:
    dest:/tmp/foobar.conf
    group:bar
    mode:493
    owner:foo
    src:/home/vagrant/ansible-templates/foobar.j2

doesn’t

Unfortunately yamllint.com gives valid syntax for both versions (I had tried that too thanks to the links on the YAML chapter on the website =) )

Yeah, when I tried your original it said it was valid but evaluated to
something completely different once you clicked "save", which was how
I could tell.