Ansible: How to append new key to dict?

定义:

cloudmgr_docker_log_options:

    "syslog-address": "tcp://192.168.108.29:9700"

    "syslog-facility": "daemon"

增加一对key-value:

- name: Set log tag 

  set_fact:

    log_tag: { 'tag': '{{ cloudmgr_region_console.server.hostname }}' }

    log_options: "{{ cloudmgr_docker_log_options | combine(log_tag) }}"   


https://stackoverflow.com/questions/31772732/ansible-how-to-keep-appending-new-keys-to-a-dictionary-when-using-set-fact-mod

你可能感兴趣的:(Ansible: How to append new key to dict?)