I'm trying to come up with a router config geenrator for cisco routers. I have a the correct folder structure and a file called site.yaml that I run as the playbook. It called the router role so uses the main.yaml file under the tasks folder. This part all works and hit my templates with my varisables but only if I define them in the main.yaml file. I want ansible to prompt for them so started playing around with vars_promt. Here is the main.yaml file . Any ideas? I get the error "ignoring invalid attribute: vars_prommpt"and never get prompted to enter vales
cut paste added lines return but those are ok so ignore
---
- name: Generate Cisco configuration files with prompts
vars_prompt:
- name: "ihostname"
prompt: "Hostname?"
- name: "iloopback"
prompt: "Loopback?"
- name: "ilaninterface"
prompt: "LAN Interface?"
- name: "ilandataip"
prompt: "LAN Data IP?"
- name: "ilansubmask"
prompt: "LAN Subnet Mask?"
- name: "ilanvoiceip"
prompt: "LAN Voice IP?"
- name: "iwaninterface"
prompt: "WAN Interface?"
- name: "iwancarrier"
prompt: "Circuit Carrier?"
- name: "icircuitid"
prompt: "Circuit ID?"
- name: "ilecid"
prompt: "LEC Circuit ID?"
- name: "iceip"
prompt: "CE IP?"
- name: "icesubmask"
prompt: "CE Subnet Mask?"
- name: "ibgpas"
prompt: "BGP AS?"
template: src=router.j2 dest=/root/networkauto/output/{{item.hostname}}.txt
with_items:
- {hostname: "{{ihostname}}", loopback: "{{iloopback}}", laninterface: "{{ilaninterface}}", landataip: "{{ilandataip}}", lansubmask: "{{ilansubmask}}", lanvoiceip: "{{ilanvoiceip}}", waninterface: "{{iwaninterface}}", wancarrier: "{{iwancarrier}}", circuitid: "{{icircuitid}}", lecid: "{{ilecid}}", ceip: "{{iceip}}", cesubmask: "{{icesubmask}}", bgpas: "{{ibgpas}}"}