Thank you @Vladimir provided solution worked for me. But do we have an
option to pass both commands with a single option input like:
D: freespace -m
yum repolist
On Thursday, October 22, 2020 at 5:29:06 PM UTC+5:30 [email protected] wrote:
> On Thu, 22 Oct 2020 04:16:28 -0700 (PDT)
> Sobhan Anavarapu <[email protected]> wrote:
>
> > ... value_command is the module, do we need to add the vars in the
> > module ?
> >
> > vars:
> > command_set:
> > A: ipaddr
> > B: ifconfig
> > C: freespace -m
> > D: yum repolist
>
> It's up to you where you put the variables. Yes, module is one of the
> options. Mind the indentation. For example
>
> - command: "{{ command_set[input] }}"
> vars:
> command_set:
> A: ipaddr
> B: ifconfig
> C: freespace -m
> D: yum repolist
>
> But, the point here is to manage the control-flow by data. Using the
> hard-coded data you get rid of this advantage. See
> "Variable precedence: Where should I put a variable?"
>
> https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable
>
>
> --
> Vladimir Botka
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/5750410b-0031-48e5-8dfa-2a2979ffd309n%40googlegroups.com.