I would use the shell module to register to check the first value.

Then key off the saved_value.stdout or saved_value.rc on the conditional of
the second.

It may make sense to have an openstack_config module, but I suspect many
folks *might* just template the config files directly.  Depends where they
are stored.






On Fri, Aug 15, 2014 at 9:57 AM, tipytop <[email protected]> wrote:

> Hi,
>
> i have a following problem. I am building OpenStack which uses tool
> *openstack-config* for setting value in configuration files.
>
> To get value:
> openstack-config --get /etc/keystone/keystone.conf sql connection
> To set value:
> openstack-config --set /etc/keystone/keystone.conf sql connection {{
> VALUE }}
>
> So now I want to check if previous value matches the value I provide. If
> they do match, than it should report OK, otherwise CHANGED. Current
> solution is to register shell result of *GET* command and conditionally
> execute *SET* command, but I don't like that very much because I have to
> do that 50-100 times; therefore code would be quite unreadable.
>
> Does ansible provide easy mechanism to merge these two tasks or is
> copying ansible shell module and extending it the only solution?
>
> PS: sorry for bad title
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/277b82a0-8325-4207-b732-637a6b61e8b9%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/277b82a0-8325-4207-b732-637a6b61e8b9%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgx6WkGQ-9YhAqCgitRSqAcbb%3DsrujCB77TdTtJge5URTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to