rolling YUM packages back

31 views
Skip to first unread message

Dick Davies

unread,
Jun 30, 2016, 10:31:29 AM6/30/16
to ansible list
I've got some tasks I use to make sure we're on the correct RPM version.
Each inventory governs an environment with a common site.yml playbook.

(ansible 1.9.x, centos 6.x)

$environment/group_vars/all holds vars like

thingy_rpm: thingy-1.2.3.500

and the play has tasks like

- name: ensure we are on {{ thingy_rpm }}
yum: name={{ thingy_rpm }} state=present
notify: bounce thingy


This works fine when I'm on a version earlier than 1.2.3.500, but if I need
to roll back an RPM and try setting

thingy_rpm: thingy-1.2.2.500

nothing happens.

Am I holding this thing the right way round? Or are the versions in a yum
task a minimum?

jta...@ansible.com

unread,
Jul 1, 2016, 1:00:26 PM7/1/16
to Ansible Project, di...@hellooperator.net
The current module docs for yum state this for the name parameter ...

    Package name, or package specifier with version, like name-1.0. When using state=latest, this can be '*' which means run: yum -y update. You can also pass a url or a local path to a rpm file (using state=present). To operate on several packages this can accept a comma separated list of packages or (as of 2.0) a list of packages.

    Try using the latest version of ansible and see if that resolves the issue. If this is a "downgrade" operation rather than a fresh install, there are open bugs+PRs for that.

    Dick Davies

    unread,
    Jul 2, 2016, 4:34:23 PM7/2/16
    to Ansible Project
    Ah thanks - I was using ansible1.9 from an EPEL6 mirror that might not be up to date;
    looks like 1.9.2 or better should sort this out.

    Reply all
    Reply to author
    Forward
    0 new messages