我正在尝试从 dict 列表中获取值,但无法获得所需的准确输出
使用安装了 ansible 2.7.5 和 jinja2 2.7.2 版本的 Linux 服务器。
下面是字典值的列表。
DOMAIN_GROUPS_ASSIGNMENT:
CACHE01:
- domain_group: DG1
is_active: true
- domain_group: DG2
is_active: true
- domain_group: DG3
is_active: true
CACHE02:
- domain_group: DG4
is_active: true
- domain_group: DG5
is_active: true
- domain_group: DG6
is_active: true
SCACHE01:
- domain_group: DG1
is_active: false
- domain_group: DG2
is_active: false
- domain_group: DG3
is_active: true
SCACHE02:
- domain_group: DG4
is_active: false
- domain_group: DG5
is_active: false
- domain_group: DG6
is_active: false
Run Code Online (Sandbox Code Playgroud)
到目前为止尝试使用以下代码:
- …Run Code Online (Sandbox Code Playgroud)