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, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 4.0.0 < 7.0.0
Start using this module
Add this module to your Puppetfile:
mod 'smash-ganeti', '1.0.5'
Learn more about managing modules with a PuppetfileDocumentation
Ganeti Puppet support
Description
The ganeti
module installs and configures packages to configure a
Ganeti cluster.
Setup
This module does not initialize a cluster or add nodes, which are
expected to be pre-installed in the cluster. However, it will properly
prepare nodes with the right software to do so. So normally, you
should only have to run gnt-cluster init
on the master and gnt-node add
for each secondary node.
Requires the camptocamp/kmod
module in order to load the right
kernel modules when the module is configured with_drbd
.
Usage
The main ganeti
class handles most of the work:
include ganeti
It sets up ganeti packages and also deploys a few set of custom hooks
to make gnt-instance-debootstrap
work properly. Extra hooks can be
deployed manually in /etc/ganeti/instance-debootstrap/hooks/
as
needed. The debootstrap configuration can be modified through the
bootstrap_defaults
parameter. This, for example, will add extra
pacakges to every install:
class { ganeti :
debootstrap_defaults => {
extra_packages => ['linux-image-amd64', 'dbus', 'libpam-systemd'],
}
}
Creating a swap partition at instance creation
If you are using ganeti-instance-debootstrap
to provision the base install
for your instances, this module provides a hook that will help you setup a
disk as a swap partition upon instance creation.
To achieve this, you need to label (name) one of the disk as "swap", as in the following example:
gnt-instance add -d -o debootstrap+bullseye -t plain \
--disk 0:size=14G --disk 1:size=1G,name=swap
instance1.example.com
Here, we have one disk of 1Gb that's named "swap": this will be used as swap space automatically. The other disk will be used as the main disk to install the system on.
Reference
See [REFERENCE.md][] for full reference documentation. Note that this file is generally only generated when a tag is added.
The full online reference documentation for this module may be found at on GitLab Pages. This online reference is generated automatically on each new commit.
Alternatively, you may build yourself the documentation using the
puppet strings generate
command. See the documentation for
Puppet Strings for more information.
Limitations
Tested on Debian stretch, buster, and bullseye. Compatibility with other versions and distributions unknown.
Development
Developed and maintained by the shared puppet modules group.
Reference
Table of Contents
Classes
Public Classes
ganeti
: Configure a drbd node serverganeti::nagios_checks
: Deploy optional nagios check scripts for ganeti
Private Classes
ganeti::config
: Setup files and other resources for a ganeti nodeganeti::package
: Install packages required for a ganeti nodeganeti::service
: Make sure that the ganeti services are running.
Classes
ganeti
Configure a drbd node server
Parameters
The following parameters are available in the ganeti
class.
with_drbd
Data type: Boolean
Set this to false to disable installing drbd on the node.
Default value: true
security_model
Data type: Optional[Enum['pool']]
If set to 'pool', will create a number of non-privileged users that ganeti will use to run instances with. This is mostly useful when using the kvm backend.
Default value: 'pool'
pool_uid_base
Data type: Integer
When security_model is set to 'pool', users that get created will start with this uid and all additional ones will have uids incremented from this number.
Default value: 4000
pool_num_users
Data type: Integer
When security_model is set to 'pool', number of users with sequential uids that will get created for the pool.
Default value: 20
pool_username_prefix
Data type: String[1]
When security_model is set to 'pool', users that get created will have a username that starts with this string. Names will then be completed with the increment on the uid_base, starting at 0, appended to the prefix.
Default value: 'ganeti'
private_ip
Data type: Optional[Stdlib::IP::Address]
IP address configured on the node that is not facing a public network. It is strongly recommended to configure nodes to have a second interface that is part of a network that's not reachable through a public network. This makes it possible to hide away ganeti commands, drbd replication traffic and other sensitive information. This module will also configure ganeti services to listen only to the private IP, if provided. See this post for more information on how that can be configured: https://groups.google.com/forum/#!searchin/ganeti/secondary$20ip|sort:date/ganeti/XBRWU7LwA6g/QnxpAo5HAQAJ
Default value: undef
purge_instance_debootstrap
Data type: Boolean
By default, this module removes all unknown configuration in the ganeti-instance-debootstrap package creation template so that instances created are using a known configuration. Set this value to false in order to disable purging of the hooks directory.
Default value: true
debootstrap_defaults
Data type: Ganeti::Debootstrap_config
Set of configuration options that define the default behaviour for
instances created with ganeti-instance-debootstrap. The values in this hash
correspond to values in /etc/default/ganeti-instance-debootstrap. Refer to
types/debootstrap_config.pp
to see all of the available options and their
expected data types.
- proxy: if set, configure apt to use a proxy when downloading packages
- mirror: URL of the debian apt source used to retrieve packages
- arch: if set, will install instances with a different architecture than the host
- suite: if set, define the default suite used by debootstrap
- extra_packages: list of packages to have debootstrap install on top of the requested suite
- components: if set, define the suite components used by debootstrap (e.g. "main,contrib,non-free")
- customize_dir: absolute path to a directory containing hooks run after debootstrap is done
- generate_cache: set to 'no' to disable package cache for debootstrap
- clean_cache: number of days during which packages are kept in cache
- partition_style: set to 'none' to avoid creating a partition table on devices joined to an instance
- partition_alignment: alignment of the partitions in sectors
Default value: {}
debootstrap_variants
Data type: Hash[String, Ganeti::Variant]
Hash of definitions for debootstrapt variants that are defined on the cluster. Each value should be a struct with any of the required values set (see the type alias Ganeti::Variant for a complete list of available values). An empty list will create an empty configuration file, which means that all default values will be used.
debootstrap_puppet_hook
Data type: Boolean
Set this to true
to install puppet inside instances when they are
installed with instance-debootstrap. Make sure to also set
debootstrap_puppet_server
.
Default value: false
debootstrap_puppet_server
Data type: Optional[Stdlib::Host]
Hostname or IP address of the puppet server to which the instances should
connect to. This value is only used when debootstrap_puppet_hook is set to
true
.
Default value: undef
debootstrap_locale
Data type: Optional[String[1]]
Name of the default locale that will be configured in the new instances
when they get created by the debootstrap template. If set to undef
(default), locale will be untouched and no hook script for setting the
locale will be installed. This should be something legal in the
locales
package, for example en_US or en_US.UTF-8, as
(currently) defined in /var/lib/dpkg/info/locales.config.
Default value: undef
debootstrap_charmap
Data type: String[1]
Name of the character map (should correspond to the name of a file in /usr/share/i18n/charmaps) used by the default locale configured in new instances. This value is unused if debootstrap_locale is set to undef.
Default value: 'UTF-8'
ganeti::nagios_checks
If you include this class, make sure to order it after install of nagios-plugins-basic. Otherwise, the plugin directory will not exist.
Dependencies
- puppetlabs/stdlib (>= 4.6.0 < 7.0.0)
- camptocamp/kmod (>= 2.2.0 < 3.0.0)