# ansible yum install

**URL:** <https://forum.ansible.com/t/ansible-yum-install/34218>\
**Category:** Ansible Project\
**Created:** [November 20, 2020, 4:54pm UTC](https://forum.ansible.com/t/ansible-yum-install/34218 "2020-11-20T16:54:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Bidwell](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@Chris\_Bidwell](https://forum.ansible.com/u/Chris_Bidwell)\
**Post date:** [November 20, 2020, 4:54pm UTC](https://forum.ansible.com/t/ansible-yum-install/34218/1 "2020-11-20T16:54:53Z")

</div>

Hi all! Curious how I could do this using the yum module, or should I just run this command as shell or “command”?

```auto
WAZUH_MANAGER="10.0.0.2" yum install wazuh-agent

```

So essentially setting this variable and applying it to this install.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [November 20, 2020, 5:10pm UTC](https://forum.ansible.com/t/ansible-yum-install/34218/2 "2020-11-20T17:10:57Z")

</div>

Try the yum module and a custom environment variable:  
[https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_environment.html#setting-the-remote-environment-in-a-task](https://docs.ansible.com/ansible/latest/user_guide/playbooks_environment.html#setting-the-remote-environment-in-a-task)

---

<div class="post-metadata">

**Author:** ![Chris\_Bidwell](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@Chris\_Bidwell](https://forum.ansible.com/u/Chris_Bidwell)\
**Post date:** [November 20, 2020, 7:43pm UTC](https://forum.ansible.com/t/ansible-yum-install/34218/3 "2020-11-20T19:43:31Z")

</div>

Hi all,

I tried this:

- name: Install Wazuh-agent  
yum:  
name: wazuh-agent  
state: latest  
environment: “WAZUH\_MANAGER=‘10.0.0.2’”

And this was my result:  
TASK [Install Wazuh-agent] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
[WARNING]: could not parse environment value, skipping: [“WAZUH\_MANAGER=‘10.0.0.2’”]  
changed: [zli-lx]

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [November 20, 2020, 7:48pm UTC](https://forum.ansible.com/t/ansible-yum-install/34218/4 "2020-11-20T19:48:45Z")

</div>

> Hi all,
> 
> I tried this:  
> - name: Install Wazuh-agent  
> yum:  
> name: wazuh-agent  
> state: latest  
> environment: "WAZUH\_MANAGER='10.0.0.2'"

Chris, the environment task parameter expects a dict and not a string.

Please try:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;environment:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WAZUH\_MANAGER: '10.0.0.2'

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke
