Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 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
- Puppet >= 7.0.0 < 9.0.0
- ,
Start using this module
Add this module to your Puppetfile:
mod 'puppet-aptly', '2.1.0'
Learn more about managing modules with a PuppetfileDocumentation
Aptly Puppet Module
aptly
Puppet module for aptly.
Example usage
You need to include the apt
module if you wish to install it
out-of-the-box.
include apt
Include with default parameters:
include aptly
Create a mirror for manual update/snapshot/publish:
aptly::mirror { 'puppetlabs':
location => 'http://apt.puppetlabs.com/',
repos => ['main', 'dependencies'],
key => '4BD6EC30',
}
or with the puppetlabs/apt module 2.0+ format
aptly::mirror { 'puppetlabs':
location => 'http://apt.puppetlabs.com/',
repos => ['main', 'dependencies'],
key => {
server => 'keyserver.ubuntu.com',
id => '4BD6EC30',
}
}
Create an aptly repository to host local packages:
aptly::repo{ 'mylocalrepo': }
See the class and defined type documentation for advanced usage.
License
See LICENSE file.
Transfer Notice
This module was originalle maintained by Government Digital Service (GDS) at github.com/alphagov/puppet-aptly
Reference
Table of Contents
Classes
aptly
: aptly is a swiss army knife for Debian repository managementaptly::api
: Install and configure Aptly's API Service
Defined types
aptly::mirror
: aptly::mirror
Create a mirror using aptly mirror create
. It will not update, snapshot,
or publish the mirror for you, because it will take a long time and it
doesn't make sense to schedule these actions frequenly in Puppet.
NB: This will not recreate the mirror if the params change! You will need
to manually aptly mirror drop <name>
after also dropping all snapshot
and publish references.
aptly::repo
: aptly::repo
Create a repository using aptly create
. It will not snapshot, or update the
repository for you, because it will take a long time and it doesn't make sense
to schedule these actions frequently in Puppet.
aptly::snapshot
: Create a snapshot usingaptly snapshot
.
Classes
aptly
aptly is a swiss army knife for Debian repository management
Parameters
The following parameters are available in the aptly
class:
package_ensure
Data type: String
Ensure parameter to pass to the package resource.
Default value: 'present'
config_file
Data type: Stdlib::Absolutepath
Absolute path to the configuration file. Defaults to
Default value: '/etc/aptly.conf'
config_contents
Data type: Optional[String]
Contents of the config file.
Default value: undef
config
Data type: Hash
Hash of configuration options for /etc/aptly.conf
. See http://www.aptly.info/#configuration
Default value: {}
repo
Data type: Boolean
Whether to configure an apt::source for repo.aptly.info
. You might want to disable this when you've mirrored that yourself.
Default value: true
key_server
Data type: String
Key server to use when $repo
is true.
Default value: 'keyserver.ubuntu.com'
user
Data type: String
The user to use when performing an aptly command
Default value: 'root'
aptly_repos
Data type: Hash
Hash of aptly repos which is passed to aptly::repo
Default value: {}
aptly_mirrors
Data type: Hash
Hash of aptly mirrors which is passed to aptly::mirror
Default value: {}
aptly::api
Install and configure Aptly's API Service
Parameters
The following parameters are available in the aptly::api
class:
ensure
Data type: Enum['stopped','running']
Ensure to pass on to service type
Default value: running
user
Data type: String[1]
User to run the service as.
Default value: 'root'
group
Data type: String[1]
Group to run the service as.
Default value: 'root'
listen
Data type: Pattern['^([0-9.]*:[0-9]+$|unix:)']
What IP/port to listen on for API requests.
Default value: ':8080'
log
Data type: Enum['none','log']
Enable or disable Upstart logging.
Default value: 'none'
enable_cli_and_http
Data type: Boolean
Enable concurrent use of command line (CLI) and HTTP APIs with the same Aptly root.
Default value: false
Defined types
aptly::mirror
aptly::mirror
Create a mirror using aptly mirror create
. It will not update, snapshot,
or publish the mirror for you, because it will take a long time and it
doesn't make sense to schedule these actions frequenly in Puppet.
NB: This will not recreate the mirror if the params change! You will need
to manually aptly mirror drop <name>
after also dropping all snapshot
and publish references.
Parameters
The following parameters are available in the aptly::mirror
defined type:
location
key
filter
release
repos
architectures
with_sources
with_udebs
filter_with_deps
environment
keyring
location
Data type: String
URL of the APT repo.
key
Data type: Variant[String[1], Hash[String[1],Variant[Array,Integer[1],String[1]]]]
This can either be a key id or a hash including key options. If using a hash, key => { 'id' => } must be specified
Default value: {}
filter
Data type: Optional[String[1]]
Package query that is applied to packages in the mirror
Default value: undef
release
Data type: String
Distribution to mirror for.
Default value: $facts['os']['distro']['codename']
repos
Data type: Array
Components to mirror. If an empty array then aptly will default to mirroring all components.
Default value: []
architectures
Data type: Array
Architectures to mirror. If attribute is ommited Aptly will mirror all available architectures.
Default value: []
with_sources
Data type: Boolean
Boolean to control whether Aptly should download source packages in addition to binary packages.
Default value: false
with_udebs
Data type: Boolean
Boolean to control whether Aptly should also download .udeb packages.
Default value: false
filter_with_deps
Data type: Boolean
Boolean to control whether when filtering to include dependencies of matching packages as well
Default value: false
environment
Data type: Array
Optional environment variables to pass to the exec. Example: ['http_proxy=http://127.0.0.2:3128']
Default value: []
keyring
Data type: String
path to the keyring used by aptly
Default value: '/etc/apt/trusted.gpg'
aptly::repo
aptly::repo
Create a repository using aptly create
. It will not snapshot, or update the
repository for you, because it will take a long time and it doesn't make sense
to schedule these actions frequently in Puppet.
Parameters
The following parameters are available in the aptly::repo
defined type:
architectures
Data type: Array
Specify the list of supported architectures as an Array. If ommited Aptly assumes the repository.
Default value: []
comment
Data type: Optional[String[1]]
Specifiy a comment to be set for the repository.
Default value: undef
component
Data type: Optional[String[1]]
Specify which component to put the package in. This option will only works for aptly version >= 0.5.0.
Default value: undef
distribution
Data type: Optional[String[1]]
Specify the default distribution to be used when publishing this repository.
Default value: undef
aptly::snapshot
Create a snapshot using aptly snapshot
.
Parameters
The following parameters are available in the aptly::snapshot
defined type:
repo
Data type: Optional[String[1]]
Create snapshot from given repo.
Default value: undef
mirror
Data type: Optional[String[1]]
Create snapshot from given mirror.
Default value: undef
Changelog
All notable changes to this project will be documented in this file. Each new release typically also includes the latest modulesync defaults. These should not affect the functionality of the module.
v2.1.0 (2024-02-27)
Implemented enhancements:
- Add puppet-strings documentation #22 (bastelfreak)
v2.0.0 (2024-02-27)
Breaking changes:
- puppetlabs/apt: Require 9.x #15 (bastelfreak)
- Drop Ubuntu 12/14/16 support #11 (bastelfreak)
- Drop Puppet \< 7 support; Add Puppet 8 support #10 (bastelfreak)
- puppetlabs/stdlib: Require 9.x #7 (bastelfreak)
Implemented enhancements:
- Add Debian 11/12 support #20 (bastelfreak)
- Add basic acceptance tests #16 (bastelfreak)
- Add Ubuntu 20.04/22.04 support #12 (bastelfreak)
- mirror: param filter: default to undef #5 (bastelfreak)
- replace legacy is_array/is_string with native datatype checks #4 (bastelfreak)
- replace legacy validate_* functions with native datatypes #2 (bastelfreak)
Fixed bugs:
- mirror: use proper $PATH for exec resource #19 (bastelfreak)
- Update repo.aptly.info gpg key #17 (bastelfreak)
Merged pull requests:
- Add acceptance test for aptly::mirror #18 (bastelfreak)
- rubocop: autocorrect #14 (bastelfreak)
- README.md/CHANGELOG.md: Purge trailing whitespace #9 (bastelfreak)
- repo: parameters: default to undef #6 (bastelfreak)
- replace deprecated is_hash with native datatype check #3 (bastelfreak)
v1.0.0 (2019-01-28)
- Convertion to PDK
- Update Aptly repositories keys
- More validation
- Support of the puppetlabs/apt module (version 2.0+) format of keys:
aptly::mirror::keyserver
has been removedaptly::mirror::key
is now a string containing the key id or a hash (see example in Readme)
2017-08-11 Release 0.9.0
- Add support for running on systemd based systems. Thanks to @zipkid for the code and tests!
2016-09-09 Release 0.8.0
- Add
filter
parameter (Thanks @trevorrea) - Add
filter_with_deps
parameter (Thanks @trevorrea) - Modified travis config to run tests with puppet 4.6
2016-06-14 Release 0.7.0
- Add
environment
parameter (thanks @zipkid)
2016-06-03 Release 0.6.0
- Support Ruby 2.1.0 and 2.2.0
- Support Puppet 3.8
- Stop testing Puppet 3.1, 3.2, 3.6 and 3.7
- Ensure that
apt::update
runs before installing aptly - Add parameter for
-no-lock
option - Update the aptly repository's GPG key
2016-02-26 Release 0.5.0
- Update support for puppetlabs/apt from version 1-2 to version 2-3 (thanks @zxjinn)
- Do not run an exec to add a GPG key in
aptly::mirror
if no GPG key is provided (thanks @antonio)
2015-12-04 Release 0.4.0
- Drop support for Puppet 2.7 and for Puppet 3.1 but only on Ruby 2
- Start running tests against Puppet 3.6 and 3.7
- Add a defined type
aptly::snapshot
to create Aptly snapshots (thanks @mklette) - Add
$architectures
,$with_sources
and$with_udebs
parameters toaptly::mirror
(thanks @mklette and @dw-thomast) - Add
$architectures
,$comment
and$distribution
parameters toaptly::repo
(thanks @mklette) - Add
$config_file
and$config_contents
parameters toaptly
class to allow changing the location on disk and contents of the config file (thanks @mklette and @antonio) - Allow an
aptly::mirror
to have more than one key (thanks @dw-thomast) - Use full 40 character key for
repo.aptly.info
as short fingerprints are susceptible to collision attacks (thanks @amosshapira) - Fix type check of
$key
inaptly::mirror
(thanks @sw0x2A) - Fix comment in
aptly::mirror
(thanks @zeysh)
2015-04-23 Release 0.3.0
- Add an
aptly::api
class for configuring aptly's API service. - Add support for specifying repos and mirrors in hieradata.
- Convert Modulefile to metadata.json
- Bugfix: use absolute references to
::aptly
class to prevent a dependency cycle.
2014-06-26 Release 0.2.0
- Add
user
param to parent class for the user thataptly::mirror
andaptly::repo
commands are run as. - Add
key_server
param to parent class for the key server to use when verifying aptly's own repo. - Add
key_server
param toaptly::mirror
so that you can specify a different hostname or protocol. - All defaults match the behaviour of previous versions.
2014-05-16 Release 0.1.1
- Transfer to gds-operations and release to Forge.
- No functional changes.
2014-05-15 Release 0.1.0
- Remove support for Ruby 1.8
- Add
package_ensure
param so that you can specify a version - aptly::repo for creating local repos
2014-03-31 Release 0.0.1
- First release
- Basic install and config
- aptly::mirror for creating mirror entries
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/stdlib (>= 9.0.0 < 10.0.0)
- puppetlabs/apt (>= 9.0.0 < 10.0.0)
The MIT License (MIT) Copyright (c) 2014 Government Digital Service Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.