Some important features in Ansible that I'd like to see ('creates', 'removes', 'run_once_by')

Hi!

I want to suggest a few major and valuable, as I see it, features and invite community to discuss:

  • Add ‘creates’ and ‘removes’ parameters for any task, not only for modules like ‘shell’, as it works now.
  • Add ‘run_once_by’ parameter for running task once for each unique value of ‘run_once_by’.

For example: I have a variable ‘ec2_region’ and need to create security groups once in region, so I’ll able to do the following:

- name:
sudo: False
delegate_to: 127.0.0.1
run_once_by: "{{ ec2_region }}"
ec2_group:

So, I think these are may be pretty useful and often appliable for practic usage.

P.S. Previously, this message was mistakenly posted in «Ansible Project» https://groups.google.com/d/msg/ansible-project/nGg-l6sh_c4/DggA42pmAAAJ

Make `run_once_by` an alias of `with_items`?

They’re necessary for command and shell so that Ansible can tell whether the task needs to do anything (if not it can just set changed=false and continue).

What benefits would we get through having them for other modules?

Will