Hello Dear Fellows
I am a newbie to Ansible I searched for in existing discussions but I
couldn't find a clear answer , I was hoping you could help me find a write
Config
I am trying to write a playbook who *prompt* user for Interface ID and
change the VLAN accordingly , My playbook works without prompt but when I
add prompt it throw a error
it looks like I am not supposed to put *vars_promp* after config but I
tried in different lines and non of them worked
*Here Is My Inventory Yaml File:*
all:
children:
switches:
children:
ios:
hosts:
sw-1:
ansible_host: 10.10.10.20
vars:
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
ansible_become: yes
ansible_connection: network_cli
ansible_network_os: ios
ansible_become_method: enable
ansible_user: ncm
ansible_password: ncm
*And Here Is My Playbook*
---
- name: Config VLAN
hosts: switches
tasks:
- name: Configure Access
ios_l2_interfaces:
config:
* vars_prompt:*
* - name: "Interface" prompt: "Enter Interface Name"
private: false*
access:
vlan: 7
state: merged
here is the original playbook which actually works but with an static value
for interface ID
---
- name: Config VLAN
hosts: switches
tasks:
- name: Configure Access
ios_l2_interfaces:
config:
- name: GigabitEthernet1/0/35
access:
vlan: 7
state: merged
*Thanks for you time in advance *
--
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/10eeda64-9aa6-4420-af1a-d6be42f9d294n%40googlegroups.com.