我正在尝试使用 F5 池查询的输出注册一个变量,但收到此错误:
"<type 'list'>": "VARIABLE IS NOT DEFINED!",
Run Code Online (Sandbox Code Playgroud)
我做错了什么?任何帮助表示赞赏。谢谢!
---
- name: GRAB F5 FACTS
hosts: f5
connection: local
gather_facts: no
tasks:
- name: Collect BIG-IP facts
bigip_device_facts:
gather_subset: ltm-pools
provider: "{{ prov }}"
register: bigip_device_facts
- name: FACTS OUTPUT
debug:
var: "{{ item.members | rejectattr('state', 'match', '^present$') | map(attribute='name') | list }}"
register: jkout
with_items: "{{ bigip_device_facts.ltm_pools }}"
when: item.full_path == "/Common/mypool"
- name: Set a variable
debug:
msg: "jkvar={{ jkout }}"
Run Code Online (Sandbox Code Playgroud)