Effectively, you have to use `ansible_python_interpreter=/usr/bin/python` for any tasks that interact with `yum`. This is because the `yum` python bindings are only available via the default system python 2 at /usr/bin/python
It can be set on a per task basis under `vars:` for that task, if you only want to drop down to Py2 for the `yum` tasks, but it will have to be explicitly set for every `yum` task. Otherwise, just using the system python2 for everything on CentOS7 will be much easier to manage. On Wed, Sep 28, 2022 at 12:14 PM Michael Nelson <[email protected]> wrote: > Hi, > > I have managed to by-pass such issues by setting the > ansible_python_interpreter on the CentOS 7 hosts. > > May not be the same issue, but just something to pay attention to. > > > Regards, > > Antuelle78 > On 28/09/2022 19:04, [email protected] wrote: > > Okay! So, we have a bunch of proprietary software that we have to run on > Centos 7. We've been using python3 for years. I'm trying to install an > RPM with ansible yum module and it fails because python3. It suggests DNF, > but hey, Centos7 doesn't have DNF. Okay, I'll just use builtin.command. > Builtin.command says "Hey, you should use 'yum'! If you don't want this > warning set warn: false. Docs say the 'warn' param of builtin.command is > deprecated. > > > https://docs.ansible.com/ansible/latest/collections/ansible/builtin/command_module.html > > Sad Face. > > Is there something that takes over the job of warn:false now that > warn:false is deprecated? > > Is there some other way to install RPMs from yum repos on Centos7 that > doesn't involve installing python2 or using builtin.command or at least > doesn't give me warnings? > > Thanks! > > PS I love Ansible, and I love the way you aren't afraid to change it to > make it better. > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/75ea3894-cb82-49b0-b05d-61fb84a77953n%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/75ea3894-cb82-49b0-b05d-61fb84a77953n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/994d7d1d-30ad-eded-5a0e-cba298a9a297%40cityscoot.eu > <https://groups.google.com/d/msgid/ansible-project/994d7d1d-30ad-eded-5a0e-cba298a9a297%40cityscoot.eu?utm_medium=email&utm_source=footer> > . > -- Matt Martz @sivel sivel.net -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAD8N0v_4nRV3%2BxyBPm7WEipLu02VJ5v%2BXFOv2SeyOqrwUjTmUw%40mail.gmail.com.
