我有以下的ospf程序:
msg: ' OSPF Process: [''T1'', ''T2'', ''T3'']'
ospf_process:
- T1
- T2
- T3我有以下任务关闭ospf进程,但没有工作。是扔错了。
- name: Shut OSPF process
cisco.nxos.nxos_config:
lines:
- shutdown
parents: router ospf {{item}}
with_items: "{{ ospf_process }}"
save_when: modified错误是:
The task includes an option with an undefined variable. The error was: 'item' is undefined怎么修呢?
发布于 2022-10-19 13:29:01
您有语法错误,with_items应该是任务的参数,而不是nxos_config模块。你需要:
- name: Shut OSPF process
cisco.nxos.nxos_config:
lines:
- shutdown
parents: router ospf {{item}}
save_when: modified
with_items: "{{ ospf_process }}"https://stackoverflow.com/questions/74125843
复制相似问题