Forge Home

alternatives

Maintain symbolic links determining default commands

2,033,488 downloads

2,132 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

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 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
  • , , , , , , ,

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