docker11
- name: Artifact download and RPM deployment hosts: artifact_download become: yes gather_facts: yes pre_tasks: - name: "Discovery: Find the newest GComet RPM in /tmp" ansible.builtin.find: paths: "...

Source: DEV Community
- name: Artifact download and RPM deployment hosts: artifact_download become: yes gather_facts: yes pre_tasks: - name: "Discovery: Find the newest GComet RPM in /tmp" ansible.builtin.find: paths: "/tmp" patterns: "GComet*.rpm" recurse: yes register: discovered_rpms # Fixed name - name: "Discovery: Process found file" block: - name: "Identify target file" set_fact: target_file_path: "{{ (discovered_rpms.files | sort(attribute='mtime') | last).path }}" - name: "Extract Version and Filename" set_fact: artifacts_file_name: "{{ target_file_path | basename }}" discovered_version: "{{ target_file_path | dirname | basename }}" when: discovered_rpms.matched > 0 - name: "Discovery: Fallback to Harness Env Var if /tmp is empty" set_fact: discovered_version: "{{ lookup('env', 'BUILD_VERSION') }}" artifacts_file_name: "GComet.rpm" target_file_path: "Not found in /tmp (using environment default)" when: discovered_rpms.matched == 0 - name: "Discovery: Map to Legacy Variables" set_fact: lightspeed: