Last Updated: February 25, 2016
·
811
· tartansandal

YAML formating for actions with many arguments

Some modules require more options than can comfortably fit on a single line in a playbook. In YAML you can use '>' to start a multi-line string that collapses intervening whitespace. For Example:

tasks:
    - name: "Write postgresql.conf file"
      action: >
              template
              src=files/postgresql.conf.j2
              dest=/var/lib/pgsql/data/postgresql.conf
              owner=postgres
              group=postgres
              mode=0600
      notify: reload postgresql