Version information
This version is compatible with:
- Puppet Enterprise 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, 2016.4.x
- Puppet >= 4.10.0 < 7.0.0
- MocaccinoOS
Tasks:
- cleanup
- update
Start using this module
Add this module to your Puppetfile:
mod 'optiz0r-luet', '0.2.0'
Learn more about managing modules with a PuppetfileDocumentation
luet
Table of Contents
- Description
- Setup - The basics of getting started with luet
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
This module provides providers for managing repositories and packages on systems using the luet package manager.
Setup
What luet affects
This module can manage installation of the luet package manager on both systems where luet is made available via native packages, or any other system via manual installation.
It can be used to install/remove packages using the luet package manager, and luet repositories (which are themselves managed via packages).
Setup requirements
Install this module using your Puppetfile
or puppet module tool
.
This module has very modest dependencies which will very likely be preinstalled on your system anyway.
Beginning with luet
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
Include usage examples for common use cases in the Usage section. Show your users how to use your module to solve problems, and be sure to include code examples. Include three to five examples of the most important or common tasks a user can accomplish with your module. Show users how to accomplish more complex tasks that involve different types, classes, and functions working in tandem.
Installing luet
If luet is not already installed this module can install it for you. This is
not enabled by default and must be explicitly requested. If luet is packaged
for your operating system, you can install it by setting the install_method
to
repo
. If luet is not packaged, it can still be installed using the install
script from the mocaccino website using install_method
set to source
.
# Install from a repository using your OS default package manager
class { 'luet':
manage_install => true,
install_method => 'repo',
}
# Install from mocaccino website
class { 'luet':
manage_install => true,
install_method => 'source',
}
Where you are managing the installation of luet yourself, or it comes pre-installed for example on a MocaccinoOS system, you can use luet simply with the following.
include luet
Migrating from another supported package manager
Luet has support from migrating the list of installed packages from other package managers to aid in migration. At the moment, the only supported system by both luet and this module is Sabayon's Entropy package manager.
You can migrate from entropy to luet using one of the following methods.
When installing luet, specify the migrate_from
parameter:
class { 'luet':
manage_install => true,
migrate_from => ['entropy'],
}
Alternatively you can include the relevant migration class directly. This method might be more suitable if you're using an ENC, or including classes from hiera.
include luet::migrate::entropy
This module will ensure that migration is done before any packages are
installed when the luet
provider is specified explicitly. If you are not
specifying a provider and rely on the OS autodetection to select the luet
provider, you might want to make package installations depend on
Class['luet::ready']
to prevent packages being installed before the
migration is run.
Enabling luet repositories
For official luet repositories which are listed in the default
repository index shipped with luet, you can install these using the
puppet package
resource. These packages use the repository
category,
so you can install them like this:
package { 'mocaccino-portage-stable':
ensure => present,
category => 'repository',
name => 'mocaccino-portage-stable';
}
Installing packages using luet
package { 'foo':
ensure => installed,
provider => 'luet',
# As an example, this package might require the above repository to be installed first
require => Package['mocaccino-portage-stable'];
}
This module will suggest luet as the default package manager where luet is the
primary package manager, e.g. on MocaccinoOS
.
You can explicitly set the luet provider to be used when installing a package, as shown above.
Development
Both this module and luet itself are under under development and functionality may be limited. Pull requests to extend or enhance the module are welcome.
Reference
Table of Contents
Classes
Public Classes
luet
: Manages the luet package managerluet::migrate::entropy
: Migrates an entropy system to luetluet::ready
: Anchor class used for delaying resources until luet is ready for use
Private Classes
luet::install
: Handles the installation of luet itself
Data types
Luet::InstallMethod
: Defines the available installation methods for luetLuet::MigrateBackend
: Defines the types of package manager luet supports migrations from
Tasks
cleanup
: Runluet cleanup
on target nodes to free up disk space used by downloaded packagesupdate
: Runluet repo update
on target nodes to refresh repository definitions
Classes
luet
Manages the luet package manager
Examples
Install from existing systems package manager
class { 'luet':
manage_install => true,
install_method => 'repo',
}
Install from MocaccinoOS website
class { 'luet':
manage_install => true,
install_method => 'source',
}
Use with pre-installed luet
include luet
Migrate system from Entropy to Luet
# Via luet class
class { 'luet':
migrate_from => ['entropy']
}
# Or by explicitly including the entropy migration class
include luet::migrate::entropy
Parameters
The following parameters are available in the luet
class.
manage_install
Data type: Boolean
Defines whether this module should attempt to install the luet package manager
Default value: false
install_method
Data type: Luet::InstallMethod
Defines how luet should be installed
Default value: 'repo'
package_name
Data type: String
Name of the luet package when installed using repo
method
Default value: 'luet'
package_ensure
Data type: String
Ensure for the luet package when installed using the repo
method
Default value: 'installed'
migrate_from
Data type: Array[Luet::MigrateBackend]
A lit of package managers which luet should migrate from
Default value: []
luet::migrate::entropy
This class runs the luet migrate-entropy
command once to reflect
that the contents of the entropy package database are installed
within the luet package database.
This class should be included in the catalog for systems you want to be migrated to luet.
luet::ready
This class can be used as a dependency on other resources in the catalog which should be delayed until after luet is ready for use.
This class is not complete until luet has been installed (if installation is being managed by this class), and all enabled migrations have been completed.
This will prevent, for example, luet packages being installed and overwriting the content of packages already installed via the previous package manager, before the migration into the luet database has been done.
- Note Any package resource which specifies the
luet
provider will automatically depend on theluet::ready
class. This construct is only needed where a provider is not explicitly set. When the provider is not set, the default provider is resolved by the agent at catalog application time, so it's not possible to know at compilation time which provider is going to be used.
Examples
Delay installation of a specific package until Luet is ready
package { 'htop':
ensure => present,
category => 'sys-process',
require => Class['luet::ready']
}
Configure all packages on a system to use luet when ready
# in manifests/site.pp
if $operatingsystem == 'MocaccinoOS' {
Package {
provider => 'luet',
require => Class['luet::ready'],
}
}
Data types
Luet::InstallMethod
Defines the available installation methods for luet
Alias of Enum['repo', 'source']
Luet::MigrateBackend
Defines the types of package manager luet supports migrations from
Alias of Enum['entropy']
Tasks
cleanup
Run luet cleanup
on target nodes to free up disk space used by downloaded packages
Supports noop? false
update
Run luet repo update
on target nodes to refresh repository definitions
Supports noop? false
Parameters
repo
Data type: Optional[Pattern[/^[a-zA-Z0-9._-]+$/]]
Restrict update to only this named repository
What are tasks?
Modules can contain tasks that take action outside of a desired state managed by Puppet. It’s perfect for troubleshooting or deploying one-off changes, distributing scripts to run across your infrastructure, or automating changes that need to happen in a particular order as part of an application deployment.
Tasks in this module release
cleanup
Run `luet cleanup` on target nodes to free up disk space used by downloaded packages
Changelog
All notable changes to this project will be documented in this file.
Release 0.2.0 (2020-11-27)
Added
- Support for migrating from Entropy systems to Luet
- Support for customising the package name/ensure when installing from
repo
luet::cleanup
andluet::update
tasks- Reference documentation
Changed
luet::install
class is now only included if luet is being installed by module
Release 0.1.0 (2020-11-26)
Initial version
Features
- Add support for installing luet package manager
- Add luet package provider