Forge Home

alternatives

Maintain symbolic links determining default commands

1,896,031 downloads

228 latest version

5.0 quality score

Version information

  • 4.1.0 (latest)
  • 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 May 13th 2022
This version is compatible with:
  • Puppet Enterprise 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x
  • Puppet >= 6.1.0 < 8.0.0
  • , , , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'puppet-alternatives', '4.1.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 4.1.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 4.1.0 May 13th 2022

puppet-alternatives

Build Status Code Coverage Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores

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'],
  }
}

# magic!
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'],
}

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

Contact