- name: Extract the true package name from filename
ansible.builtin.set_fact:
# Dynamically build the regex: \.[variable]\.rpm$
extracted_package_name: "{{ artifact_file_name | regex_replace('\\.' ~ app_architecture ~ '\\.rpm$', '') }}"
- name: Report installation details
ansible.builtin.debug:
msg: |
Installation Verified:
- Package: {{ item.name }}
- Version: {{ item.version }}
- Release: {{ item.release }}
# Loop through all packages and select the one matching the extracted name
loop: >
{{
ansible_facts.packages.values()
| flatten
| selectattr('name', 'equalto', extracted_package_name)
| list
}}
# Verify the constant metadata values
when: item.version == "1" and item.release == "1"
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)