From 1a9f642356599707fc8aafcbc830d5e4fc29eed4 Mon Sep 17 00:00:00 2001 From: Nicolas MASSE Date: Mon, 9 May 2022 18:29:44 +0200 Subject: [PATCH] add key-value --- key-value.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 key-value.yaml diff --git a/key-value.yaml b/key-value.yaml new file mode 100644 index 0000000..039bebb --- /dev/null +++ b/key-value.yaml @@ -0,0 +1,15 @@ +- name: Jinja dict to key/value list + gather_facts: no + hosts: localhost + vars: + expected: param1=foo,param2=bar + input: + param1: foo + param2: bar + output: '{{ input.items() | map("join", "=") | sort | join(",") }}' + tasks: + - debug: + var: output + - assert: + that: + - output == expected