Version information
This version is compatible with:
- Puppet Enterprise >= 3.0.0 < 2015.4.0
- Puppet >= 3.0.0 < 5.0.0
- ,
Start using this module
Add this module to your Puppetfile:
mod 'stm-debconf', '1.0.1'
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 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 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.
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.
debconf { 'dash/sh':
type => 'boolean',
value => 'true',
}
Note: Although this code is perfectly legal Puppet code, the string 'true'
will trigger a warning (quoted_booleans
) using puppet-lint. 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
}
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',
}
debconf { 'mysql-root-passwd-again':
package => 'mysql-server-5.5',
item => 'mysql-server/root_password_again',
type => 'password',
value => 'secret',
}
Reference
Types
Type: debconf
Ensures presence or absence of a debconf database enty on Debian based systems.
Parameters for the debconf
type:
ensure
Ensures whether the resource is present. Valid options: present
, absent
. Default value: present
item
The configuration item to manage. This is normally a string with at least one slash character. Valid options: String. Default: the title of the debconf resource.
package
The name of the package that owns the item. Valid options: String. Default: the prefix of the item parameter up to the first slash character.
type
The data type of the item. Valid options: string, boolean, select, multiselect, note, text, password, title. Default: Undefined.
value
The value to set. Valid options: String. Default: Undefined.
Limitations
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.
Development
Feel free to send pull requests for new features.
Types in this module 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.