Version information
This version is compatible with:
- Puppet Enterprise 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, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 4.0.0 < 8.0.0
- , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'qtechnologies-perlbrew', '1.0.0'
Learn more about managing modules with a PuppetfileDocumentation
Puppet perlbrew Module
Table of Contents
Overview
Manages perlbrew
based Perl5 installations
Description
This is a puppet module for basic management of
perlbrew
based Perl5 installations. It is designed to manage a single instance
of perlbrew (which can have multiple versions of perl installed into it).
Usage
See the REFERENCE.md file for a complete reference.
Examples
Hiera
It can be fully implement in Hiera like this:
classes:
- perlbrew
perlbrew::versions::install:
- 5.32.1
- 5.36.0
perlbrew::versions::purge_builds: true
perlbrew::modules::install:
5.32.1:
- Module::Build
5.36.0:
- Module::Build
- String::ShortHostname
Puppet code
Th class can be invoked via code, but it's still designed to be configured via Hiera, the versions and modules installed are still best specified through Hiera.
class { 'perlbrew':
install_root => /usr/local/perlbrew,
owner => 'perl',
group => 'perl',
create_user => true,
rc_files => ['/etc/profile.d/perlbrew.sh'],
}
Limitations
At present, this module is only capable of supporting one perlbrew installation per system. Let me
if there is a use case for multiple installs. I'm thinking with the advent of containers, really unique
requirements as better addressed by them. Individual users can still have there own modules installed
via local::lib
and their desired perl version set while the perl versions are updated for the whole host.
Tested Platforms
- openSUSE 15.4 (should work on any *NIX environment though)
Versioning
This module is versioned according to the Semantic Versioning 2.0.0 specification.
Support
Please log tickets and issues at github
See Also
Reference
Table of Contents
Classes
perlbrew
: Installs perlbrew, perls and perl modulesperlbrew::modules
: Installs perl modules into specified perlbrew perls. It is called from the perlbrew class, so it just needs hiera data to configure it. cpanm does the install of the modules.perlbrew::versions
: Installs specified perls into perlbrew
Classes
perlbrew
== class perlbrew
Examples
Basic usage
class { 'perlbrew':
install_root => /usr/local/perlbrew,
owner => 'perl',
group => 'perl',
create_user => true,
rc_files => ['/etc/profile.d/perlbrew.sh'],
}
Parameters
The following parameters are available in the perlbrew
class:
install_root
Data type: String
Directory to install the perlbrew installation, defaults to '/opt/perlbrew'
owner
Data type: String
Owner of the perlbrew files, defaults to 'perlbrew'
group
Data type: String
Group of the perlbrew files, defaults to 'perlbrew'
set_perms
Data type: Boolean
Whether to set the install_root to these perms, defaults to true
create_user
Data type: Boolean
Whether to create the system user of these perms, defaults to true
rc_files
Data type: Array[String]
A list of files to source the perlbrew environment from, defaults to ['/etc/profile.d/perlbrew.sh']
prereqs
Data type: Array[String]
Used internally - it's a list of binaries to check for for this class to work.
perlbrew::modules
== Class: perlbrew::modules
Examples
Example Hiera Data
perlbrew::modules::list:
5.32.1:
- Module::Build
5.36.0:
- Module::Build
- String::ShortHostname
- Dancer2
Parameters
The following parameters are available in the perlbrew::modules
class:
list
Data type: Hash
A list of modules to be installed, specified per perl version installed
build_timeout
Data type: Integer
How long puppet should wait in seconds before it times out the build and install of the module. Defaults to 900 seconds. Just be careful to make sure it is long enough to get all the prereqs as well as they will all be included in the one build timeout unless they are separately specified.
build_flags
Data type: String
The flags to pass to cpanm for the install of the modules, defaults to '--notest'
perlbrew::versions
== Class: perlbrew::versions
Examples
Example Hiera Data
perlbrew::versions::installed:
- 5.32.1
- 5.36.0
Parameters
The following parameters are available in the perlbrew::versions
class:
installed
Data type: Array[String]
A list of versions to be installed
build_timeout
Data type: Integer
How long puppet should wait in seconds before it times out the build and install of the version. Defaults to 900 seconds.
build_flags
Data type: String
The flags to pass to perlbrew for the install of the version, defaults to '--notest -j %{facts.processorcount}'
purge_builds
Data type: Boolean
Whether to purge the temporary build files after the install of the version, defaults to true
Dependencies
- puppetlabs/stdlib (>= 3.2.0 < 9.0.0)
Copyright (C) 2022 Q-Technologies Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.