Version information
This version is compatible with:
- Puppet Enterprise 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, 2019.8.x
- Puppet >= 6.21.0 < 8.0.0
- , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'jhbigler-vector', '1.0.1'
Learn more about managing modules with a PuppetfileDocumentation
vector
This puppet module installs, configures, and runs the Vector observability tool.
Description
The vector module installs, configures, and runs the Vector observability tool. This module is designed for Redhat and Fedora type systems, and also assumes it uses systemd for managing services.
Setup
Setup Requirements
This module requires puppet-stdlib.
Beginning with vector
This module will not configure yum or apt repositories, those should be configured outside of this module.
Usage
There are two ways to configure topologies:
- Using class parameters
- These can be set with Hiera!
- Using defined types
- Especially useful if your modules need to inject their own vector components
vector::source
to configure a vector sourcevector::transform
to configure a vector transformvector::sink
to configure a vector sinkvector::configfile
to configure a set of sources, transforms, and sinks
You can even use a mix of both of these strategies.
Examples
Using vector::configfile
require vector
vector::configfile { 'vector':
data => {
'sources' => {
'logfiles' => {
'type' => 'file',
'include' => ['/var/log/**/*.log'],
},
},
'sinks' => {
'kafka' => {
'type' => 'kafka',
'inputs' => ['logfiles'],
'bootstrap_servers' => 'localhost:9092',
'encoding' => {
'codec' => 'json',
},
'topic' => 'logs',
},
}
},
}
Using vector::source
, vector::transform
, and vector::sink
Note: 'type' is required for all of these defined types and 'inputs' is required for transform and sink types. Addition configuration parameters for these should be put in the 'parameters' hash.
require vector
vector::source { 'logfile_input':
type => 'file',
parameters => {
'include' => ['/var/log/**/*.log'],
},
}
vector::transform { 'logfile_transform':
type => 'remap',
inputs => ['*'],
parameters => {
'source' => '.foo = "bar"',
},
}
vector::sink { 'logfile_kafka':
type => 'kafka',
inputs => ['logfile_transform'],
parameters => {
'bootstrap_servers' => 'localhost:9092',
'topic' => 'logs',
'encoding' => {
'codec' => 'json',
},
}
}
Using class parameters
class { 'vector':
data_dir => '/data/vector',
sources => {
'logfiles' => {
'type' => 'file',
'parameters' => {
'include' => ['/var/log/**/*.log'],
'read_from' => 'beginning',
},
},
'syslogs' => {
'type' => 'syslog',
'parameters' => {
'mode' => 'tcp',
'address' => '0.0.0.0:514',
},
},
},
sinks => {
'elasticsearch' => {
'type' => 'elasticsearch',
'inputs' => ['logfiles', 'syslogs'],
'parameters' => {
'endpoints' => 'elastic1:9200',
'pipeline' => 'logs',
},
},
},
}
Using Hiera
vector::data_dir: '/data/vector'
vector::sources:
logfiles:
type: file
parameters:
include: ['/var/log/**/*.log']
read_from: beginning
syslogs:
type: syslog
parameters:
mode: tcp
address: '0.0.0.0:514'
vector::sinks:
elasticsearch:
type: elasticsearch
inputs: ['logfiles','syslogs']
parameters:
endpoints: 'elastic1:9200'
pipeline: logs
Reference
See REFERENCE.md
Reference
Table of Contents
Classes
vector
: Vector module for Puppetvector::configure
: Creates configuraton files, and creates systemd files if configured to do sovector::install
: Installs vector, if configured to do sovector::service
: Manages the systemd service for vectorvector::setup
: sets up some directories for configurations to go intovector::user
: Private class that manages the user and group vector runs as
Defined types
vector::configfile
: A type to create a vector config file, composing of sources, transforms, and sinksvector::sink
: Creates a vector sinkvector::source
: Creates a Vector sourcevector::transform
: Creates a Vector transform
Functions
vector::dump_config
: vector::dump_config
Data types
Vector::Enabled
: defines a valid value for the 'enabled' parameter for the vector systemd serviceVector::Ensure
: defines a valid value for the vector systemd service 'ensure' parameterVector::ValidConfigFormat
: defines the valid configuration file extensions for vector
Classes
vector
vector
Installs, configures, then runs the Vector log and metric tool on RedHat and Debian type systems Note - this does not manage the repositories, it is assumed they are already configured
Examples
include vector
class vector {
data_dir => '/data/vector',
install_vector => false,
}
Parameters
The following parameters are available in the vector
class:
version
install_vector
config_dir
data_dir
user
group
manage_user
user_opts
manage_group
group_opts
service_name
manage_systemd
vector_executable
service_ensure
service_enabled
environment_file
global_options
environment_vars
config_files
sources
transforms
sinks
version
Data type: Optional[String]
What version of Vector to install. If left undef, will use default from repositories
install_vector
Data type: Boolean
Whether to have this module install Vector. Using this means the version param is ignored
config_dir
Data type: String
Base directory for configuration, default /etc/vector
data_dir
Data type: String
Directory for vector to store buffer and state data
user
Data type: String
What user to run Vector as, default 'vector'
group
Data type: String
What group to run Vector as, default 'vector'
manage_user
Data type: Boolean
Boolean to determine if puppet should manage the user vector runs as
user_opts
Data type: Hash
Dictionary of options to pass into the user resource, other than 'name' (specified with vector::user) and 'ensure'
manage_group
Data type: Boolean
Boolean to determine if puppet should manage the group vector runs as
group_opts
Data type: Hash
Dictionary of options to pass into the group resource, other than 'name' (specified with vector::group) and 'ensure'
service_name
Data type: String
Name of the service, default 'vector'
manage_systemd
Data type: Boolean
Whether this module should manage the systemd unit file, default true
vector_executable
Data type: String
Path to vector executable file
service_ensure
Data type: Vector::Ensure
Used in the 'service' resource for vector, default true
service_enabled
Data type: Vector::Enabled
Used in the 'service' resource for vector, default true
environment_file
Data type: String
Location of the environment file for Vector
global_options
Data type: Hash
Hash of global options for vector, besides data_dir (specifying data_dir here will be ignored)
Default value: {}
environment_vars
Data type: Hash
Hash of environment variables to make available to vector
Default value: {}
config_files
Data type: Hash
Hash of vector::configfile instances to create
Default value: {}
sources
Data type: Hash
Hash of vector::source instances to create
Default value: {}
transforms
Data type: Hash
Hash of vector::transform instances to create
Default value: {}
sinks
Data type: Hash
Hash of vector::sink instances to create
Default value: {}
vector::configure
vector::configure
vector::install
vector::summary
vector::service
vector::service
vector::setup
vector::setup
vector::user
vector::user
Defined types
vector::configfile
vector::configfile
Parameters
The following parameters are available in the vector::configfile
defined type:
format
Data type: Optional[Vector::ValidConfigFormat]
File format, either yaml, yml, json, toml.
Default value: undef
content
Data type: Optional[String]
File content, if specified, format must be specified and this string will be saved directly to disk
Default value: undef
data
Data type: Optional[Hash]
Hash to be converted to specified format (or toml if format is not specified)
Default value: undef
vector::sink
vector::sink
Parameters
The following parameters are available in the vector::sink
defined type:
type
Data type: String
Sink type. Consult vector documentation for available types
inputs
Data type: Array[String]
Array of inputs (sources or transforms)
parameters
Data type: Hash
Hash of additional parameters for the sink (besides type and inputs)
format
Data type: Vector::ValidConfigFormat
File format to save as, default toml
Default value: 'toml'
vector::source
vector::source
Parameters
The following parameters are available in the vector::source
defined type:
type
Data type: String
Source type. Consult vector documentation for available types.
parameters
Data type: Hash
Hash of additional parameters for this source (besides type)
format
Data type: Vector::ValidConfigFormat
File format to save as, default toml
Default value: 'toml'
vector::transform
vector::transform
Parameters
The following parameters are available in the vector::transform
defined type:
type
Data type: String
Transform type. Consult vector documentation for available types.
inputs
Data type: Array[String]
Array of inputs (source or transform)
parameters
Data type: Hash
Hash of additional parameters for this source (besides type and inputs)
format
Data type: Vector::ValidConfigFormat
File format to save as, default toml
Default value: 'toml'
Functions
vector::dump_config
Type: Puppet Language
vector::dump_config
vector::dump_config(Hash $data, Vector::ValidConfigFormat $format = 'toml')
vector::dump_config
Returns: String
A String representing the dumped configuration
data
Data type: Hash
A puppet hash representing the configuration of some vector entity (source, transform, sink, etc)
format
Data type: Vector::ValidConfigFormat
What format to dump the $data parameter as (json, toml, yaml, yml)
Data types
Vector::Enabled
defines a valid value for the 'enabled' parameter for the vector systemd service
Alias of Variant[Enum['manual','mask','delayed'], Boolean]
Vector::Ensure
defines a valid value for the vector systemd service 'ensure' parameter
Alias of Variant[Enum['running','stopped'], Boolean]
Vector::ValidConfigFormat
defines the valid configuration file extensions for vector
Alias of Enum['json', 'yaml', 'yml', 'toml']
Changelog
All notable changes to this project will be documented in this file.
Release 0.1.3
Features
- vector::source, vector::transform, and vector::sink types are dumped into their own directories: ${vector::config_dir}/configs/{sources, transforms,sinks}/${title}.${format} respectively. vector::configfile types are saved into ${vector::config_dir}/configs/${title}.${file_format}
Bugfixes
- Accidently put the upper version limit for stdlib at 6.0 in previous versions of this module. Removed that upper limit here.
Known Issues
Release 0.1.4
Features
Bugfixes
- This module did not properly remove unmanaged vector config files in 0.1.3, that is fixed
Known Issues
Dependencies
- puppetlabs/stdlib (>= 8.1.0)