From 053b4c657bfb70f11ff89c68fb462fcf095f8a72 Mon Sep 17 00:00:00 2001 From: Mikhail S Medvedev Date: Thu, 9 Jul 2015 14:41:43 -0500 Subject: [PATCH] Move out server class from elasticsearch_node.pp Change-Id: Ic49e815e7346280de31891eb11faccb7cad3adad Story: 2000172 Spec: http://specs.openstack.org/openstack-infra/infra-specs/specs/server_base_template_refactor.htm --- manifests/site.pp | 14 +++++++++++--- .../manifests/elasticsearch_node.pp | 13 ------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/manifests/site.pp b/manifests/site.pp index 6e8f71e63d..e0f35d1080 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -395,10 +395,18 @@ node /^subunit-worker\d+\.openstack\.org$/ { # Node-OS: precise node /^elasticsearch0[1-7]\.openstack\.org$/ { $group = "elasticsearch" + $iptables_nodes_rule = regsubst ($elasticsearch_nodes, + '^(.*)$', '-m state --state NEW -m tcp -p tcp --dport 9200:9400 -s \1 -j ACCEPT') + $iptables_clients_rule = regsubst ($elasticsearch_clients, + '^(.*)$', '-m state --state NEW -m tcp -p tcp --dport 9200:9400 -s \1 -j ACCEPT') + $iptables_rule = flatten([$iptables_nodes_rule, $iptables_clients_rule]) + class { 'openstack_project::server': + iptables_public_tcp_ports => [22], + iptables_rules6 => $iptables_rule, + iptables_rules4 => $iptables_rule, + sysadmins => hiera('sysadmins', []), + } class { 'openstack_project::elasticsearch_node': - sysadmins => hiera('sysadmins', []), - elasticsearch_nodes => $elasticsearch_nodes, - elasticsearch_clients => $elasticsearch_clients, discover_nodes => $elasticsearch_nodes, } } diff --git a/modules/openstack_project/manifests/elasticsearch_node.pp b/modules/openstack_project/manifests/elasticsearch_node.pp index 5fa7492fbd..f2af969028 100644 --- a/modules/openstack_project/manifests/elasticsearch_node.pp +++ b/modules/openstack_project/manifests/elasticsearch_node.pp @@ -15,22 +15,9 @@ # Elasticsearch server glue class. # class openstack_project::elasticsearch_node ( - $elasticsearch_nodes = [], - $elasticsearch_clients = [], $discover_nodes = ['localhost'], $heap_size = '30g', - $sysadmins = [] ) { - $iptables_nodes_rule = regsubst ($elasticsearch_nodes, '^(.*)$', '-m state --state NEW -m tcp -p tcp --dport 9200:9400 -s \1 -j ACCEPT') - $iptables_clients_rule = regsubst ($elasticsearch_clients, '^(.*)$', '-m state --state NEW -m tcp -p tcp --dport 9200:9400 -s \1 -j ACCEPT') - $iptables_rule = flatten([$iptables_nodes_rule, $iptables_clients_rule]) - class { 'openstack_project::server': - iptables_public_tcp_ports => [22], - iptables_rules6 => $iptables_rule, - iptables_rules4 => $iptables_rule, - sysadmins => $sysadmins, - } - class { 'logstash::elasticsearch': } class { '::elasticsearch':