Forge Home

elastic_api

Manage Elastic Stack settings via Elasticsearch and Kibana API

5,878 downloads

5,878 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.0.0 (latest)
released Nov 15th 2019
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, 2016.4.x
  • Puppet >= 4.10.0 < 7.0.0
  • , , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'mightp-elastic_api', '1.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add mightp-elastic_api
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install mightp-elastic_api --version 1.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

mightp/elastic_api — version 1.0.0 Nov 15th 2019

Overview

This module will manage Elastic Stack settings, using the Elasticsearch/Kibana API.

This module has been tested on Debian- and RHEL-based OS'es, but should work on anything that runs Puppet, due to the nature of custom providers

Examples

# Manage a space
elastic_api::space { 'my_space':
  display_name => 'My Space',
  description  => 'This is my space!',
  initials     => 'MS',
  color        => '#FFFF00',
}

# Manage a Kibana Advanced Setting
elastic_api::advanced_setting { 'dateFormat:dow':
  value => 'Monday',
  space => 'my_space',
}

# Manage a ILM Policy
elastic_api::ilm_policy { '1_week':
  hot_max_age           => '1d',
  hot_max_size          => '50gb',
  warm_number_of_shards => 1,
  cold_enabled          => false,
  delete_min_age        => '7d',
}

# Manage a User Role and User Mapping (e.g. to LDAP realm)
# Create Grafana user role
elastic_api::user_role { 'ldap_grafana_role':
  indices => [{
    'names'                    => ['my_indices*'],
    'privileges'               => ['read', 'monitor', 'view_index_metadata'],
    'allow_restricted_indices' => false,
  }],
}
# Map the Grafana role
elastic_api::user_mapping { 'sa_grafana_role_mapping':
  dn_path => 'CN=Grafana User,OU=ELK,DC=my_domain,DC=org',
  roles   => ['ldap_grafana_role'],
  is_user => true, # Can be a pointed to a Security Group, with this set to false
}