# Using the version of a package that has been installed

**URL:** <https://forum.ansible.com/t/using-the-version-of-a-package-that-has-been-installed/20620>\
**Category:** Ansible Project\
**Created:** [February 18, 2016, 6:49pm UTC](https://forum.ansible.com/t/using-the-version-of-a-package-that-has-been-installed/20620 "2016-02-18T18:49:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [February 18, 2016, 6:49pm UTC](https://forum.ansible.com/t/using-the-version-of-a-package-that-has-been-installed/20620/1 "2016-02-18T18:49:16Z")

</div>

Hi everyone,

say, we have a package, that different systems have in different  
versions. Depending on the version, that has been installed in the  
playbook previously, I would like to deploy a different version of  
the config files.

I think this is possible with ansible, but what is the most elegant,  
less errorprone way to do so?

Registering a variable during installation?  
Gathering facts after installation of the package seems rather overkil  
l.  
Issuing 'dpkg -l|grep xyz' or 'rpm -qa|grep xyz' or similar surely  
works, but is error prone and needs a lot of "when:  
ansible\_distribution == ..".

Thanks for any hints!

Johannes
