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

51 views
Skip to first unread message

alexey....@gmail.com

unread,
Jan 19, 2016, 2:40:00 AM1/19/16
to Ansible Development
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

Dossy Shiobara

unread,
Jan 21, 2016, 4:00:49 PM1/21/16
to Ansible Development
Make `run_once_by` an alias of `with_items`?


On 1/19/16 2:40 AM, alexey....@gmail.com wrote:
> * Add 'run_once_by' parameter for running task once for each unique
> value of 'run_once_by'.

--
Dossy Shiobara | "He realized the fastest way to change
do...@panoptic.com | is to laugh at your own folly -- then you
http://panoptic.com/ | can let go and quickly move on." (p. 70)
* WordPress * jQuery * MySQL * Security * Business Continuity *

Will Thames

unread,
Jan 31, 2016, 9:30:16 PM1/31/16
to Ansible Development


On Tuesday, January 19, 2016 at 5:40:00 PM UTC+10, alexey....@gmail.com wrote:
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.

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
Reply all
Reply to author
Forward
0 new messages