# install package conditionally

**URL:** <https://forum.ansible.com/t/install-package-conditionally/19029>\
**Category:** Ansible Project\
**Created:** [August 15, 2015, 4:11pm UTC](https://forum.ansible.com/t/install-package-conditionally/19029 "2015-08-15T16:11:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user66](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@user66](https://forum.ansible.com/u/user66)\
**Post date:** [August 15, 2015, 4:11pm UTC](https://forum.ansible.com/t/install-package-conditionally/19029/1 "2015-08-15T16:11:04Z")

</div>

is it just me or conditional installation of packages is not possible with ansible?

- name: install foreman rubygem-apipie-bindings package  
yum: name=rubygem-apipie-bindings state=present  
when: foreman\_proxy\_register

the package always installs even if I specify

```auto
foreman_proxy_register: false

```

in host\_vars

---

<div class="post-metadata">

**Author:** ![user66](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@user66](https://forum.ansible.com/u/user66)\
**Post date:** [August 15, 2015, 4:17pm UTC](https://forum.ansible.com/t/install-package-conditionally/19029/2 "2015-08-15T16:17:18Z")

</div>

It was me.  
Sorry guys
