should ec2_group module have the description as required?

18 views
Skip to first unread message

Dan Vaida

unread,
Dec 2, 2014, 10:30:09 AM12/2/14
to ansible...@googlegroups.com
Hello everyone,

I'm just trying to do some cleaning up as part of my playbooks and one task should go around and remove dummy security group(s).
Because of this case, I don't see the utility of the 'description' parameter as being mandatory.

One step further, I'd rather see the module support something like an optional 'id' parameter, which, when passed, would render the 'name' not mandatory. This would be really useful for using with the state=absent scenario. Not sure how Ansible handles parameters inter-dependency/over-riding/amending but I think there are some modules that come with comparable logic.

For example, the debug says something like:

TASK: [debug var=web_sg_creation] ********************************************* 
ok: [localhost] => {
    "web_sg_creation": {
        "changed": false, 
        "group_id": "sg-dcfd15b5", 
        "invocation": {
            "module_args": "", 
            "module_name": "ec2_group"
        }
    }
}

So how am I to go around doing the state=absent in the best Ansible-way?

Would be interesting to see some other opinions / suggestions.

Toshio Kuratomi

unread,
Dec 2, 2014, 7:30:07 PM12/2/14
to ansible...@googlegroups.com
On Tue, Dec 2, 2014 at 7:30 AM, Dan Vaida <vaid...@gmail.com> wrote:
> Hello everyone,
>
> I'm just trying to do some cleaning up as part of my playbooks and one task
> should go around and remove dummy security group(s).
> Because of this case, I don't see the utility of the 'description' parameter
> as being mandatory.
>

<nod>, that would make sense to me. Current behaviour is likely from
the module growing additional features over time and the combination
of options no longer making sense. So the module probably needs to
check if we're trying to create a security group and only if that's
true make lack of a description an error.

Care to submit a pull request for this?

-Toshio

Dan Vaida

unread,
Dec 3, 2014, 7:27:48 AM12/3/14
to ansible...@googlegroups.com
I'll fiddle around with it this weekend and update the thread when done.

Thanks!


--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/FlkfPg4doLM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAG9juEoKj8K1DcYc7vMixfCiz_qnj6rX29rpEo34QuHGHH6H1A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Alex Clifford

unread,
Jan 14, 2015, 8:04:56 AM1/14/15
to ansible...@googlegroups.com
Hi Dan,

Did you make any progress on this feature?
Reply all
Reply to author
Forward
0 new messages