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 'stm-debconf', '6.1.0'
Learn more about managing modules with a PuppetfileDocumentation
debconf
Table of Contents
- Overview
- Module Description - What does the module do?
- Setup - The basics of getting started with debconf
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Overview
Manage entries in the Debian debconf database.
Module Description
Debian based systems use the debconf database to record configuration choices the user made during the installation of a package. The system uses the stored answers and therefore does not need to query the user again when the package is upgraded or reinstalled at a later time.
The debconf type allows preseeding the database with given answers to allow an unattended package installation or modification of package defaults. The type can optionally also manage the seen flag for an item.
The standard package
type uses the responsefile parameter to provide a file with preseeded answers during installation. The debconf
type is a more general solution as it allows to update settings without the need to install the package at the same time.
Setup
What debconf affects
The debconf type modifies entries in the Debian debconf database.
Setup Requirements
This module uses programs provided by the Debian/Ubuntu debconf
package. Debian assigns the required
priority to this package so it should already be installed everywhere.
Usage
Use debconf-show
or debconf-get-selections
to find out about valid debconf entries for an installed package.
Example: Use dash as replacement for the bourne shell
This entry will ensure a symlink from /bin/sh
to /bin/dash
if dpkg-reconfigure dash
is run the next time. It will also mark the question as seen to prevent the installer from asking this question during the installation.
debconf { 'dash/sh':
type => 'boolean',
value => 'true',
seen => true,
}
Note: Although this code is perfectly legal Puppet code, the string 'true'
(not the boolean true
) will trigger the puppet-lint warning quoted_booleans
. But we really want to use the string 'true'
and not the boolean truth value here. So in this case we can easily suppress the warning with a control comment:
debconf { 'dash/sh':
type => 'boolean',
value => 'true', # lint:ignore:quoted_booleans
seen => true,
}
Example: Automatically set a root password for MySQL during installation
These two resources preseed the installation of the mysql-server-5.5
package with the password for the MySQL root user to use. The password has to be set twice because the installation dialog asks two times for the password to detect typos. This password is used if the package is installed after these resources have been created.
debconf { 'mysql-root-passwd':
package => 'mysql-server-5.5',
item => 'mysql-server/root_password',
type => 'password',
value => 'secret',
seen => true,
}
debconf { 'mysql-root-passwd-again':
package => 'mysql-server-5.5',
item => 'mysql-server/root_password_again',
type => 'password',
value => 'secret',
seen => true,
}
Reference
See REFERENCE.md
This module is only useful on Debian based systems where the debconf database is used.
A control comment may be needed to suppress puppet-lint warnings when you set boolean values. See the Usage section for an example.
The value of the type
parameter is only used when an item is created. It is not updated if the value of the item is changed later.
Development
Feel free to send pull requests for new features.
Reference
Table of Contents
Resource types
debconf
: Manage debconf database entries on Debian based systems.
Resource types
debconf
This type can either set or remove a value for a debconf database
entry. It uses multiple programs from the debconf
package.
Examples
Set a select value
debconf { 'tzdata/Areas':
type => 'select',
value => 'Europe',
}
Set a boolean value
debconf { 'dash/sh':
type => 'boolean',
value => 'true',
}
Set a boolean value in a specified package and mark as seen
debconf { 'libraries/restart-without-asking':
package => 'libc6',
type => 'boolean',
value => 'true',
seen => true,
}
Properties
The following properties are available in the debconf
type.
ensure
Valid values: present
, absent
Specifies whether the resource should exist. Setting this to "absent" tells Puppet to remove the debconf entry if it exists, and negates the effect of any other parameters.
Default value: present
seen
Valid values: true
, false
The value of the 'seen' flag. This can be left undefined or be one of the boolean values true or false.
value
Valid values: %r{\S}
The value for the item (e.g. 'Europe').
Parameters
The following parameters are available in the debconf
type.
item
Valid values: %r{^[a-z0-9][a-z0-9:.+-]+\/[a-zA-Z0-9\/_.+-]+$}
The item name. This string must have the following format: the package name, a literal slash char and the name of the question (e.g. 'tzdata/Areas'). The default value is the title of the resource.
name
namevar
The name of the resource. If the parameter 'item' is not set, then this value will be used for it. You can set the same item in different packages by using different names for the resources.
package
Valid values: %r{^[a-z0-9][a-z0-9:.+-]+$}
The package the item belongs to. The default is the first part (up to the first '/') of the item parameter (e.g. 'tzdata').
provider
The specific backend to use for this debconf
resource. You will seldom need to specify this --- Puppet will usually
discover the appropriate provider for your platform.
type
Valid values: string
, boolean
, select
, multiselect
, note
, text
, password
, title
The type of the item. This can only be one of the following values: string, boolean, select, multiselect, note, text, password, title.
2024-08-13 - Release 6.1.0
Features
- Add sensible error message when calling
puppet resource debconf
. - Add Ubuntu-24.04 (Noble) to the list of support operating systems.
2023-07-07 - Release 6.0.0
Features
- Add support for Puppet 8
Breaking changes
- Drop support for Puppet 6
2022-07-27 - Release 5.0.0
Features
- Add Ubuntu 22.04 (Jammy) to the list of supported operating systems.
Breaking changes
- Drop Ubuntu 16.04 support
- Drop Debian 9 support
2021-09-15 - Release 4.1.0
Bugfixes
- Allow multiple resources for the same item in different packages without raising a duplicate resource error.
2021-08-30 - Release 4.0.0
Breaking changes
- Drop Ubuntu 14.04 support
- Drop Debian 8 support
Features
- Add Debian 11 (Bullseye) to the list of supported operating systems.
2021-03-04 - Release 3.3.1
Bugfixes
- Fix
wrong number of arguments
error introduced by Rubocop triggered change.
2021-03-04 - Release 3.3.0
Features
- Add support for Puppet 7.
2020-06-22 - Release 3.2.0
Features
- Add Ubuntu 20.04 (Focal Fossa) to the list of supported operating systems.
- Add Debian 10 (Buster) to the list of supported operating systems.
2019-09-27 - Release 3.0.0
Breaking changes
- Remove support for Puppet 4.
2018-10-14 - Release 2.3.0
Features
- Add support for Puppet 6.
- Remove Debian 7 and Ubuntu 17.10 as supported operating systems.
2018-07-02 - Release 2.2.1
Features
- Add Ubuntu 18.04 (Bionic Beaver) to the list of supported operating systems.
- Convert to Puppet PDK.
2018-05-08 - Release 2.2.0
Features
- The type has a new
seen
parameter to define the value of the seen flag for an item. Setting this parameter to a boolean value will set the flag to the specified value. Leaving this parameter undefined will retain the old behavior.
2018-02-04 - Release 2.1.0
Features
This release removes support for some legacy OS releases.
Bugfixes
- Fix a bug where a pipe to a subprocess was closed too late. This caused a subprocess to become a zombie until the Puppet run finished.
2017-03-10 - Release 2.0.0
Features
- Added Ubuntu 16.10 (Yakkety Yak) to the list of supported operating systems.
Bugfixes
- Added an additional validation for the
type
parameter. This effectively makes the parameter mandatory forensure => present
. The type of the entry is required when the entry is missing in the debconf database and has to be created. - Fix a bug that prevented reading a preseeded password correctly. Previously a password item would trigger a resource update with every Puppet run.
2016-05-13 - Release 1.0.0
Summary
Initial release.
Copyright (c) 2015, Stefan Möding All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.