---
- hosts: test
tasks:
- name: print phone details
debug: msg="user {{ item.key }} is {{ item.value.name }} ({{ item.value.telephone }})"
with_dict: users
vars:
users:
alice: "Alice"
telephone: 123
Gdy ten playbook, otrzymuję ten błąd:ansibl: nie ma dostępu do wartości słownika - dostaje błąd: „Przedmiot dict” ma atrybut
One or more undefined variables: 'dict object' has no attribute 'name'
ten jeden faktycznie działa dobrze :
debug: msg="user {{ item.key }} is {{ item.value }}"
Czego mi brakuje?
O, błąd literowy ... dzięki! – user1692261