Table of Contents

Ansible - Dict (Map)

About

value type of a variable

The map variable in ansible is based on the python dict.

Default

{{ mydict|default({}) }}

Management

Set

See Yaml - Mapping (Map)

Get

map[key] 

example:

domains:
   example.com:
      - sub.example.com 
domains['example.com'] 

Loop

- name: Loop a dict
  debug:
    msg: "{{item.key}}: {{item.value}}"
  with_dict: "{{ letsencrypt_domain }}"