Task YML Synthax

Hello,

depending of the playbook, the modules attribute’s in task are differently written :

Colon synthax :

  • name: APT | Update the general configuration (/etc/apt/apt.conf.ds/10general) |
  • |
    template: |
    src: etc_apt_apt.conf.d_10general.j2 |
    dest: /etc/apt/apt.conf.d/10general |
    owner: root |
    group: root |
    mode: 0644 |

Equal synthax :

The “=” short form is often more concise for simple things that can be put all on one line

  • copy: src=a dest=/tmp/b mode=0644 owner=root

etc

Both are fine and neither will be deprecated.

The colon form is needed to pass structured data, as is required by some modules, like the ec2 modules

Thanks a lot for your answer.