Code Monkey home page Code Monkey logo

Comments (3)

poolski avatar poolski commented on August 12, 2024

Curious - I'd be interested to see how that pans out!

from puppet-beats.

KZachariassen avatar KZachariassen commented on August 12, 2024

I have pushed a new branch where I have done some rework on the Filebeat part of the project.

The module is now using 100% Puppet Hashes for configuration and writing the config file is done by this piece of code:

# Filebeat config
class beats::filebeat::config{

  $shipper_data_template = {
    shipper => {
      ignore_outgoing       => true,
      name                  => $::fqdn,
      refresh_topology_freq => '10',
    }
  }
  $shipper= deep_merge($shipper_data_template, $beats::shipper_data)
  $prospectors = $beats::filebeat::prospectors
  $outputs = $beats::filebeat::outputs

  $filebeat_conf = merge($prospectors,$outputs,$shipper)

  file {'/etc/filebeat/filebeat.yml':
    ensure  => present,
    content => inline_template('<%= @filebeat_conf.to_yaml %>'),
    }
}

$shipper_data_template is a example of creating a default hash if you want some default values for pieces of your config file. The rest of the magic is provided by hash merge and <%= @filebeat_conf.to_yaml %>

This makes is really simple and remove a lot of pain regarding erb templates(spaces, newlines). Furthermore it allows us to handle changes in the Beat product, without the need to update .pp and .erb files.

I would like some feedback before I will rework the rest of the module.

from puppet-beats.

KZachariassen avatar KZachariassen commented on August 12, 2024

Could someone have a look and test the brance I created?

from puppet-beats.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.