Skip to content

Commit

Permalink
restructured inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Nov 22, 2015
1 parent c230098 commit 5d8caea
Show file tree
Hide file tree
Showing 14 changed files with 121 additions and 43 deletions.
4 changes: 4 additions & 0 deletions README/server_conf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ splunk_server_conf:
* List of available sites
* Defaults to an empty string. So if multisite is turned on this needs to be explicitly set

cluster_label: [dynamic|<string>]
* Defaults to an empty string.
* Use dynamic to set automatically

replication_port:
port: <port>
* Replication port
Expand Down
9 changes: 1 addition & 8 deletions group_vars/all → group_vars/all/splunk_installation
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
---
#####################################################################################################################
# Global Variables
#####################################################################################################################

splunk_repository:
repository_root: /var/lib/splunk_repository

#####################################################################################################################
# Installation Variables
#####################################################################################################################
splunk_installation:
splunk_home_path: /opt/splunk
version: 6.3.1
ssh_public_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCnC6DzjkQjCXTMRqEWELAeehSldjqAemn3NflE6NKQ/wp7ekO6krRxALTBp3sD4wllCw7IRFkVPDpII29PszGxc/JL53yV2RgYRhzSxdDG5FuTKhS5FKRuQuoPPj3Y8qm1ZBxk+9W3Z/BWP593lkgLQ1v4ykO68p53+QCLy4Up1+Noyw3sRwpgx12OzDcIvjzZ2s8DjmApwXg23YB/TVS7OWG1A4AVVUa4cKq7CXnbY/uVluUnI7jUeOW1bsLnrgCuSbInxEyGmG/tcEm/2PAp22arTjpOEBvUNjdIwy6/Dhx4679pKh+KATjHpkM+iNWmy/zkl28Iv798pt8k+Zf"
ssh_public_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCnC6DzjkQjCXTMRqEWELAeehSldjqAemn3NflE6NKQ/wp7ekO6krRxALTBp3sD4wllCw7IRFkVPDpII29PszGxc/JL53yV2RgYRhzSxdDG5FuTKhS5FKRuQuoPPj3Y8qm1ZBxk+9W3Z/BWP593lkgLQ1v4ykO68p53+QCLy4Up1+Noyw3sRwpgx12OzDcIvjzZ2s8DjmApwXg23YB/TVS7OWG1A4AVVUa4cKq7CXnbY/uVluUnI7jUeOW1bsLnrgCuSbInxEyGmG/tcEm/2PAp22arTjpOEBvUNjdIwy6/Dhx4679pKh+KATjHpkM+iNWmy/zkl28Iv798pt8k+Zf7 root@linuxmint"

package_format: rpm
# package_format: [rpm|tgz]
Expand Down
15 changes: 15 additions & 0 deletions group_vars/all/splunk_packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
#####################################################################################################################
# Splunk Package Variables
#####################################################################################################################

splunk_packages:
linux_64_rpm:
package:
version: 6.3.1
url: "http://download.splunk.com/products/splunk/releases/6.3.1/splunk/linux/splunk-6.3.1-f3e41e4b37b2-linux-2.6-x86_64.rpm"

linux_64_tgz:
package:
version: "6.3.1"
url: "http://download.splunk.com/products/splunk/releases/6.3.1/splunk/linux/splunk-6.3.1-f3e41e4b37b2-Linux-x86_64.tgz"
6 changes: 6 additions & 0 deletions group_vars/all/splunk_repository
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#####################################################################################################################
# Splunk Repository Variables
#####################################################################################################################

splunk_repository:
repository_root: /var/lib/splunk_repository
7 changes: 0 additions & 7 deletions group_vars/splunk_indexers
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ splunk_conf_path: /opt/splunk/etc/system/local
#####################################################################################################################

splunk_inputs_conf:
splunktcp:
port: 9997
splunktcp_ssl:
port: 9997
SSL:
Expand All @@ -26,10 +24,7 @@ splunk_inputs_conf:
splunk_web_conf:
settings:
enableSplunkWebSSL: true
httpport: 8000
startwebserver: 0
privKeyPath: etc/auth/splunkweb/privkey.pem
caCertPath: etc/auth/splunkweb/cert.pem
updateCheckerBaseURL: 0

#####################################################################################################################
Expand All @@ -48,8 +43,6 @@ splunk_server_conf:
mode: slave
master_uri: "https://clustermaster:8089"
pass4SymmKey: SecretKey
replication_port:
port: 9888
replication_port_ssl:
port: 9888
rootCA: $SPLUNK_HOME/etc/auth/cacert.pem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ splunk_server_conf:
site_replication_factor: "origin:2,total:3"
search_factor: 2
available_sites: "site1,site2"
cluster_label: dynamic
6 changes: 6 additions & 0 deletions group_vars/splunk_site0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
#####################################################################################################################
# General Variables for site0
#####################################################################################################################

splunk_site = site0
6 changes: 6 additions & 0 deletions group_vars/splunk_site1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
#####################################################################################################################
# General Variables for site1
#####################################################################################################################

splunk_site = site1
6 changes: 6 additions & 0 deletions group_vars/splunk_site2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
#####################################################################################################################
# General Variables for site2
#####################################################################################################################

splunk_site = site2
16 changes: 0 additions & 16 deletions hosts

This file was deleted.

48 changes: 48 additions & 0 deletions hosts_production.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[splunk_repository]
localhost ansible_connection=local

[splunk_searchheads]
searchhead1.private.domain
searchhead2.private.domain
searchhead3.private.domain

[splunk_indexers]
indexer1.private.domain
indexer2.private.domain

[splunk_licensemaster]
searchhead.private.domain

[splunk_deployer]
deployer.private.domain

[splunk_masternode]
masternode.private.domain

[splunk_deploymentserver]
deploymentserver.private.domain

[splunk_dmc]
dmc.private.domain

[splunk_site0]
dmc.private.domain

[splunk_site1]
searchhead1.private.domain
searchhead2.private.domain
indexer1.private.domain

[splunk_site2]
indexer2.private.domain

[splunk_sh_cluter_production]
deployer.private.domain
searchhead1.private.domain
searchhead2.private.domain
searchhead3.private.domain

[splunk_cluster_production]
masternode.private.domain
indexer1.private.domain
indexer2.private.domain
2 changes: 1 addition & 1 deletion roles/common/tasks/add_authorized_key.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

- name: Add private key to user splunk
- name: Add authorized key to user splunk
authorized_key: user=splunk
key="{{ splunk_installation.ssh_public_key }}"
when: splunk_installation.ssh_public_key is defined
Expand Down
28 changes: 20 additions & 8 deletions splunk_download.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
---
- hosts: splunk_repository
tasks:
- name: Download Splunk package
get_url: url={{ splunk_installation.package_url }}
dest={{ splunk_repository.repository_root }}/packages
owner={{ splunk_repository.repository_owner }}
group={{ splunk_repository.repository_group }}
mode=644
- hosts: splunk_repository
tasks:
- name: Download Splunk rpm packages
get_url: url="{{ item.value.url }}"
dest={{ splunk_repository.repository_root }}/packages
owner={{ splunk_repository.repository_owner }}
group={{ splunk_repository.repository_group }}
mode=644
with_dict: "{{ splunk_packages.linux_64_rpm }}"
when: splunk_installation.package_format == "rpm"

- name: Download Splunk tgz packages
get_url: url="{{ item.value.url }}"
dest={{ splunk_repository.repository_root }}/packages
owner={{ splunk_repository.repository_owner }}
group={{ splunk_repository.repository_group }}
mode=644
with_dict: "{{ splunk_packages.linux_64_tgz }}"
when: splunk_installation.package_format == "tgz"

10 changes: 7 additions & 3 deletions splunk_repository_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
state=directory

- name: Set repository owner/group
file: path={{ splunk_repository.repository_root }} recurse=yes owner={{ splunk_repository.repository_owner }} group={{ splunk_repository.repository_group }}
file: path={{ splunk_repository.repository_root }}
recurse=yes
owner={{ splunk_repository.repository_owner }}
group={{ splunk_repository.repository_group }}

- name: Set repository owner/group
file: path={{ splunk_repository.repository_root }} mode=750
- name: Set repository directory mode
file: path={{ splunk_repository.repository_root }}
mode=750

0 comments on commit 5d8caea

Please sign in to comment.