Skip to content

5.1.0 breaks alternatives on RHEL 8 #4803

@jbpratt

Description

@jbpratt

Summary

When I try to run the below task, I receive a usage error from update-alternatives. Prior to 5.1.0, this works as expected. It looks like the --slave argument is missing a required value (--slave unversioned-python /usr/bin/python3 compared to --slave <slave_link> <slave_name> <slave_path>). Downgrading to 5.0.2 is a workaround.

Issue Type

Bug Report

Component Name

alternatives

Ansible Version

$ ansible --version
ansible [core 2.12.6]
  config file = /tmp/y/ansible.cfg
  configured module search path = ['/var/home/bpratt/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /tmp/y/venv/lib64/python3.10/site-packages/ansible
  ansible collection location = /var/home/bpratt/.ansible/collections:/usr/share/ansible/collections
  executable location = /tmp/y/venv/bin/ansible-playbook
  python version = 3.10.4 (main, Mar 25 2022, 00:00:00) [GCC 12.0.1 20220308 (Red Hat 12.0.1-0)]
  jinja version = 3.1.2
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general

# /var/home/bpratt/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 5.1.0

# /tmp/y/venv/lib/python3.10/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 4.8.2

# /tmp/y/venv/lib64/python3.10/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 4.8.2

Configuration

$ ansible-config dump --only-changed

OS / Environment

RHEL 8

Steps to Reproduce

    - community.general.alternatives:
        name: python
        path: /usr/bin/python3
        link: /usr/bin/python

Expected Results

{"changed": true}

Actual Results

TASK [community.general.alternatives] *******************************************************************************************************************************************
task path: /tmp/xyz/playbook.yml:4
redirecting (type: modules) community.general.alternatives to community.general.system.alternatives
fatal: [10.0.101.1]: FAILED! => changed=false
  ansible_facts:
    discovered_interpreter_python: /usr/libexec/platform-python
  cmd: /usr/sbin/update-alternatives --install /usr/bin/python python /usr/bin/python3 50 --slave unversioned-python /usr/bin/python3 --slave unversioned-python-man /usr/share/man/man1/python3.1.gz
  msg: ''
  rc: 2
  stderr: ''
  stderr_lines: <omitted>
  stdout: |-
    alternatives version 1.19.1 - Copyright (C) 2001 Red Hat, Inc.
    This may be freely redistributed under the terms of the GNU Public License.

    usage: alternatives --install <link> <name> <path> <priority>
                        [--initscript <service>]
                        [--family <family>]
                        [--slave <slave_link> <slave_name> <slave_path>]*
           alternatives --remove <name> <path>
           alternatives --auto <name>
           alternatives --config <name>
           alternatives --display <name>
           alternatives --set <name> <path>
           alternatives --list
           alternatives --remove-all <name>
           alternatives --add-slave <name> <path> <slave_link> <slave_name> <slave_path>
           alternatives --remove-slave <name> <path> <slave_name>

    common options: --verbose --test --help --usage --version --keep-missing --keep-foreign
                    --altdir <directory> --admindir <directory>
  stdout_lines: <omitted>

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions