Ansible 1.9.0.1 - alternatives module seems broken

Just installed the latest version of Ansible through pip, since the upgrade the ‘alternatives’ module no longer seems to install a link if it doesn’t exist yet instead it just reports that there are no existing alternatives.

I’m calling the module with all required arguments (as before):

  • name: …
    alternatives: >
    name=‘sh’
    link=‘/bin/sh’
    path=‘/bin/bash’

result:

{“cmd”: “/usr/bin/update-alternatives --set sh /bin/bash”, “failed”: true, “rc”: 2}
stderr: update-alternatives: error: no alternatives for sh

What I have noticed is that the installed version of alternatives.py does not seem to match what's currently in github, the version installed by pip seems to be many revisions back.

I even went as far as removing ansible completely and reinstalling, making sure there are no mix-ups with old installations and what have you, but a clean pip install gives me ansible 1.9.0.1 with as it seems an outdated version of the alternatives module.

I didn’t run into this particular issue, but I grabbed the trunk version of alternatives.py from git, added it as my own module (after a file rename), and it seemed to work okay under the new name… seems like it’s broken in 1.9.0.1 and I assume will be formally fixed in 1.9.0.2 or whatever is next.

it should be fixed in upcomming 1.9.1