Restructuring manifests.
- Renamed elasticsearch_kibana into kibana - Now kibana manifests only holds kibana installation and configuration - Move all configuration of elasticsearch into its own file that will be called from tasks. Change-Id: Ief27cc15b2498330446c1537aa0662bf84333048
This commit is contained in:
parent
74d140970a
commit
f4a1d22ac8
|
@ -0,0 +1,52 @@
|
|||
$fuel_settings = parseyaml(file('/etc/astute.yaml'))
|
||||
|
||||
$disks = regsubst($fuel_settings['elasticsearch_kibana']['dedicated_disks'], '([a-z]+)', '/dev/\1', 'G')
|
||||
|
||||
# Params for managing volumes.
|
||||
$pv_name = split($disks, ',')
|
||||
$lv_name = "EKlv"
|
||||
$vg_name = "EKvg"
|
||||
$device = "/dev/${vg_name}/${lv_name}"
|
||||
$fstype = "ext3"
|
||||
|
||||
# Params related to Elasticsearch.
|
||||
$es_dir = "/es-data"
|
||||
$es_instance = "es-01"
|
||||
$java = "openjdk-7-jre-headless"
|
||||
|
||||
|
||||
# Creates the logical volume
|
||||
lvm::volume { $lv_name:
|
||||
ensure => present,
|
||||
vg => $vg_name,
|
||||
pv => $pv_name,
|
||||
fstype => $fstype,
|
||||
}
|
||||
|
||||
# create the directory
|
||||
file { $es_dir:
|
||||
ensure => directory,
|
||||
}
|
||||
|
||||
# Mount the directory
|
||||
mount { $es_dir:
|
||||
device => $device,
|
||||
ensure => mounted,
|
||||
fstype => $fstype,
|
||||
options => "defaults",
|
||||
require => [File[$es_dir], Lvm::Volume[$lv_name]],
|
||||
}
|
||||
|
||||
# Ensure that java is installed
|
||||
package { $java:
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
# Install elasticsearch
|
||||
class { "elasticsearch":
|
||||
datadir => ["${es_dir}/elasticsearch_data"],
|
||||
require => [Mount[$es_dir], Package[$java]],
|
||||
}
|
||||
|
||||
# Start an instance of elasticsearch
|
||||
elasticsearch::instance { $es_instance: }
|
|
@ -0,0 +1 @@
|
|||
class { 'kibana': }
|
|
@ -1,46 +0,0 @@
|
|||
class elasticsearch_kibana (
|
||||
$pv_name,
|
||||
) {
|
||||
include elasticsearch_kibana::params
|
||||
|
||||
# Creates the logical volume
|
||||
lvm::volume { $elasticsearch_kibana::params::lv_name:
|
||||
alias => 'elasticsearch',
|
||||
ensure => present,
|
||||
vg => $elasticsearch_kibana::params::vg_name,
|
||||
pv => $pv_name,
|
||||
fstype => $elasticsearch_kibana::params::fstype,
|
||||
}
|
||||
|
||||
# create the directory
|
||||
file { $elasticsearch_kibana::params::es_dir:
|
||||
alias => 'es_dir',
|
||||
ensure => directory,
|
||||
}
|
||||
|
||||
# Mount the directory
|
||||
mount { $elasticsearch_kibana::params::es_dir:
|
||||
alias => 'es_dir',
|
||||
device => $elasticsearch_kibana::params::device,
|
||||
ensure => mounted,
|
||||
fstype => $elasticsearch_kibana::params::fstype,
|
||||
options => "defaults",
|
||||
require => [File['es_dir'], Lvm::Volume['elasticsearch']],
|
||||
}
|
||||
|
||||
# Ensure that java is installed
|
||||
package { $elasticsearch_kibana::params::java:
|
||||
alias => 'java',
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
# Install elasticsearch
|
||||
class { "elasticsearch":
|
||||
datadir => ["${elasticsearch_kibana::params::es_dir}/elasticsearch_data"],
|
||||
require => [Mount['es_dir'], Package['java']],
|
||||
}
|
||||
|
||||
# Start an instance of elasticsearch
|
||||
elasticsearch::instance { $elasticsearch_kibana::params::es_instance: }
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
class elasticsearch_kibana::params {
|
||||
$lv_name = "EKlv"
|
||||
$vg_name = "EKvg"
|
||||
$device = "/dev/${vg_name}/${lv_name}"
|
||||
|
||||
# Used to mount the logical volume
|
||||
$fstype = "ext3"
|
||||
|
||||
$es_dir = "/es-data"
|
||||
$es_instance = "es-01"
|
||||
|
||||
$java = "openjdk-7-jre-headless"
|
||||
}
|
|
@ -1,18 +1,16 @@
|
|||
Elasticsearch_kibana module for Puppet
|
||||
======================================
|
||||
Kibana module for Puppet
|
||||
========================
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Puppet module for configuring Elasticsearch server and kibana dashboard.
|
||||
Puppet module for configuring Kibana dashboard.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
```puppet
|
||||
class {'elasticsearch_kibana':
|
||||
pv_name => '/dev/sdb',
|
||||
}
|
||||
class {'kibana': }
|
||||
|
||||
```
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
class kibana
|
||||
{
|
||||
# Work is in progress
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"name": "elasticsearch_kibana",
|
||||
"name": "kibana",
|
||||
"version": "6.1.0",
|
||||
"author": "Guillaume Thouvenin <gthouvenin@mirantis.com>",
|
||||
"summary": "Elasticsearch and kibana Installer",
|
||||
"summary": "Kibana Installer",
|
||||
"license": "Apache License 2.0",
|
||||
"source": "git://git.openstack.org/cgit/stackforge/fuel-plugin-elasticsearch-kibana.git",
|
||||
"project_page": "none",
|
||||
|
@ -17,11 +17,9 @@
|
|||
"operatingsystemrelease": ["6"]
|
||||
}
|
||||
],
|
||||
"description": "Puppet module for configuring Elasticsearch server and Kibana dashboard",
|
||||
"description": "Puppet module for configuring Kibana dashboard",
|
||||
"dependencies": [
|
||||
{"name": "puppetlabs/stdlib", "version_requirement": "4.x"},
|
||||
{"name": "puppetlabs/lvm", "version_requirement": ">= 0.4.0"},
|
||||
{"name": "elasticsearch/elasticsearch", "version_requirement": ">= 0.9.1"},
|
||||
{"name": "jfryman/nginx", "version_requirement": ">= 0.2.2"}
|
||||
]
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
$fuel_settings = parseyaml(file('/etc/astute.yaml'))
|
||||
|
||||
$disks = regsubst($fuel_settings['elasticsearch_kibana']['dedicated_disks'], '([a-z]+)', '/dev/\1', 'G')
|
||||
|
||||
class { 'elasticsearch_kibana':
|
||||
pv_name => split($disks, ','),
|
||||
}
|
|
@ -5,7 +5,7 @@ title: The Elasticsearch-Kibana Server Plugin
|
|||
# Plugin version
|
||||
version: 6.1.0
|
||||
# Description
|
||||
description: Deploy Elasticsearch server and Kibana web interface.
|
||||
description: Deploy Elasticsearch server and the Kibana web interface.
|
||||
# Required fuel version
|
||||
fuel_version: ['6.1']
|
||||
|
||||
|
|
|
@ -49,6 +49,6 @@ wget -qO- "${FUEL_LIB_TARBALL_URL}" | \
|
|||
fuel-library-${FUEL_LIB_VERSION}/deployment/puppet/{stdlib,lvm}
|
||||
|
||||
# Untar kibana
|
||||
KIBANA_FOLDER="${MODULES}/elasticsearch_kibana/files/kibana"
|
||||
KIBANA_FOLDER="${MODULES}/kibana/files/kibana"
|
||||
mkdir -p ${KIBANA_FOLDER}
|
||||
wget -qO- "${KIBANA_TARBALL_URL}" | tar -C "${KIBANA_FOLDER}" --strip-components=1 -xz
|
||||
|
|
10
tasks.yaml
10
tasks.yaml
|
@ -2,7 +2,15 @@
|
|||
stage: post_deployment
|
||||
type: puppet
|
||||
parameters:
|
||||
puppet_manifest: puppet/site.pp
|
||||
puppet_manifest: puppet/manifests/elasticsearch.pp
|
||||
puppet_modules: puppet/modules
|
||||
timeout: 600
|
||||
|
||||
- role: ['base-os']
|
||||
stage: post_deployment
|
||||
type: puppet
|
||||
parameters:
|
||||
puppet_manifest: puppet/manifests/kibana.pp
|
||||
puppet_modules: puppet/modules
|
||||
timeout: 600
|
||||
|
||||
|
|
Loading…
Reference in New Issue