Commit f7d470f9 by Cory Lee

OPS-2532 Install jenkins app on splunk via ansible. Provide mechanism for…

OPS-2532 Install jenkins app on splunk via ansible. Provide mechanism for installing more splunk apps in the future.
parent d99e8789
......@@ -70,6 +70,21 @@ SPLUNK_DASHBOARDS: []
# e.g.
# - {{ role_path }}/../../../secure-repo/path/to/templates/template.xml.j2
SPLUNK_APP_S3_PATH: 's3://edx-splunk/apps'
SPLUNK_APP_DOWNLOAD_PATH: "{{ splunk_home }}/etc/apps/app_downloads"
# Source bucket for splunk apps
SPLUNK_APP_TARS:
- file_name: "splunk-app-for-jenkins_107.tgz"
md5sum: "253385a0a68caea04e81fdb4d3083dd9"
# A list of dicts that contains tars of splunk apps to install, and their md5sum
# Download new apps from splunkbase(includes md5 hash):
# https://splunkbase.splunk.com/apps/
# Put them in SPLUNK_APP_S3_PATH
# Add an entry to this dict
# Apps will be installed if md5sum is correct, otherwise the task will fail
# See https://docs.splunk.com/Documentation/UnixApp/5.2.3/User/InstalltheSplunkAppforUnixandLinux#Install_the_Splunk_App_for_Unix_and_Linux_from_the_command_line
SPLUNK_ALERT_DEFAULT_SEVERITY: "3"
......
......@@ -37,17 +37,17 @@
- "{{ splunk_home }}/{{ splunk_cert_path }}"
- "{{ splunk_home }}/etc/system/local"
- name: Write SSL certs to disk
copy:
dest: "{{ splunk_home }}/{{ splunk_cert_path }}/{{ item.0 }}"
content: "{{ item.1 }}"
owner: splunk
group: splunk
mode: "0400"
when: SPLUNK_SSL_CERT is defined and SPLUNK_SSL_CERT | length > 0
with_together:
- [forwarder.pem, cacert.pem]
- ["{{ SPLUNK_SSL_CERT }}", "{{ SPLUNK_SSL_ROOT_CA }}"]
# - name: Write SSL certs to disk
# copy:
# dest: "{{ splunk_home }}/{{ splunk_cert_path }}/{{ item.0 }}"
# content: "{{ item.1 }}"
# owner: splunk
# group: splunk
# mode: "0400"
# when: SPLUNK_SSL_CERT is defined and SPLUNK_SSL_CERT | length > 0
# with_together:
# - [forwarder.pem, cacert.pem]
# - ["{{ SPLUNK_SSL_CERT }}", "{{ SPLUNK_SSL_ROOT_CA }}"]
- name: Create inputs configuration
template:
......@@ -160,6 +160,44 @@
- "install"
- "install:configuration"
- name: create app download directory
file:
path: "{{ SPLUNK_APP_DOWNLOAD_PATH }}"
owner: "{{ splunk_user }}"
group: "{{ splunk_user }}"
mode: 0755
state: directory
tags:
- install
- install:configuration
- name: download app tars
shell: "aws s3 cp {{ SPLUNK_APP_S3_PATH }}/{{ item.file_name }} {{ SPLUNK_APP_DOWNLOAD_PATH }}/{{ item.file_name }}"
tags:
- install
- install:configuration
with_items:
- "{{ SPLUNK_APP_TARS }}"
- name: verify app checksums
shell: "echo \"{{ item.md5sum }} {{ SPLUNK_APP_DOWNLOAD_PATH }}/{{ item.file_name }}\" | md5sum -c --status"
tags:
- install
- install:configuration
with_items:
- "{{ SPLUNK_APP_TARS }}"
- name: install apps
unarchive:
copy: no
src: "{{ SPLUNK_APP_DOWNLOAD_PATH }}/{{ item.file_name }}"
dest: "{{ splunk_home }}/etc/apps"
tags:
- install
- install:configuration
with_items:
- "{{ SPLUNK_APP_TARS }}"
- name: restart splunk
service:
name: splunk
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment