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/20201022135833.1cda1e51%40gmail.com.

Attachment: pgpZneRXDEQQT.pgp
Description: OpenPGP digital signature

Reply via email to