-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
root
committed
Nov 24, 2015
1 parent
437315a
commit 5ceaf72
Showing
27 changed files
with
354 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
def create_distsearch_serverlist (serverlist): | ||
|
||
servers_normalized = [] | ||
|
||
for item in serverlist: | ||
if type(item) is str: | ||
item=[item] | ||
for sublist in item: | ||
servers_normalized.append(sublist) | ||
|
||
servers = [] | ||
[servers.append(item) for item in servers_normalized if item not in servers] | ||
|
||
return servers | ||
|
||
class FilterModule(object): | ||
def filters(self): | ||
return {'create_distsearch_serverlist': create_distsearch_serverlist} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
def create_distsearch_servers (serverlist): | ||
|
||
servers_normalized = [] | ||
|
||
for item in serverlist: | ||
if type(item) is str: | ||
item=[item] | ||
for sublist in item: | ||
servers_normalized.append(sublist) | ||
|
||
servers = [] | ||
[servers.append(item) for item in servers_normalized if item not in servers] | ||
|
||
|
||
servers = [server+":8089" for server in servers ] | ||
servers = ', '.join(servers) | ||
return servers | ||
|
||
class FilterModule(object): | ||
def filters(self): | ||
return {'create_distsearch_servers': create_distsearch_servers} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
|
||
##################################################################################################################### | ||
# General Installation Variables | ||
##################################################################################################################### | ||
splunk_conf_path: /opt/splunk/etc/system/local | ||
|
||
##################################################################################################################### | ||
# Configurations for Splunk web.conf | ||
##################################################################################################################### | ||
|
||
splunk_web_conf: | ||
settings: | ||
enableSplunkWebSSL: 1 | ||
updateCheckerBaseURL: 0 | ||
|
||
##################################################################################################################### | ||
# Configurations for Splunk outputs.conf | ||
##################################################################################################################### | ||
|
||
splunk_outputs_conf: | ||
tcpout: | ||
defaultGroup: production | ||
target_group: | ||
production: | ||
useACK: true | ||
indexerDiscovery: production | ||
sslPassword: password | ||
sslCertPath: $SPLUNK_HOME/etc/auth/server.pem | ||
sslRootCAPath: $SPLUNK_HOME/etc/auth/ca.pem | ||
indexer_discovery: | ||
production: | ||
pass4SymmKey: changeme | ||
master_uri: dynamic | ||
|
||
##################################################################################################################### | ||
# Configurations for Splunk server.conf | ||
#################################################################################################################### | ||
|
||
splunk_server_conf: | ||
general: | ||
site: site0 | ||
license: | ||
master_uri: dynamic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
|
||
##################################################################################################################### | ||
# General Installation Variables | ||
##################################################################################################################### | ||
splunk_conf_path: /opt/splunk/etc/system/local | ||
|
||
##################################################################################################################### | ||
# Configurations for Splunk web.conf | ||
##################################################################################################################### | ||
|
||
splunk_web_conf: | ||
settings: | ||
enableSplunkWebSSL: 1 | ||
updateCheckerBaseURL: 0 | ||
|
||
##################################################################################################################### | ||
# Configurations for Splunk outputs.conf | ||
##################################################################################################################### | ||
|
||
splunk_outputs_conf: | ||
tcpout: | ||
defaultGroup: production | ||
target_group: | ||
production: | ||
useACK: true | ||
indexerDiscovery: production | ||
sslPassword: password | ||
sslCertPath: $SPLUNK_HOME/etc/auth/server.pem | ||
sslRootCAPath: $SPLUNK_HOME/etc/auth/ca.pem | ||
indexer_discovery: | ||
production: | ||
pass4SymmKey: changeme | ||
master_uri: dynamic | ||
|
||
##################################################################################################################### | ||
# Configurations for Splunk server.conf | ||
#################################################################################################################### | ||
|
||
splunk_server_conf: | ||
general: | ||
site: site0 | ||
license: | ||
master_uri: dynamic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
|
||
##################################################################################################################### | ||
# General Installation Variables | ||
##################################################################################################################### | ||
splunk_conf_path: /opt/splunk/etc/system/local | ||
|
||
##################################################################################################################### | ||
# Configurations for Splunk web.conf | ||
##################################################################################################################### | ||
|
||
splunk_web_conf: | ||
settings: | ||
enableSplunkWebSSL: 1 | ||
updateCheckerBaseURL: 0 | ||
|
||
##################################################################################################################### | ||
# Configurations for Splunk outputs.conf | ||
##################################################################################################################### | ||
|
||
splunk_outputs_conf: | ||
tcpout: | ||
defaultGroup: production | ||
target_group: | ||
production: | ||
useACK: true | ||
indexerDiscovery: production | ||
sslPassword: password | ||
sslCertPath: $SPLUNK_HOME/etc/auth/server.pem | ||
sslRootCAPath: $SPLUNK_HOME/etc/auth/ca.pem | ||
indexer_discovery: | ||
production: | ||
pass4SymmKey: changeme | ||
master_uri: dynamic | ||
|
||
##################################################################################################################### | ||
# Configurations for Splunk server.conf | ||
#################################################################################################################### | ||
|
||
splunk_server_conf: | ||
general: | ||
site: site0 | ||
license: | ||
master_uri: dynamic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
|
||
##################################################################################################################### | ||
# General Installation Variables | ||
##################################################################################################################### | ||
splunk_conf_path: /opt/splunk/etc/system/local | ||
|
||
##################################################################################################################### | ||
# Configurations for Splunk web.conf | ||
##################################################################################################################### | ||
|
||
splunk_web_conf: | ||
settings: | ||
enableSplunkWebSSL: 1 | ||
updateCheckerBaseURL: 0 | ||
|
||
##################################################################################################################### | ||
# Configurations for Splunk outputs.conf | ||
##################################################################################################################### | ||
|
||
splunk_outputs_conf: | ||
tcpout: | ||
defaultGroup: production | ||
target_group: | ||
production: | ||
useACK: true | ||
indexerDiscovery: production | ||
sslPassword: password | ||
sslCertPath: $SPLUNK_HOME/etc/auth/server.pem | ||
sslRootCAPath: $SPLUNK_HOME/etc/auth/ca.pem | ||
indexer_discovery: | ||
production: | ||
pass4SymmKey: changeme | ||
master_uri: dynamic | ||
|
||
##################################################################################################################### | ||
# Configurations for Splunk server.conf | ||
#################################################################################################################### | ||
|
||
splunk_server_conf: | ||
general: | ||
site: site0 | ||
license: | ||
master_uri: dynamic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
roles/distributed_search/tasks/distribute_distsearch_trustedkey.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
##################################################################################################################### | ||
# Distribute Keys for Distributed Search | ||
##################################################################################################################### | ||
|
||
- name: Create distServerKeys Directory | ||
local_action: "command ssh splunk@{{ item }} 'mkdir -p {{ splunk_installation.splunk_home_path }}/etc/auth/distServerKeys/{{ inventory_hostname }}'" | ||
with_items: "{{ splunk_distsearch_conf.distributedSearch.servers | create_distsearch_serverlist }}" | ||
|
||
- name: Copy Keys for distributed search | ||
local_action: "command scp {{ splunk_repository.repository_root }}/distServerKeys/{{ inventory_hostname }}/trusted.pem splunk@{{ item }}:{{ splunk_installation.splunk_home_path }}/etc/auth/distServerKeys/{{ inventory_hostname }}/trusted.pem" | ||
with_items: "{{ splunk_distsearch_conf.distributedSearch.servers | create_distsearch_serverlist }}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
- include: distribute_distsearch_trustedkey.yml |
45 changes: 45 additions & 0 deletions
45
roles/distsearch_conf/tasks/distsearch_conf_distributedSearch.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
##################################################################################################################### | ||
# Configurations for Splunk distsearch.conf | ||
##################################################################################################################### | ||
|
||
##################################################################################################################### | ||
# [distributedSearch] | ||
##################################################################################################################### | ||
|
||
# disabled | ||
|
||
- name: Set disable | ||
ini_file: dest="{{ splunk_conf_path }}/distsearch.conf" | ||
section=distributedSearch | ||
option=disabled | ||
value={{ splunk_distsearch_conf.distributedSearch.disabled }} | ||
state=present | ||
when: splunk_distsearch_conf.distributedSearch.disabled is defined and | ||
splunk_distsearch_conf.distributedSearch.disabled == true | ||
|
||
- name: Unset disable (default) | ||
ini_file: dest="{{ splunk_conf_path }}/distsearch.conf" | ||
section=distributedSearch | ||
option=disabled | ||
state=absent | ||
when: splunk_distsearch_conf.distributedSearch.disabled is undefined or | ||
splunk_distsearch_conf.distributedSearch.disabled == false | ||
|
||
# server | ||
|
||
- name: "Set server" | ||
ini_file: dest={{ splunk_conf_path }}/distsearch.conf | ||
section=distributedSearch | ||
option=servers | ||
value="{{ splunk_distsearch_conf.distributedSearch.servers | create_distsearch_servers }}" | ||
state=present | ||
when: splunk_distsearch_conf.distributedSearch.servers is defined | ||
tags: test | ||
|
||
- name: "Unset server (default)" | ||
ini_file: dest={{ splunk_conf_path }}/distsearch.conf | ||
section=distributedSearch | ||
option=server | ||
state=absent | ||
when: splunk_distsearch_conf.distributedSearch.servers is undefined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
##################################################################################################################### | ||
# Configurations for Splunk distsearch.conf | ||
##################################################################################################################### | ||
|
||
# touch | ||
|
||
- name: Touch distsearch.conf | ||
file: path={{ splunk_conf_path }}/distsearch.conf | ||
owner=splunk | ||
group=splunk | ||
mode=600 | ||
state=touch | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
- include: distsearch_conf_touch.yml | ||
- include: distsearch_conf_distributedSearch.yml | ||
|
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.