Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates-alternatives slaves support #3366

Closed
1 task done
bioinfornatics opened this issue Sep 13, 2021 · 6 comments · Fixed by #4654
Closed
1 task done

Updates-alternatives slaves support #3366

bioinfornatics opened this issue Sep 13, 2021 · 6 comments · Fixed by #4654
Labels
cache cache plugin feature This issue/PR relates to a feature request has_pr module module needs_triage plugins plugin (any type) system

Comments

@bioinfornatics
Copy link

bioinfornatics commented Sep 13, 2021

Summary

Dear,

alternatives module seems to not support yet slaves

as records with --install we can use --slave

Usage:

update-alternatives  --help
Usage: update-alternatives [<option> ...] <command>

Commands:
  --install <link> <name> <path> <priority>
    [--slave <link> <name> <path>] ...
                           add a group of alternatives to the system.
  --remove <name> <path>   remove <path> from the <name> group alternative.
  --remove-all <name>      remove <name> group from the alternatives system.
  --auto <name>            switch the master link <name> to automatic mode.
  --display <name>         display information about the <name> group.
  --query <name>           machine parseable version of --display <name>.
  --list <name>            display all targets of the <name> group.
  --get-selections         list master alternative names and their status.
  --set-selections         read alternative status from standard input.
  --config <name>          show alternatives for the <name> group and ask the
                           user to select which one to use.
  --set <name> <path>      set <path> as alternative for <name>.
  --all                    call --config on all alternatives.

<link> is the symlink pointing to /etc/alternatives/<name>.
  (e.g. /usr/bin/pager)
<name> is the master name for this link group.
  (e.g. pager)
<path> is the location of one of the alternative target files.
  (e.g. /usr/bin/less)
<priority> is an integer; options with higher numbers have higher priority in
  automatic mode.

Options:
  --altdir <directory>     change the alternatives directory.
  --admindir <directory>   change the administrative directory.
  --instdir <directory>    change the installation directory.
  --root <directory>       change the filesystem root directory.
  --log <file>             change the log file.
  --force                  allow replacing files with alternative links.
  --skip-auto              skip prompt for alternatives correctly configured
                           in automatic mode (relevant for --config only)
  --quiet                  quiet operation, minimal output.
  --verbose                verbose operation, more output.
  --debug                  debug output, way more output.
  --help                   show this help message.
  --version                show the version.

Thanks

Issue Type

Feature Idea

Component Name

alternatives

Additional Information

Can you add this feature as example with dict structure

alternatives:
  name: 'foo'
  link: '/usr/local/bin/foo'
  path: '/opt/foo/1.0/bin/foo'
  slaves:
    - { 'name': 'foo_png', '/usr/local/pixmaps/foo.png' , 'path':  '/opt/foo/1.0/foo.png' }

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added affects_2.10 cache cache plugin feature This issue/PR relates to a feature request module module needs_triage plugins plugin (any type) system labels Sep 13, 2021
@ansibullbot
Copy link
Collaborator

ansibullbot commented Sep 13, 2021

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@fredizzimo
Copy link

There was a pull request in the ansible repository that added this ansible/ansible#52732. But it doesn't support changing the slaves once they are set. On the other hand, the priority also stays fixed after initially set, so maybe that's intended?

@bioinfornatics
Copy link
Author

bioinfornatics commented Mar 23, 2022

yes that seems a good thing.
If you have to update the slave part, you have to uninstall and install the alternatives
To my understanding update-aletrnativescommand line tool do not support to updates only the slaves part so the features proposed seems good to me

@chriscroome
Copy link

For what it's worth I've just written an alternatives role which does have "slaves" support (it uses ansible.builtin.command: update-alternatives --install) -- however once the community.general.alternatives module has is released with subcommands support I'll probably update it to use this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cache cache plugin feature This issue/PR relates to a feature request has_pr module module needs_triage plugins plugin (any type) system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants