I have this array of dicts containing arrays out of the Ansible output of an acme_certificate
for DNS challenges ({{ le_challenges.results | json_query('[].challenge_data_dns') }}
):
[
{
"_acme-challenge.foo.example.de": [
"<token1>"
],
"_acme-challenge.bar.example.de": [
"<token2>",
"<token3>"
]
},
{
"_acme-challenge.baz.example.de": [
"<token4>"
]
}
]
As I do not need the individual _acme-challenge
records because all domains in question are CNAME-aliased towards a single Route53-hosted zone, I need the above output to be transformed to this so that I can run a loop
over route53
actions:
[
"<token1>",
"<token2>",
"<token3>",
"<token4>"
]
I tried all possible kinds of experiments including dict2list
and map
on the Ansible side, but I cannot find a way to accomplish this transformation since the keys containing the tokens have dynamic names. Any ideas?