Giter Club home page Giter Club logo

puppet-alternatives's Introduction

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

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.

Contact

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.