Skip to content

Manages installation of packages from GNU Build System from Puppet - In short, uses configure and make

License

Notifications You must be signed in to change notification settings

EmersonPrado/gnu_build_system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gnu_build_system

Table of Contents

  1. Description
  2. Setup - The basics of getting started with gnu_build_system
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Description

Manages packages created in the GNU Build System with Puppet. That is: install stuff by the good old ./configure and make <target> sequence.

This module aims to replace a tedious series of execs needed if one is managing packages from "tarballs" and such.

Still uses exec resource. I hope to get it right and have custom types in the future.

Be advised that this kind of installation is considered a Bad Thing when using a configuration manager like Puppet. See here, here and here for some opinions. Use this module as a last resort.

Setup

What gnu_build_system affects

  • Installs gcc and make packages. By gcc packages, it means the whole set of packages required for compilation in your OS.
  • Compiles and installs whatever unpacked package you run these commands on

Setup Requirements

  • OS
    • RedHat 5, 6 and 7 and derivatives
    • Debian 6 and 7 and derivatives
  • Packages
    • Puppet >= 3.8.7 < 4.0.0
    • ruby
  • Modules

Recommended module: puppet/archive - downloads and extracts compressed files, including tarballs

Beginning with gnu_build_system

The very basic steps needed for a user to get the module up and running. This can include setup steps, if necessary, or it can be an example of the most basic use of the module.

Usage

Installing gcc and make

Just including the main class will suffice for most cases:

include gnu_build_system

If you need to manage only gcc or make, as opposed to both packages, use _manage parameter to disable management of the other package:

class { 'gnu_build_system':
  gcc_manage  => false, # Or
  make_manage => false,
}

To manage packages other than the defaults, use _package(s) parameters:

class { 'gnu_build_system':
  gcc_packages => ['<Package 1>', '<Package 2>'...], # And/or
  make_package => '<Alternative make>',
}

For information on default packages, pls see gcc and make modules

Running './configure'

Declare the defined type gnu_build_system::configure, specifying the directory where the configure script is located and optional parameters.

If you just want to run ./configure, without setting options or variables, and with the same user and group which runs the Puppet agent, only the path is needed:

gnu_build_system::configure { '<Directory>': }

Or

gnu_build_system::configure { '<Unique name>':
  path => '<Directory>',
}

To pass custom options and/or variables to ./configure, just include 'opts' and/or 'vars' parameters as arrays:

gnu_build_system::configure { '<Unique name>':
  path => '<Directory>',
  opts => ['<Option 1>', '<Option 2>'...],
  vars => ['<Variable 1>=<Value>', '<Variable 2>=<Value>'...],
}

To run ./configure with different user and/or group, just user 'user' and/or 'group' parameters:

gnu_build_system::configure { '<Unique name>':
  path  => '<Directory>',
  user  => '<User>',
  group => '<Group>',
}

Running 'make'

Declare the defined type gnu_build_system::make, specifying the directory where the Makefile is located and optional parameters.

If you just want to run make, without setting options or a target, and with the same user and group which runs the Puppet agent, only the path is needed:

gnu_build_system::make { '<Unique name>':
  path => '<Directory>',
}

To pass custom options and/or a target (like 'install' or 'check') to make, just include 'opts' and/or 'target' parameters. The 'opts' parameter should be passed as an array:

gnu_build_system::make { '<Unique name>':
  path   => '<Directory>',
  opts   => ['<Option 1>', '<Option 2>'...],
  target => '<Target>',
}

To run make with different user and/or group, just user 'user' and/or 'group' parameters:

gnu_build_system::make { '<Unique name>':
  path  => '<Directory>',
  user  => '<User>',
  group => '<Group>',
}

Reference

class gnu_build_system

Parameter Description Type Default
gcc_manage Whether to install gcc packages Boolean true
gcc_packages Alternative list of compiler packages Array undef*
make_manage Whether to install make package Boolean true
make_package Alternative make package String undef*

* - Uses typical OS packages, determined by make module

Defined type gnu_build_system::configure

Parameter Description Type Default
path Directory where to run ./configure String Resource title
opts Command-line options for ./configure Array None
vars Command-line variables for ./configure Array None
user User for ./configure execution String User running Puppet
group Group for ./configure execution String Group running Puppet

Defined type gnu_build_system::make

Parameter Description Type Default
path Directory where to run make String Required
opts Command-line options for make Array None
target make target String None
creates Target file to check before execution String None (don't check)
user User for make execution String User running Puppet
group Group for make execution String Group running Puppet

Limitations

This module is intended to run in any GNU Build System compatible Linux, but was tested in very few situations.

There is no input validation yet.

Target files timestamp checking is still done in only one file.

Development

Pls follow general guidelines from Puppet Forge and Puppet language style guide. Pls also run any changed code thru tools like puppet parser validate and puppet-lint and, of course, test the code.

Contributors

The list of contributors can be found here

About

Manages installation of packages from GNU Build System from Puppet - In short, uses configure and make

Resources

License

Stars

Watchers

Forks

Packages

No packages published