hello guys,
I need to build filenames based on 3 parts: basename, version and trailing
'.x86_64.rpm'.
Let's focus on the first 2 parts:
The first one is:
"installed_mtx_packages_name": [
"mtx-device",
"mtx-grpc-agent",
"mtx-infra",
...
]
The second one is:
"installed_mtx_packages_version": [
"1.0.0-r1705191346",
"1.0.1-r1705191346",
"1.0.0-r1705170158",
...
]
the goal is to obtain this:
"installed_mtx_packages_partialname": [
"mtx-device-1.0.0-r1705191346",
"mtx-grpc-agent-1.0.0-r1705191346",
"mtx-infra-1.0.0-r1705170158",
...
]
I've tried several strategies, including:
- name: Building partial name of installed MTX packages
set_fact:
installed_mtx_packages_partialname: "{{ installed_mtx_packages_name
| map('regex_replace', '(.*)', '\\1-item') | list }}"
with_items: installed_mtx_packages_version
But of course the item is considered as a string here instead of a variable.
If I move the ' just before item, I get the error:
"template error while templating string: expected token ',', got 'string' "
Any suggestion?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/38fa96c7-a7c1-46a6-914c-f345cc094654%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.