alternatives

Maintain symbolic links determining default commands

2,065,327 downloads

12,223 latest version

5.0 quality score

Version information

  • 6.0.0 (latest)
  • 5.1.0
  • 5.0.0
  • 4.2.0
  • 4.1.0
  • 4.0.0
  • 3.0.0
  • 2.1.0
  • 2.0.1
  • 2.0.0
  • 1.1.0
  • 1.0.2
  • 1.0.1
released Sep 18th 2024
This version is compatible with:
  • Puppet Enterprise 2025.3.x, 2025.2.x, 2025.1.x, 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
  • Puppet >= 7.0.0 < 9.0.0
  • Debian
    ,
    Ubuntu
    ,
    RedHat
    ,
    CentOS
    ,
    OracleLinux
    ,
    SLES
    ,
    AlmaLinux
    ,
    Rocky

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'puppet-alternatives', '6.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppet-alternatives
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppet-alternatives --version 6.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

puppet/alternatives — version 6.0.0 Sep 18th 2024

puppet-alternatives

Build Status Release Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores puppetmodule.info docs Apache-2.0 License Donated by Camptocamp

Manage alternatives symlinks.

Synopsis

Using puppet resource to inspect alternatives

root@master:~# puppet resource alternatives
alternatives { 'aptitude':
  path => '/usr/bin/aptitude-curses',
}
alternatives { 'awk':
  path => '/usr/bin/mawk',
}
alternatives { 'builtins.7.gz':
  path => '/usr/share/man/man7/bash-builtins.7.gz',
}
alternatives { 'c++':
  path => '/usr/bin/g++',
}
alternatives { 'c89':
  path => '/usr/bin/c89-gcc',
}
alternatives { 'c99':
  path => '/usr/bin/c99-gcc',
}
alternatives { 'cc':
  path => '/usr/bin/gcc',
}

Using puppet resource to update an alternative

root@master:~# puppet resource alternatives editor
alternatives { 'editor':
  path => '/bin/nano',
}
root@master:~# puppet resource alternatives editor path=/usr/bin/vim.tiny
notice: /Alternatives[editor]/path: path changed '/bin/nano' to '/usr/bin/vim.tiny'
alternatives { 'editor':
  path => '/usr/bin/vim.tiny',
}

Using the alternatives resource in a manifest:

class ruby_193 {

  package { 'ruby1.9.3':
    ensure => present,
  }

  # Will also update gem, irb, rdoc, rake, etc.
  alternatives { 'ruby':
    path    => '/usr/bin/ruby1.9.3',
    require => Package['ruby1.9.3'],
  }
}

include ruby_193

Creating a new alternative entry:

alternative_entry { '/usr/bin/gcc-4.4':
  ensure   => present,
  altlink  => '/usr/bin/gcc',
  altname  => 'gcc',
  priority => 10,
  require  => Package['gcc-4.4-multilib'],
}

On RedHat, configuring an alternative using a family instead of a full path:

alternatives { 'java':
  path    => 'java-1.8.0-openjdk.x86_64',
  require => Package['java-1.8.0-openjdk'],
}

This module should work on any Debian and RHEL based distribution.

Transfer notice

This module was formerly maintained by Adrien Thebo at forge.puppet.com/adrien/alternatives/

Contact