playbook multiple actions per task not working

Hi,

I am running the dev release of ansible from github.

I am having issues with multiple action’s per task. It seems only one action is working.

The following playbook won’t deploy any files to the target host:

  • hosts: graphite
    user: mweber
    tasks:
  • name: deploy basic monitoring
    action: copy src=monitoring/cpu.py dest=/home/mweber/cpu.py owner=mweber group=users mode=0740
    action: copy src=monitoring/io.py dest=/home/mweber/io.py owner=mweber group=users mode=0740
    action: copy src=monitoring/guardian.py dest=/home/mweber/guardian.py owner=mweber group=users mode=0740
    action: copy src=monitoring/net.py dest=/home/mweber/net.py owner=mweber group=users mode=0740
    action: copy src=monitoring/sp_lib.py dest=/home/mweber/sp_lib.py owner=mweber group=users mode=0740

The following example playbook works:

  • hosts: graphite
    user: mweber
    tasks:
  • name: deploy basic monitoring
    action: copy src=monitoring/cpu.py dest=/home/mweber/cpu.py owner=mweber group=users mode=0740

There is no such thing as multiple actions per task. A task has an action and a name. One of each.

You just overrode a hash entry.

It looks like this:

tasks:

  • name:
    action:
  • name:
    action:

Thank you for the clarification.

That seems obvious once I consider the YAML code, but I feel into that
trap of seeing actions as sub-tasks.

Should I note that in the playbook docs?

Could warn about that in the playbook parser, but would take time to
figure out.

That seems obvious once I consider the YAML code, but I feel into that
trap of seeing actions as sub-tasks.

Should I note that in the playbook docs?

I don’t think so, because none of the examples show this. If we documented all the things you couldn’t do, the doc would be infinitely long :slight_smile:

Could warn about that in the playbook parser, but would take time to
figure out.

It’s all in the YAML parser, technically YAML should probably warn about that, if anything it’s something to be fixed in PyYAML, if they are even interested.