From 2ccc59fa13c9834344d9c040cfa818b7d16f6800 Mon Sep 17 00:00:00 2001 From: Marcus Klein Date: Wed, 28 Sep 2022 15:18:41 +0200 Subject: [PATCH] document the removal of keys in ini files which requires an empty dictionary in playbook YAML config_overrides parameter Change-Id: I3ab9c434883e743738b3e06d54c3c54c84bc7217 --- doc/source/index.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/source/index.rst b/doc/source/index.rst index 77b2b79..6562ddd 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -42,6 +42,7 @@ Playbook: [section1] option1 = value1 + option2 = value2 dest: "test_dst.conf" config_type: "ini" config_overrides: @@ -49,6 +50,7 @@ Playbook: cruel: world section1: option1: value2 + option2: {} orderedListSection: listOpt: - listItem1 @@ -78,6 +80,11 @@ Resulting file on the remote host: multiStrOpOption = multiStrOp1 multiStrOpOption = multiStrOp2 +Take notice of the `option2` in `section1`, which is removed in the output but +requires an empty dictionary in the playbook YAML. The empty dictionary is +translated to `None` value and the default behavior is to remove keys with +`None` values. See parameter `ignore_none_type`, which defaults to `true`. + A practical example would be for something like OpenStack's nova.conf where the input of: