Skip to content

Commit

Permalink
Release/8.0.3 (#430)
Browse files Browse the repository at this point in the history
* Notifying of restart only when necessary (#406)

* Register jre path to Splunk launch (#404)

* OpenJDK11 for Centos 7 (#414)

* Fixing default service names (#411)

* Cleaning up how apps are copied and disabled (#416)

* Multiple SPLUNK_STANDALONE_URL hosts provided (#427)

* Refreshing installed apps array during CM setup (#428)

* Added bearer token authentication for splunk download (#425)
  • Loading branch information
alishamayor authored Apr 3, 2020
1 parent fbe7007 commit d9c8af3
Show file tree
Hide file tree
Showing 39 changed files with 263 additions and 261 deletions.
13 changes: 13 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Code owners are automatically requested for review when someone opens a
# pull request modifying code that they own.
# See: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners

# Note: Each line is a file pattern followed by one or more owners.
# Order matters: The last matching pattern has the most precedence.

# Default owners for everything in docker-splunk:
# * @splunk/if-01
* @nwang92 @alishamayor @arctan5x @lephino @jrigassio-splunk @jmeixensperger @hendolim @jonathan-vega-splunk

# Docs-only pull requests:
/docs/ @alishamayor @nwang92
2 changes: 2 additions & 0 deletions docs/ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ $ ansible-playbook -i inventory/environ.py ...

If SplunkBase apps are not specified or needed, the `splunkbase_username` and `splunkbase_password` variables should be omitted entirely.

When deploying distributed Splunk Enterprise environments, apps should be installed on the deployer, cluster master, and deployment server instances. Each of these roles will take care of bundling and pushing the apps to their respective downstream peers. Note that any configuration files in any custom app's `local` directory will *not* be sent to peers - this is in alignment with Splunk best practices around configuration management.

---

## SmartStore
Expand Down
23 changes: 18 additions & 5 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Navigation

* [8.0.3](#803)
* [8.0.2.1](#8021)
* [8.0.2](#802)
* [8.0.1](#801)
Expand All @@ -28,6 +29,18 @@

---

## 8.0.3

#### What's New?
* Support for Java installations on Red Hat and CentOS
* Updated defaults for `service_name`

#### Changes
* In S2S configuration, revised Splunk restart trigger to occur only when splunktcp has changed and Splunk is running
* Refactored how apps are copied and disabled

---

## 8.0.2.1

#### What's New?
Expand Down Expand Up @@ -110,7 +123,7 @@ Syncing with latest codebase - currently up to sync with 8.0.2.1.
#### Changes
* See [8.0.2.1](#8021) changes.

---
---

## 7.3.4

Expand All @@ -120,7 +133,7 @@ Syncing with latest codebase - currently up to sync with 8.0.2.1.
#### Changes
* See [8.0.1](#801) changes.

---
---

## 7.3.3

Expand All @@ -136,7 +149,7 @@ Syncing with latest codebase - currently up to sync with 8.0.2.1.
* Support for cluster labels via environment variables
* Bugfixes around app installation (through default.yml and pathing)

---
---

## 7.3.2

Expand All @@ -148,7 +161,7 @@ Syncing with latest codebase - currently up to sync with 8.0.2.1.
* Support and compatibility across Python 2 and Python 3
* Various bugfixes

---
---

## 7.3.1

Expand Down Expand Up @@ -211,7 +224,7 @@ Syncing with latest codebase - currently up to sync with 8.0.2.1.

---

## 7.2.7
## 7.2.7

#### What's New?
* Reorganizing multi-site playbooks
Expand Down
5 changes: 0 additions & 5 deletions docs/advanced/default.yml.spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ splunk:
* Splunk build location, either on the filesystem or a remote URL
* Default: /tmp/splunk.tgz
build_remote_src: <bool>
* Boolean to determine whether the installer is local (false) or remote (true)
* Default: true
license_master_url: <str>
* Hostname of Splunk Enterprise license master instance. May be overridden using SPLUNK_LICENSE_MASTER_URL environment variable.
* Default: null
Expand Down Expand Up @@ -465,7 +461,6 @@ splunk:
role: splunk_standalone
upgrade: false
build_location: /tmp/splunk.tgz
build_remote_src: true
apps_location: null
license_uri: null
admin_user: admin
Expand Down
5 changes: 1 addition & 4 deletions inventory/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,8 @@ def getSplunkBuild(vars_scope):
"""
Determine the location of the Splunk build
"""
vars_scope["splunk"]["build_url_bearer_token"] = os.environ.get("SPLUNK_BUILD_URL_BEARER_TOKEN", vars_scope["splunk"].get("build_url_bearer_token"))
vars_scope["splunk"]["build_location"] = os.environ.get("SPLUNK_BUILD_URL", vars_scope["splunk"].get("build_location"))
vars_scope["splunk"]["build_remote_src"] = False
if vars_scope["splunk"]["build_location"] and vars_scope["splunk"]["build_location"].startswith("http"):
vars_scope["splunk"]["build_remote_src"] = True

def getSplunkbaseToken(vars_scope):
"""
Expand Down Expand Up @@ -641,7 +639,6 @@ def prep_for_yaml_out(inventory):
"delay_num",
"apps_location",
"build_location",
"build_remote_src",
"hostname",
"upgrade",
"role",
Expand Down
2 changes: 1 addition & 1 deletion inventory/splunk_defaults_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ splunk:
deployer_url:

enable_service: False
service_name: "splunk"
service_name:
smartstore:
app_paths:
default: !!python/object/apply:os.path.join [*home, "etc", "apps"]
Expand Down
2 changes: 1 addition & 1 deletion inventory/splunk_defaults_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ splunk:
search_head_captain_url:
deployer_url:
enable_service: False
service_name: "splunkd"
service_name:
smartstore:
app_paths:
default: !!python/object/apply:os.path.join [*home, "etc", "apps"]
Expand Down
2 changes: 1 addition & 1 deletion inventory/splunkforwarder_defaults_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ splunk:
replication_factor: 3
replication_port: 9887
enable_service: False
service_name: "splunk"
service_name:
smartstore:
app_paths:
default: !!python/object/apply:os.path.join [*home, "etc", "apps"]
Expand Down
2 changes: 1 addition & 1 deletion inventory/splunkforwarder_defaults_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ splunk:
multisite_search_factor_origin: 3
multisite_search_factor_total: 3
enable_service: False
service_name: "splunk"
service_name:
smartstore:
app_paths:
default: !!python/object/apply:os.path.join [*home, "etc", "apps"]
Expand Down
14 changes: 8 additions & 6 deletions roles/splunk_cluster_master/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
- include_tasks: ../../../roles/splunk_common/tasks/enable_forwarding.yml

- include_tasks: ../../../roles/splunk_common/tasks/provision_apps.yml
when:
- splunk.apps_location
when: splunk.apps_location

- include_tasks: prepare_apps_bundle.yml
when:
- splunk.apps_location
when: splunk.apps_location

- include_tasks: initialize_cluster_master.yml

- include_tasks: apply_cluster_bundle.yml

# This installed_apps list gets mutated by ESS bundle generation, hence we
# need to refresh this array of apps before disabling them all
- include_tasks: ../../../roles/splunk_common/tasks/find_installed_apps.yml
when: splunk.apps_location

- include_tasks: ../../../roles/splunk_common/tasks/disable_installed_apps.yml
when:
- splunk.apps_location
when: splunk.apps_location

- include_tasks: setup_multisite.yml
when:
Expand Down
13 changes: 5 additions & 8 deletions roles/splunk_cluster_master/tasks/prepare_apps_bundle.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- include_tasks: ../../../roles/splunk_common/tasks/find_installed_apps.yml

- include_tasks: generate_ess_bundle.yml
Expand All @@ -8,11 +9,7 @@
when:
- '"itsi" in installed_apps'

# TODO: Might be better to use synchronize here, but we'll need rsync installed
- name: Copy installed apps to master-apps
command: "cp -R {{ splunk.app_paths.default }}/{{ item }} {{ splunk.app_paths.idxc }}"
become: yes
become_user: "{{ splunk.user }}"
with_items: "{{ installed_apps }}"
register: copy_app
changed_when: copy_app.rc == 0
- include_tasks: ../../../roles/splunk_common/tasks/copy_installed_apps.yml
vars:
apps: "{{ installed_apps }}"
dest: "{{ splunk.app_paths.idxc }}"
12 changes: 12 additions & 0 deletions roles/splunk_common/tasks/copy_installed_apps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# TODO: Might be better to use synchronize here, but we'll need rsync installed
- name: "Copy installed apps to {{ dest }}"
shell:
cmd: "set -o pipefail && tar -c --exclude=local {{ item }} | tar -x -C {{ dest }}"
chdir: "{{ splunk.app_paths.default }}"
executable: /bin/bash
become: yes
become_user: "{{ splunk.user }}"
with_items: "{{ apps }}"
register: copy_app
changed_when: copy_app.rc == 0
7 changes: 2 additions & 5 deletions roles/splunk_common/tasks/disable_installed_apps.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
---
- include_tasks: find_installed_apps.yml
when: not installed_apps

- name: Disable installed_apps
- name: Disable installed apps
command: "{{ splunk.exec }} disable app {{ item }} -auth {{ splunk.admin_user }}:{{ splunk.password }}"
become: yes
become_user: "{{ splunk.user }}"
with_items: "{{ installed_apps }}"
when: installed_apps
when: installed_apps is defined and installed_apps | length > 0
2 changes: 2 additions & 0 deletions roles/splunk_common/tasks/enable_s2s.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
- include_tasks: s2s/configure_splunktcp_ssl.yml
register: splunktcp_ssl_result
when:
- "'s2s' in splunk and 'ssl' in splunk.s2s and splunk.s2s.ssl | bool"

- include_tasks: s2s/configure_splunktcp.yml
register: splunktcp_result
when:
- "'s2s' not in splunk or ('ssl' not in splunk.s2s or not splunk.s2s.ssl | bool)"
15 changes: 6 additions & 9 deletions roles/splunk_common/tasks/get_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
when:
- "splunk_forward_servers is not defined"
- "'splunk_indexer' in groups"
# Prevent self-forwarding
- splunk.role != "splunk_indexer"

# if not specified in config *and*
# no index clusters, then look for standalone
Expand All @@ -108,19 +110,14 @@
when:
- "splunk_forward_servers is not defined"
- "'splunk_standalone' in groups"
# Prevent self-forwarding
- splunk.role != "splunk_standalone"
# This part takes a little explaining. If we have a mixed cluster with no indexers
# (Only standalone and search heads) we should not automatically forward the data to
# standalone instances UNLESS they are specified by forward-servers
- "'splunk_search_head' not in groups"

# usually we can auto detect what the service name should be, but sometimes
# Usually we can auto detect what the service name should be, but sometimes
# we want to manually specify it. This is where we detect it was manually set.
- name: "Setting service_name fact from config"
set_fact:
splunk_service_name: "{{ splunk.service_name }}"
when:
- "'service_name' in splunk"

- name: "Auto Detect service_name"
- name: "Detect service name"
include_tasks: get_facts_service_name.yml
when: splunk_service_name is not defined
66 changes: 41 additions & 25 deletions roles/splunk_common/tasks/get_facts_service_name.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,48 @@
---
- name: "Setting service_name to SplunkForwarder.service"
- name: "Setting service_name fact from config"
set_fact:
splunk_service_name: "SplunkForwarder.service"
splunk_service_name: "{{ splunk.service_name }}"
when:
- splunk_service_name is not defined
- splunk.enable_service and ansible_system is match("Linux")
- splunk_systemd
- splunk.build_location is search('forwarder')
- "'service_name' in splunk"

- name: "Setting service_name to Splunkd.service"
set_fact:
splunk_service_name: "Splunkd.service"
when:
- splunk_service_name is not defined
- splunk.enable_service and ansible_system is match("Linux")
- splunk_systemd
- name: Set Splunk service name
block:
- name: Setting SplunkForwarder service
set_fact:
splunk_service_name: "SplunkForwarder.service"
when:
- ansible_system is match("Linux")
- splunk_systemd
- splunk.role == "splunk_universal_forwarder"

- name: "Setting service_name to splunkd"
set_fact:
splunk_service_name: "splunkd"
when:
- splunk_service_name is not defined
- splunk.enable_service and ansible_system is match("Linux")
- splunk_systemd is False
- name: Setting Splunkd service
set_fact:
splunk_service_name: "Splunkd.service"
when:
- ansible_system is match("Linux")
- splunk_systemd
- splunk.role != "splunk_universal_forwarder"

- name: "Setting service_name to splunkd"
set_fact:
splunk_service_name: "splunkd"
- name: Setting splunk service
set_fact:
splunk_service_name: "splunk"
when:
- ansible_system is match("Linux")
- not splunk_systemd

- name: Setting splunkforwarder Windows service
set_fact:
splunk_service_name: "splunkforwarder"
when:
- ansible_system is not match("Linux")
- splunk.role == "splunk_universal_forwarder"

- name: Setting splunkd Windows service
set_fact:
splunk_service_name: "splunkd"
when:
- ansible_system is not match("Linux")
- splunk.role != "splunk_universal_forwarder"
when:
- splunk_service_name is not defined
- splunk.enable_service and not ansible_system is match("Linux")
- splunk_service_name is not defined or not splunk_service_name
- splunk.enable_service
1 change: 1 addition & 0 deletions roles/splunk_common/tasks/install_splunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@
with_items:
- "{{ splunk.build_location }}"
- "/tmp/splunk.msi"
- splunk_downloaded_build_location
Loading

0 comments on commit d9c8af3

Please sign in to comment.