Forge Home

apk

Manage packages on Alpine Linux using the APK package manager

41,059 downloads

38,882 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.2.0 (latest)
  • 0.1.0
released Jul 28th 2016
This version is compatible with:
  • Alpine

Start using this module

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

Add this module to your Puppetfile:

mod 'puppetlabs-apk', '0.2.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppetlabs-apk
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppetlabs-apk --version 0.2.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

puppetlabs/apk — version 0.2.0 Jul 28th 2016

Puppet
Forge Build
Status

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with apk
  4. Usage - Configuration options and additional functionality
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Overview

APK is the built-in package manager for Alpine Linux, a tiny Linux distribution built with size, security and correctness in mind.

Module Description

The module allows for managing system packages with Puppet on Alpine Linux, using the APK package manager. Once installed the module works like all other package providers.

Setup

Installation is a simple matter of:

puppet module install puppetlabs-apk

Usage

Using the module can be done by explicitly setting the provider, like so:

package { 'ruby':
  ensure   => installed,
  provider => apk,
}

Note that the provider will only work in cases where the operatingsystem fact is set to Alpine.

Because the new provider is set to be the default package provider for Alpine Linux you actually don't need to specify the provider at all though:

package { 'ruby':
  ensure => installed,
}

It's also possible to pass additional arguments to the underlying apk binary when packages are installed, using the install_options parameter. For instance:

package { 'shadow':
  ensure          => installed,
  install_options => ['--update-cache', '--repository http://dl-3.alpinelinux.org/alpine/edge/testing/', '--allow-untrusted'],
}

You can also ensure packages are not present with ensure => absent and the provider enables puppet resource support on Alpine, so running the following will list all installed packages wit their versions.

puppet resource package

A note on Puppet on Alpine

A native puppet-agent package is not currently available for Alpine, but Puppet can be installed using the system Ruby and the gems package manager. Ruby also requires some additional system packages to function correctly. The following should get you started if you're looking to use Puppet on Alpine.

sudo -s
# required for the shadow package, which is needed for the User resource
echo http://dl-4.alpinelinux.org/alpine/edge/testing/ >> /etc/apk/repositories
apk update
apk add ruby shadow less
gem install puppet --no-ri --no-rdoc

Note as well that the blockdevice facts on Alpine require root permissions, so unless you delete those facts you will need to run facter and puppet with sudo or as root. If you'd rather not do so you can delete the offending facts with the following:

sudo rm /usr/lib/ruby/gems/2.2.0/gems/facter-2.4.6/lib/facter/blockdevices.rb

Todo

The module does not update the package cache, but it would be nice to provide a resource to do so. The module also does not yet provide support for managing APK repositories but that would also be a useful addition. These may be added later, but pull requests would also be galdly accepted.

Limitations

As noted the module does not work on operating systems other than Alpine, but in those cases you probably have a different package manager with a suitable provider. The module is not supported with Puppet Enterprise as Alpine Linux is not a supported platform at this time, and a suitable puppet-agent package is not available.

Maintainers

This module is maintained by: Gareth Rushgrove gareth@puppet.com