Hello,
you can use python script to map these host variables else you can directly
ask user to give input as Test01.
Thanks
Soniya
On Friday, September 15, 2017 at 11:52:47 AM UTC+5:30, vsslava one wrote:
>
> I have playbook
>
> - hosts: "{{ host }}"
> connection: paramiko
> gather_facts: no
> serial: 1
> user: administrator
> vars_prompt:
> - name: host
> prompt: "select the router to change default route?\n1- Test01\n2-
> Test02\n"
> default: 1
> private: no
>
> tasks:
> - debug: msg="{{ host }}"
>
> Inventory:
>
> [1]
> 192.168.10.100
>
> [2]
> 192.168.10.102
>
> but I need inventory:
>
> [Test01]
> 192.168.10.100
>
> [Test02]
> 192.168.10.102
>
> If you enter eg 1, the host variable contains 1, and I need to get Test01
>
--
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/a92cac2e-9cff-46bb-8018-1e4296ffe94f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.