passing -y flag with yum

30 views
Skip to first unread message

Chad Fay

unread,
Oct 17, 2018, 9:36:50 PM10/17/18
to Ansible Project
I'm new at this, I'm trying to figure out how to pass the -y flag when I am installing with the yum module. I've tried pkg=<package_name> -y  but that doesn't work. I'm obviously doing something completely wrong, I'm just not sure what.

Thank you. 

Jonathan Lozada De La Matta

unread,
Oct 17, 2018, 9:39:01 PM10/17/18
to ansible...@googlegroups.com
what state are you using ?

On Wed, Oct 17, 2018 at 9:37 PM Chad Fay <chad...@gmail.com> wrote:
I'm new at this, I'm trying to figure out how to pass the -y flag when I am installing with the yum module. I've tried pkg=<package_name> -y  but that doesn't work. I'm obviously doing something completely wrong, I'm just not sure what.

Thank you. 

--
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 post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/158ec18b-ddcb-4577-9619-da12621eb9ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Jonathan lozada de la matta

AUTOMATION PRACTICE



 

Chad Fay

unread,
Oct 17, 2018, 11:51:35 PM10/17/18
to Ansible Project
yum: pkg=<package> -y state=present

I've worked around it buy using 
shell: yum install <package> -y

I'm not sure if using yum: pkg= with a -y is correct.

Jordan Borean

unread,
Oct 18, 2018, 12:07:05 AM10/18/18
to Ansible Project
You shouldn’t need to specify -y as it will confirm the prompts for you.

Chad Fay

unread,
Oct 18, 2018, 12:11:22 AM10/18/18
to Ansible Project
Unfortunately it doesn't and just times out.

ansible 2.7

Jordan Borean

unread,
Oct 18, 2018, 3:39:50 AM10/18/18
to Ansible Project
That sounds like a bug, how do you know for sure it's because it's not passing -y or not some other issue. Looking at the code '-y' is part of the base arguments that are always set so I don't think this is your issue https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/packaging/os/yum.py#L1473.

aakanks...@webdunia.net

unread,
Oct 18, 2018, 4:54:28 AM10/18/18
to Ansible Project
You can use :-

- name: install the latest version of <package_name>
  yum:
    name: <package_name>
    state: latest
OR

- name: install one specific version of <package_name> yum: name: <package_name>-2.9.amzn1 state: present

Jonathan Lozada De La Matta

unread,
Oct 18, 2018, 6:29:46 AM10/18/18
to ansible...@googlegroups.com
that's why I asked what state were you using. Can you di a run with extra verbise?

--
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 post to this group, send email to ansible...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages