ansible yum install

22 views
Skip to first unread message

Chris Bidwell - NOAA Federal

unread,
Nov 20, 2020, 11:55:30 AM11/20/20
to ansible...@googlegroups.com
Hi all!  Curious how I could do this using the yum module, or should I just run this command as shell or "command"?

WAZUH_MANAGER="10.0.0.2" yum install wazuh-agent
So essentially setting this variable and applying it to this install.


Dick Visser

unread,
Nov 20, 2020, 12:11:37 PM11/20/20
to ansible...@googlegroups.com
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
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAHKi8Cjycnrfo-S5gMW49BdBqvbkAa4wQvbZNUvRVqJ7U9DUiA%40mail.gmail.com.



--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

Chris Bidwell - NOAA Federal

unread,
Nov 20, 2020, 2:44:03 PM11/20/20
to ansible...@googlegroups.com
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]





--

Chris Bidwell, CISSP
Space Weather Prediction Center
National Oceanic Atmospheric Administration
email: chris.b...@noaa.gov
office: 303-497-3204
mobile: 720-496-3126

Stefan Hornburg (Racke)

unread,
Nov 20, 2020, 2:49:26 PM11/20/20
to ansible...@googlegroups.com
On 11/20/20 8:43 PM, 'Chris Bidwell - NOAA Federal' via Ansible Project wrote:
> 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:

environment:
WAZUH_MANAGER: '10.0.0.2'

Regards
Racke

> 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]
>
>
> On Fri, Nov 20, 2020 at 10:11 AM Dick Visser <dick....@geant.org <mailto:dick....@geant.org>> wrote:
>
> 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>
>
> On Fri, 20 Nov 2020 at 17:55, 'Chris Bidwell - NOAA Federal' via
> Ansible Project <ansible...@googlegroups.com <mailto:ansible...@googlegroups.com>> wrote:
> >
> > Hi all!  Curious how I could do this using the yum module, or should I just run this command as shell or "command"?
> >
> > WAZUH_MANAGER="10.0.0.2" yum install wazuh-agent
> >
> > So essentially setting this variable and applying it to this install.
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to
> ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com>.
> <https://groups.google.com/d/msgid/ansible-project/CAHKi8Cjycnrfo-S5gMW49BdBqvbkAa4wQvbZNUvRVqJ7U9DUiA%40mail.gmail.com>.
>
>
>
> --
> Dick Visser
> Trust & Identity Service Operations Manager
> GÉANT
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwNkvKXBmL6NzdZUL_LPuOuL2W9cSmBAQmmuLHe%2B%3D0dXyg%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAL8fbwNkvKXBmL6NzdZUL_LPuOuL2W9cSmBAQmmuLHe%2B%3D0dXyg%40mail.gmail.com>.
>
>
>
> --
>
> Chris Bidwell, CISSP
> Space Weather Prediction Center
> National Oceanic Atmospheric Administration
> email: c <mailto:cbid...@usgs.gov>hris.b...@noaa.gov <mailto:hris.b...@noaa.gov>
> office: 303-497-3204
> mobile: 720-496-3126
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAHKi8Chx3XHMJGkk-zJQjJmhSHbJzS8e%3DrdcKF%2B4_eZLBFMJAQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAHKi8Chx3XHMJGkk-zJQjJmhSHbJzS8e%3DrdcKF%2B4_eZLBFMJAQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.
OpenPGP_0x5B93015BFA2720F8.asc
OpenPGP_signature
Reply all
Reply to author
Forward
0 new messages