June 2017
Intermediate to advanced
446 pages
10h 10m
English
Let's also modify the playbook accordingly. In chapter5_8.yml, we will make the following changes:
--- - name: Template Looping hosts: localhost vars: nexus_devices: { "nx-osv-1": {"hostname": "nx-osv-1", "username": "cisco", "password": "cisco"} } tasks: - name: create router configuration files template: src=./nxos.j2 dest=./{{ item.key }}.conf with_dict: "{{ nexus_devices }}"
After running the playbook, you will find the destination file called nx-osv-1.conf with the values filled in and ready to be used:
$ cat nx-osv-1.conf ...
Read now
Unlock full access