# Get all packages list in the following pattern"packagename-version-arch"

**URL:** <https://forum.ansible.com/t/get-all-packages-list-in-the-following-pattern-packagename-version-arch/35497>\
**Category:** Ansible Project\
**Created:** [July 13, 2021, 12:24pm UTC](https://forum.ansible.com/t/get-all-packages-list-in-the-following-pattern-packagename-version-arch/35497 "2021-07-13T12:24:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julien](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@Julien](https://forum.ansible.com/u/Julien)\
**Post date:** [July 13, 2021, 12:24pm UTC](https://forum.ansible.com/t/get-all-packages-list-in-the-following-pattern-packagename-version-arch/35497/1 "2021-07-13T12:24:37Z")

</div>

Hello everyone,

I’d like to gather package facts and simply store them into a variable as a list with this pattern: packagename-version-arch.

I’ve tried several things: mapping attributes, select attributes, for. Without any success. I’m not understanding the structure of ansible\_facts.packages.

Note that I do not want to use a loop, because doing it for 6k+ items will take too much time.

Example:

“ansible\_facts.packages”: {

“389-ds-base”: [

{

“arch”: “x86\_64”,

“epoch”: null,

“name”: “389-ds-base”,

“release”: “22.el7\_6”,

“source”: “rpm”,

“version”: “[1.3.8.4](https://1.3.8.4/)”

}

],

“389-ds-base-libs”: [

{

“arch”: “x86\_64”,

“epoch”: null,

“name”: “389-ds-base-libs”,

“release”: “22.el7\_6”,

“source”: “rpm”,

“version”: “[1.3.8.4](https://1.3.8.4/)”

}

],

Desired output:

389-ds-base-1.3.8.4-x86\_64

389-ds-base-libs-1.3.8.4-x86\_64

Thanks
