diff --git a/.fixtures.yml b/.fixtures.yml new file mode 100644 index 0000000..1f42440 --- /dev/null +++ b/.fixtures.yml @@ -0,0 +1,6 @@ +fixtures: + forge_modules: + apt: puppetlabs/apt + elastic_stack: elastic/elastic_stack + stdlib: puppetlabs/stdlib +zypprepo: darin/zypprepo diff --git a/README.md b/README.md index a7e4f0a..26cb72e 100644 --- a/README.md +++ b/README.md @@ -15,57 +15,132 @@ ## Description -Start with a one- or two-sentence summary of what the module does and/or what problem it solves. This is your 30-second elevator pitch for your module. Consider including OS/Puppet version it works with. - -You can give more descriptive information in a second paragraph. This paragraph should answer the questions: "What does this module *do*?" and "Why would I use it?" If your module has a range of functionality (installation, configuration, management, etc.), this is the time to mention it. +A Puppet module for managing and configuring official Elastic beats. Works best with RPM/DEB installs of Beats packages but tries to handle custom installations. ## Setup -### What beats affects **OPTIONAL** - -If it's obvious what your module touches, you can skip this section. For example, folks can probably figure out that your mysql_instance module affects their MySQL instances. +### What beats affects -If there's more that they should know about, though, this is the place to mention: +* Elastic stack repository files. +* Each Beats package. +* Each Beats configuration file. +* Each Beats service file. +* Metricbeat module configuration files. -* Files, packages, services, or operations that the module will alter, impact, or execute. -* Dependencies that your module automatically installs. -* Warnings or other important notices. +### Setup Requirements -### Setup Requirements **OPTIONAL** +* The [stdlib](https://forge.puppetlabs.com/puppetlabs/stdlib) Puppet library. -If your module requires anything extra before setting up (pluginsync enabled, another module, etc.), mention it here. - -If your most recent release breaks compatibility or requires particular steps for upgrading, you might want to include an additional "Upgrading" section here. +#### Repository management -### Beginning with beats +When using the repository management, the following module dependencies are required: -The very basic steps needed for a user to get the module up and running. This can include setup steps, if necessary, or it can be an example of the most basic use of the module. +* Debian/Ubuntu: [Puppetlabs/apt](http://forge.puppetlabs.com/puppetlabs/apt) +* OpenSuSE/SLES: [Darin/zypprepo](https://forge.puppetlabs.com/darin/zypprepo) -## Usage +### Beginning with beats -This section is where you describe how to customize, configure, and do the fancy stuff with your module here. It's especially helpful if you include usage examples and code samples for doing things with your module. +Include the `beats` class and pass a list of individual Beats to manage with `beats_manage`: -## Reference +```puppet +class { 'beats': + $beats_manage => ['metricbeat','auditbeat','heartbeat','packetbeat'] +} +``` -Users need a complete list of your module's classes, types, defined types providers, facts, and functions, along with the parameters for each. You can provide this list either via Puppet Strings code comments or as a complete list in the README Reference section. +## Usage -* If you are using Puppet Strings code comments, this Reference section should include Strings information so that your users know how to access your documentation. +### Main class + +There is very few parameters you should need to customise. The most useful would be `config_root` which allows you to control where this module expects the individual Beats configuration files to live: + +```puppet +class { 'beats': + beats_manage => ['metricbeat','auditbeat','heartbeat','packetbeat'], + config_root => '/opt/beats' +} +``` + +#### Beats custom configuration + +This module recommends using Hiera for configuration data. You can either specify your complete Beats configuration in Hiera or as a Puppet URL under `beats::::settings`. + +Configure in Hiera: + +```yaml +beats::auditbeat::settings: + auditbeat.modules: + - module: auditd + audit_rules: | + -w /etc/group -p wa -k identity + -w /etc/passwd -p wa -k identity + -w /etc/gshadow -p wa -k identity + -w /etc/shadow -p wa -k identity + -w /etc/security/opasswd -p wa -k identity + -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access + -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access + -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access + -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access + - module: file_integrity + paths: + - /bin + - /usr/bin + - /sbin + - /usr/sbin + - /etc +``` + +Or pass a Puppet URL that will be used as the source of configuration: + +```yaml +beats::auditbeat::settings: 'puppet:///somefileshare/auditbeat.yml' +``` + +### Beats specific usage + +#### Metricbeat modules + +This class can handle enabling/disabling Metricbeat modules for you. + +To enable/disable a list of modules, ensure you manage Metricbeat with this class: + +```puppet +class { 'beats': + beats_manage => ['metricbeat'], +} +``` + +And then configure the modules you want to enable/disable in Hiera: + +```yaml +beats::metricbeat::modules: + 'present': + - docker + - system + 'absent': + - kafka +``` + +If you need to define custom settings for a particular module, add those in Hiera under `beats::metricbeat::modules::settings`. For example: + +```yaml +beats::metricbeat::modules::settings: + - module: docker + metricsets: ["container", "cpu", "diskio", "healthcheck", "info", "memory", "network"] + hosts: ["unix:///var/run/docker.sock"] + period: 10s + - module: redis + period: 10s +``` -* If you are not using Puppet Strings, include a list of all of your classes, defined types, and so on, along with their parameters. Each element in this listing should include: +## Reference - * The data type, if applicable. - * A description of what the element does. - * Valid values, if the data type doesn't make it obvious. - * Default value, if any. +TBD ## Limitations -This is where you list OS compatibility, version compatibility, etc. If there are Known Issues, you might want to include them under their own heading here. +TBD ## Development -Since your module is awesome, other users will want to play with it. Let them know what the ground rules for contributing are. - -## Release Notes/Contributors/Etc. **Optional** - -If you aren't using changelog, put your release notes here (though you should consider using changelog). You can also add any additional sections you feel are necessary or important to include here. Please use the `## ` header. +Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for instructions regarding development environments and testing. diff --git a/data/common.yaml b/data/common.yaml new file mode 100644 index 0000000..35bce90 --- /dev/null +++ b/data/common.yaml @@ -0,0 +1,8 @@ +beats::beats_manage: ['auditbeat','heartbeat','metricbeat','packetbeat'] +beats::package_ensure: present +beats::package_manage: true +beats::service_enable: true +beats::service_ensure: running +beats::service_manage: true +beats::service_provider: ~ +beats::config_root: /etc diff --git a/data/windows-family.yaml b/data/windows-family.yaml new file mode 100644 index 0000000..95ef070 --- /dev/null +++ b/data/windows-family.yaml @@ -0,0 +1 @@ +beats::config_root: C:\Program Files diff --git a/functions/metricbeat/get_module_settings.pp b/functions/metricbeat/get_module_settings.pp new file mode 100644 index 0000000..7a2f6cf --- /dev/null +++ b/functions/metricbeat/get_module_settings.pp @@ -0,0 +1,18 @@ +# beats::metricbeat::get_module_settings +# +# @api private +# This function fetches all of a specific Metricbeat module settings from +# the beats::metricbeat::modules::settings key in Hiera. +# Avoid modifying private classes. +# +# @param module +# A Metricbeat module to fetch settings for. +# +function beats::metricbeat::get_module_settings(String $module) >> Array[Hash] { + $module_settings = lookup("beats::metricbeat::modules::settings", Array[Hash], 'deep', undef) + $settings = $module_settings.filter |$v| { + $value = $v + $value =~ Hash and $value[module] == $module + } + $settings +} diff --git a/hiera.yaml b/hiera.yaml new file mode 100644 index 0000000..6e2a6a1 --- /dev/null +++ b/hiera.yaml @@ -0,0 +1,22 @@ +--- +version: 5 + +defaults: + datadir: 'data' + data_hash: 'yaml_data' + +hierarchy: + - name: 'Full Version' + path: '%{facts.os.name}-%{facts.os.release.full}.yaml' + + - name: 'Major Version' + path: '%{facts.os.name}-%{facts.os.release.major}.yaml' + + - name: 'Distribution Name' + path: '%{facts.os.name}.yaml' + + - name: 'Operating System Family' + path: '%{facts.os.family}-family.yaml' + + - name: 'common' + path: 'common.yaml' diff --git a/lib/puppet/provider/metricbeat_module/metricbeat.rb b/lib/puppet/provider/metricbeat_module/metricbeat.rb new file mode 100644 index 0000000..971e648 --- /dev/null +++ b/lib/puppet/provider/metricbeat_module/metricbeat.rb @@ -0,0 +1,48 @@ +require 'yaml' + +Puppet::Type.type(:metricbeat_module).provide(:metricbeat) do + + commands :metricbeat => 'metricbeat' + + # Metricbeat module file. + # + # @return String + def module_file + File.join( + @resource[:module_dir], + "#{resource[:name]}.yml" + ) + end + + def exists? + if !File.exists?(module_file) + debug("Module file #{module_file} does not exist") + return false + else + debug "Module exists" + return true + end + end + + def create + retry_count = 3 + retry_times = 0 + begin + info("Enabling Metricbeat module") + metricbeat(['modules','enable',resource[:name]]) + rescue Puppet::ExecutionFailure => e + retry_times += 1 + debug("Failed to enable module. Retrying... #{retry_times} of #{retry_count}") + sleep 2 + retry if retry_times < retry_count + raise "Failed to enable module. Received error: #{e.inspect}" + end + end + + # Remove this plugin from the host. + def destroy + info("Disabling Metricbeat module") + metricbeat(['modules','disable',@resource[:name]]) + end + +end diff --git a/lib/puppet/type/metricbeat_module.rb b/lib/puppet/type/metricbeat_module.rb new file mode 100644 index 0000000..81e62c9 --- /dev/null +++ b/lib/puppet/type/metricbeat_module.rb @@ -0,0 +1,15 @@ +Puppet::Type.newtype(:metricbeat_module) do + @doc = 'Manage Metricbeat modules' + + ensurable + + newparam(:name, :namevar => true) do + desc 'An arbitrary name used as the identity of the resource.' + end + + newparam(:module_dir) do + desc 'Path to the Metricbeat modules directory' + defaultto '/etc/metricbeat/modules.d' + end + +end diff --git a/manifests/config.pp b/manifests/config.pp new file mode 100644 index 0000000..5e360ee --- /dev/null +++ b/manifests/config.pp @@ -0,0 +1,42 @@ +# @api private +# This class handles the configuration files for beats. Avoid modifying private classes. +class beats::config { + $beats::beats_manage.each |String $beat| { + case $facts['os']['family'] { + 'windows': { + $beat_config = "${beats::config_root}\\${beat}\\${beat}.yml" + } + default: { + $beat_config = "${beats::config_root}/${beat}/${beat}.yml" + } + } + $settings = lookup("beats::${beat}::settings", Data, 'deep', undef) + if $settings { + case type($settings) { + String: { + file { "${beat}_config": + ensure => file, + path => $beat_config, + owner => 0, + group => 0, + mode => '0600', + source => $settings, + } + } + default: { + file { "${beat}_config": + ensure => file, + path => $beat_config, + owner => 0, + group => 0, + mode => '0600', + content => epp('beats/beat.yml.epp', { settings => $settings }), + } + } + } + } + if $beat == 'metricbeat' and lookup('beats::metricbeat::modules', Data, 'deep', undef) { + require beats::metricbeat::config + } + } +} diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..e1a173d --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,51 @@ +# beats +# +# @param beats_manage +# The names of Beats to manage with this module. +# +# @param package_ensure +# Whether to install Beats packages, and what version to install. Values: 'present', 'latest', or a specific version number. +# Default value: 'present'. +# +# @param package_manage +# Whether to manage the Beats packages. Default value: true. +# +# @param service_enable +# Whether to enable the Beats services at boot. Default value: true. +# +# @param service_ensure +# Whether the Beats services should be running. Default value: 'running'. +# +# @param service_manage +# Whether to manage the Beats services. Default value: true. +# +# @param service_provider +# Which service provider to use for Beats. Default value: 'undef'. +# +# @param config_root +# The root directory under which individual beats config directories are found. Default value: '/etc'. +# +# @param [Boolean] manage_repo +# Enable repository management. Configure the official repositories. +# +class beats ( + Array[String] $beats_manage, + String $package_ensure, + Boolean $package_manage, + Boolean $service_enable, + Enum['running', 'stopped'] $service_ensure, + Boolean $service_manage, + Optional[String] $service_provider, + String $config_root, + Boolean $manage_repo = true + ) { + contain beats::install + contain beats::config + contain beats::service + if ($manage_repo == true) { + include elastic_stack::repo + } + Class['::beats::install'] + -> Class['::beats::config'] + -> Class['::beats::service'] +} diff --git a/manifests/install.pp b/manifests/install.pp new file mode 100644 index 0000000..14d20e2 --- /dev/null +++ b/manifests/install.pp @@ -0,0 +1,9 @@ +# @api private +# This class handles beats packages. Avoid modifying private classes. +class beats::install { + if $beats::package_manage { + package { $beats::beats_manage: + ensure => $beats::package_ensure + } + } +} diff --git a/manifests/metricbeat/config.pp b/manifests/metricbeat/config.pp new file mode 100644 index 0000000..d241234 --- /dev/null +++ b/manifests/metricbeat/config.pp @@ -0,0 +1,31 @@ +# beats::metricbeat::config +# +# @param modules_manage +# A list of Metricbeat modules to manage. Default value: 'undef'. +# +# @api private +# This class handles the configuration files for beats. Avoid modifying private classes. +class beats::metricbeat::config ( + Hash $modules_manage = lookup('beats::metricbeat::modules', Hash, 'deep') +){ + if $modules_manage { + $modules_manage.each | String $ensure, Array[String] $modules | { + $modules.each | $m | { + $settings = beats::metricbeat::get_module_settings($m) + if $beats::service_manage == true { + beats::metricbeat::module { $m: + ensure => $ensure, + settings => $settings, + notify => Service['metricbeat'] + } + } + else { + beats::metricbeat::module { $m: + ensure => $ensure, + settings => $settings + } + } + } + } + } +} diff --git a/manifests/metricbeat/module.pp b/manifests/metricbeat/module.pp new file mode 100644 index 0000000..fefcdb1 --- /dev/null +++ b/manifests/metricbeat/module.pp @@ -0,0 +1,34 @@ +# @api private +# This defined type handles the enabling/disabling Metricbeat modules. Avoid modifying private defined types. +define beats::metricbeat::module ( + String $ensure = 'present', + Array $settings = [] +) +{ + case $facts['os']['family'] { + 'windows': { + $module_dir = "${beats::config_root}\\metricbeat\\modules.d" + } + default: { + $module_dir = "${beats::config_root}/metricbeat/modules.d" + } + } + if ! $settings.empty { + metricbeat_module { $name: + ensure => $ensure, + } + file { "metricbeat_${name}_config": + ensure => file, + path => "${module_dir}/${name}.yml", + owner => 0, + group => 0, + mode => '0600', + content => epp('beats/metricbeat_module.yml.epp', { name => $name, settings => $settings }), + } + } + else { + metricbeat_module { $name: + ensure => $ensure + } + } +} diff --git a/manifests/service.pp b/manifests/service.pp new file mode 100644 index 0000000..013dff2 --- /dev/null +++ b/manifests/service.pp @@ -0,0 +1,27 @@ +# @api private +# This class handles the beats service. Avoid modifying private classes. +class beats::service { + if $beats::service_manage == true { + $beats::beats_manage.each |String $beat| { + if lookup("beats::${beat}::settings", Data, 'deep', undef) { + service { $beat: + ensure => $beats::service_ensure, + enable => $beats::service_enable, + provider => $beats::service_provider, + hasstatus => true, + hasrestart => true, + subscribe => File["${beat}_config"] + } + } + else { + service { $beat: + ensure => $beats::service_ensure, + enable => $beats::service_enable, + provider => $beats::service_provider, + hasstatus => true, + hasrestart => true, + } + } + } + } +} diff --git a/metadata.json b/metadata.json index ab05ae6..e33f53f 100644 --- a/metadata.json +++ b/metadata.json @@ -1,7 +1,7 @@ { "name": "elastic-beats", "version": "0.1.0", - "author": "toby@jarpy.net", + "author": "joshua.rich@elastic.co", "summary": "Module for installing and configuring Elastic Beats.", "license": "Apache-2.0", "source": "https://github.com/elastic/puppet-beats", @@ -10,6 +10,10 @@ { "name": "puppetlabs-stdlib", "version_requirement": ">= 4.13.1 < 5.0.0" + }, + { + "name": "elastic/elastic_stack", + "version_requirement": ">=6.0.0 <7.0.0" } ], "operatingsystem_support": [ @@ -22,12 +26,21 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "7.0" + "6", + "7" + ] + }, + { + "operatingsystem": "CentOS", + "operatingsystemrelease": [ + "6", + "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ + "14.04", "16.04" ] }, diff --git a/spec/classes/beats_spec.rb b/spec/classes/beats_spec.rb new file mode 100644 index 0000000..4ece563 --- /dev/null +++ b/spec/classes/beats_spec.rb @@ -0,0 +1,126 @@ +require 'spec_helper' + +describe 'beats' do + # defaults should result in all official beats installed + let(:pre_condition) { 'include elastic_stack::repo' } + on_supported_os.each do |os, facts| + let(:facts) do + facts + end + context "on #{os}" do + describe 'beats' do + it { is_expected.to compile } + it { is_expected.to contain_class('beats::install') } + it { is_expected.to contain_class('beats::config') } + it { is_expected.to contain_class('beats::service') } + end + describe 'beats::install' do + it { is_expected.to contain_package('auditbeat') } + it { is_expected.to contain_package('heartbeat') } + it { is_expected.to contain_package('metricbeat') } + it { is_expected.to contain_package('packetbeat') } + end + describe 'beats::config' do + it { is_expected.to contain_file('auditbeat_config') } + it { is_expected.to contain_class('beats::metricbeat::config')} + end + describe 'beats::metricbeat::config' do + it { is_expected.to contain_beats__metricbeat__module('docker').that_notifies('Service[metricbeat]') } + end + describe 'beats::service' do + it { is_expected.to contain_file('auditbeat_config') } + it { is_expected.to contain_service('auditbeat').that_subscribes_to('File[auditbeat_config]') } + it { is_expected.to contain_service('heartbeat') } + it { is_expected.to contain_service('metricbeat') } + it { is_expected.to contain_service('packetbeat') } + end + end + + # no package management + context "no package mgmt on #{os}" do + let(:params) { {'package_manage' => false} } + describe 'beats' do + it { is_expected.to compile } + it { is_expected.to contain_class('beats::install') } + it { is_expected.to contain_class('beats::config') } + it { is_expected.to contain_class('beats::service') } + end + describe 'beats::install' do + it { is_expected.not_to contain_package('auditbeat') } + it { is_expected.not_to contain_package('heartbeat') } + it { is_expected.not_to contain_package('metricbeat') } + it { is_expected.not_to contain_package('packetbeat') } + end + describe 'beats::config' do + it { is_expected.to contain_file('auditbeat_config') } + it { is_expected.to contain_class('beats::metricbeat::config')} + end + describe 'beats::metricbeat::config' do + it { is_expected.to contain_beats__metricbeat__module('docker').that_notifies('Service[metricbeat]') } + end + describe 'beats::service' do + it { is_expected.to contain_service('auditbeat').that_subscribes_to('File[auditbeat_config]') } + it { is_expected.to contain_service('heartbeat') } + it { is_expected.to contain_service('metricbeat') } + it { is_expected.to contain_service('packetbeat') } + end + end + + # no service management + context "no service mgmt on #{os}" do + let(:params) { {'service_manage' => false} } + describe 'beats' do + it { is_expected.to compile } + it { is_expected.to contain_class('beats::install') } + it { is_expected.to contain_class('beats::config') } + it { is_expected.to contain_class('beats::service') } + end + describe 'beats::install' do + it { is_expected.to contain_package('auditbeat') } + it { is_expected.to contain_package('heartbeat') } + it { is_expected.to contain_package('metricbeat') } + it { is_expected.to contain_package('packetbeat') } + end + describe 'beats::config' do + it { is_expected.to contain_file('auditbeat_config') } + it { is_expected.to contain_class('beats::metricbeat::config')} + end + describe 'beats::metricbeat::config' do + it { is_expected.to contain_beats__metricbeat__module('docker') } + end + describe 'beats::service' do + it { is_expected.not_to contain_service('auditbeat') } + it { is_expected.not_to contain_service('heartbeat') } + it { is_expected.not_to contain_service('metricbeat') } + it { is_expected.not_to contain_service('packetbeat') } + end + end + + # installing a specific beat (metricbeat) + context "just metricbeat on #{os}" do + let(:params) { {'beats_manage' => ['metricbeat']} } + describe 'beats' do + it { is_expected.to compile } + it { is_expected.to contain_class('beats::install') } + it { is_expected.to contain_class('beats::config') } + it { is_expected.to contain_class('beats::service') } + end + describe 'beats::install' do + it { is_expected.to contain_package('metricbeat') } + it { is_expected.not_to contain_package('auditbeat') } + it { is_expected.not_to contain_package('heartbeat') } + it { is_expected.not_to contain_package('packetbeat') } + end + describe 'beats::config' do + it { is_expected.not_to contain_file('auditbeat_config') } + it { is_expected.to contain_class('beats::metricbeat::config')} + end + describe 'beats::service' do + it { is_expected.to contain_service('metricbeat') } + it { is_expected.not_to contain_service('auditbeat') } + it { is_expected.not_to contain_service('heartbeat') } + it { is_expected.not_to contain_service('packetbeat') } + end + end + end +end diff --git a/spec/defines/beats_metricbeat_module_spec.rb b/spec/defines/beats_metricbeat_module_spec.rb new file mode 100644 index 0000000..85c3d39 --- /dev/null +++ b/spec/defines/beats_metricbeat_module_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe 'beats::metricbeat::module' do + let(:pre_condition) { 'include beats' } + let(:title) { 'redis' } + let(:params) { {'ensure' => 'present' } } + on_supported_os.each do |os, facts| + let(:facts) do + facts + end + context "on #{os} (without custom settings)" do + it { is_expected.to compile } + it { is_expected.not_to contain_file('metricbeat_redis_config') } + it { is_expected.to contain_metricbeat_module('redis') } + end + context "on #{os} (with custom settings)" do + let(:params) { {'ensure' => 'present', 'settings' => [{'module' => 'redis', 'period' => '20s'}]} } + it { is_expected.to compile } + it { is_expected.to contain_file('metricbeat_redis_config') } + it { is_expected.to contain_metricbeat_module('redis') } + end + end +end diff --git a/spec/defines/metricbeat_module_spec.rb b/spec/defines/metricbeat_module_spec.rb new file mode 100644 index 0000000..5e1259b --- /dev/null +++ b/spec/defines/metricbeat_module_spec.rb @@ -0,0 +1,8 @@ +require 'spec_helper' + +describe 'metricbeat_module' do + let(:title) { 'apache' } + let(:name) { 'apache' } + it { is_expected.to compile } + it { is_expected.to contain_metricbeat_module('apache') } +end diff --git a/spec/fixtures/data/common.yaml b/spec/fixtures/data/common.yaml new file mode 100644 index 0000000..ba597b6 --- /dev/null +++ b/spec/fixtures/data/common.yaml @@ -0,0 +1,9 @@ +beats::auditbeat::settings: puppet:///some/path/to/auditbeat.yml +beats::metricbeat::modules: + 'present': + - docker +beats::metricbeat::modules::settings: + - module: docker + metricsets: ['cpu','filesystem'] + hosts: ["unix:///var/run/docker.sock"] + period: 10s diff --git a/spec/fixtures/hiera/hiera.yaml b/spec/fixtures/hiera/hiera.yaml new file mode 100644 index 0000000..012268c --- /dev/null +++ b/spec/fixtures/hiera/hiera.yaml @@ -0,0 +1,7 @@ +--- +:backends: + - yaml +:yaml: + :datadir: spec/fixtures/data +:hierarchy: + - common diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 15266c2..ce39e67 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -20,4 +20,8 @@ RSpec.configure do |c| c.default_facts = default_facts + c.hiera_config = 'spec/fixtures/hiera/hiera.yaml' + c.after(:suite) do + RSpec::Puppet::Coverage.report! + end end diff --git a/templates/beat.yml.epp b/templates/beat.yml.epp new file mode 100644 index 0000000..4f94333 --- /dev/null +++ b/templates/beat.yml.epp @@ -0,0 +1,2 @@ +# MANAGED BY PUPPET +<%= $settings.to_yaml %> diff --git a/templates/metricbeat_module.yml.epp b/templates/metricbeat_module.yml.epp new file mode 100644 index 0000000..4f94333 --- /dev/null +++ b/templates/metricbeat_module.yml.epp @@ -0,0 +1,2 @@ +# MANAGED BY PUPPET +<%= $settings.to_yaml %>