Need Help for Install/Upgrade/Downgrade

26 views
Skip to first unread message

Rahul Kumar

unread,
Jul 22, 2019, 7:04:45 AM7/22/19
to ansible...@googlegroups.com
I want to use simple single task for install/upgrade/downgrade . All 3 cases , I want to handle in one task:
Currently I use 2 tasks:
For Install:
- name: Install RPMs
  yum:
     name: '{{ rpm_list }}'
     state: 'latest'
     enablerepo: '{{ my_repos_names }}'
     disable_gpg_check: '{{ my_allow_unsigned_rpms }}'
     update_cache: '{{ my_update_cache }}'
  environment: "{{ proxy_env }}"
 
For upgrade/downgrade I rely on calling below from shell module:

- name: "Performing Distribution Synchronization"
  shell: yum distro-sync -y --disablerepo="{{repo_to_disable|default('*')}}" --enablerepo="{{ Repo_to_enable}}"
Since distro-sync option of yum works on already installed rpms.( Yum does not have anything for downgrading cases , already some issues on this on github)

How i can achieve all 3 operations from single task, any idea ?

Stefan Hornburg (Racke)

unread,
Jul 22, 2019, 9:44:37 AM7/22/19
to ansible...@googlegroups.com
What are your objectives to do it in one task?

Regards
Racke

>
> --
> 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/CAGH8rEx2tgRbx4oEPqMOXz9r%3DCyS1LRqrAgLJOTqNB2hSYvBaQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAGH8rEx2tgRbx4oEPqMOXz9r%3DCyS1LRqrAgLJOTqNB2hSYvBaQ%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.

signature.asc

Rahul Kumar

unread,
Jul 22, 2019, 9:55:09 AM7/22/19
to ansible...@googlegroups.com
I am trying to see if this 2 tasks can be optimized or written in single task . Nothing special , just for redundant purpose. 

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/6656ba85-4c57-cf2e-8865-563ed91c3f63%40linuxia.de.

Stefan Hornburg (Racke)

unread,
Jul 22, 2019, 9:59:51 AM7/22/19
to ansible...@googlegroups.com
On 7/22/19 3:54 PM, Rahul Kumar wrote:
> I am trying to see if this 2 tasks can be optimized or written in single task . Nothing special , just for redundant
> purpose. 
>

Unless you are going to write your own Ansible module, this doesn't make sense to me.

Regards
Racke
> > ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com>
> <mailto: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/CAGH8rEx2tgRbx4oEPqMOXz9r%3DCyS1LRqrAgLJOTqNB2hSYvBaQ%40mail.gmail.com
> >
> <https://groups.google.com/d/msgid/ansible-project/CAGH8rEx2tgRbx4oEPqMOXz9r%3DCyS1LRqrAgLJOTqNB2hSYvBaQ%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.
>
> --
> 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/6656ba85-4c57-cf2e-8865-563ed91c3f63%40linuxia.de.
>
> --
> 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/CAGH8rExKiFkOk1dd8Kt%3Dn59O6aWX08Sqw0fBROk%2BLd%3DbaXJTzQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAGH8rExKiFkOk1dd8Kt%3Dn59O6aWX08Sqw0fBROk%2BLd%3DbaXJTzQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
signature.asc

Rahul Kumar

unread,
Jul 22, 2019, 10:01:37 AM7/22/19
to ansible...@googlegroups.com
Assume if this can be brought into. Ansible module . Then any way.   If u know 

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/bbad8c87-67e3-e7bb-c6e9-9260ef18dd9c%40linuxia.de.
Reply all
Reply to author
Forward
0 new messages