Hi, I would like to clarify how network template modules are handling given src configuration because so far I’ve found out several cases where its breaking the order of configuration commands.
This is my used playbook.
For example:
tmplconfig.j2 :
vlan 901
name 0901-vlan
vlan 902
name 0902-vlan
vlan 903
name 0903-vlan
vlan 411
name 0411-vlan
vlan 427
name 0427-vlan
vlan 419
name 0419-vlan
vlan 870
name 0870-vlan
vlan 550
name 0550-vlan
vlan 554
name 0554-vlan
for ios_template and nxos_template returns something like this:
TASK [debug] *******************************************************************
ok: [switch-test] => {
“template”: {
“changed”: true,
“updates”: [
“vlan 411”,
“vlan 413”,
“vlan 415”,
“name 0415-vlan”,
“name 0552-vlan”,
“name 0413-vlan”,
“vlan 551”,
“name 0551-vlan”,
“vlan 552”,
"vlan 870 ",
“name 0870-vlan”,
“name 0411-vlan”
]
}
}
Single space intendation corrects this for IOS, doublespace for NXOS.
So, I have to use something like this:
vlan 901
name 0901-vlan
which is not optimal, because it looks like that it then does not match any existing configuration for the vlans (because of the two leading spaces before name vlan configuration subcommand).