Comments (3)
So, I actually did a POC playbook for this last year that we may be able to reuse and incorporate into this role. There are some drawbacks and constraints to pulling apps from Splunkbase, namely:
- Apps can be removed or retired from Splunkbase.
- Splunkbase does not offer service accounts so a personal login is required to authenticate for downloads.
- Splunkbase does not provide a way to pull the "latest" version. You have to specify the version number of each app/addon that you want to download.
- Splunkbase download URLs are not human readable (e.g. TA NIX is only identified as "833") so we may want to include an extra var in Ansible with the human readable app name for our own sanity.
- Downloading and installing straight from Splunkbase may be undesirable in some cases (e.g. if you want to disable/enable inputs, change index names, or customize anything before deploying).
All that said, this is possible. Here's the POC playbook that I wrote for reference:
# ansible-playbook --connection=local --inventory 127.0.0.1, install_splunkbase_app_rest.yml
- hosts:
- localhost
gather_facts: no
vars:
- splunkbase_username: [email protected]
- splunkbase_password: somepassword
- splunkbase_auth_url: https://splunkbase.splunk.com/api/account:login/
- splunk_host: mysplunkhost
- splunk_user: admin
- splunk_password: somepassword
- app_url: https://splunkbase.splunk.com/app/833/release/8.1.0/download
tasks:
- name: Get splunkbase authentication token
uri:
url: "{{ splunkbase_auth_url }}"
method: POST
return_content: yes
body_format: form-urlencoded
body:
username: "{{ splunkbase_username }}"
password: "{{ splunkbase_password }}"
register: login
- name: Create splunkbase_token var
set_fact:
splunkbase_token: "{{ login.content | regex_search('<id>(.*)<\\/id>', '\\1' ) | first }}"
- name: Install Splunkbase app
uri:
url: "https://{{ splunk_host }}:8089/services/apps/local"
method: POST
user: "{{ splunk_user }}"
password: "{{ splunk_password }}"
validate_certs: false
body:
name: "{{ app_url }}"
update: "true"
filename: "true"
auth: "{{ splunkbase_token }}"
body_format: "form-urlencoded"
status_code: [ 200, 201 ]
timeout: 300
when:
- "'splunkbase.splunk.com' in app_url"
- splunkbase_token is defined
- splunkbase_token != None
from ansible-role-for-splunk.
One consideration for implementing this task: We will likely want to support installing apps from both Splunkbase and from Git on the same host.
from ansible-role-for-splunk.
For splunkbase url you can do https://splunkbase.splunk.com/apps/id/lookup_editor to get the app number
from ansible-role-for-splunk.
Related Issues (20)
- Unable to set pass4SymmKey on license manager
- Add support for multiple deployment tasks HOT 3
- splunk_nix_group not assigned as primary in install_splunk.yml HOT 1
- How to use ansible-role-for-splunk in your playbooks? HOT 3
- How to install a distributed deployment? HOT 4
- The installation of multiple hosts that are mixed Universal Forwarder and Full installation does not work and only full is performed. HOT 1
- Newest version published on Galaxy is 1.0.5
- Stuck on configure_license.yml HOT 9
- Issues Installing Universal Forwarder
- How to deploy apps without deleting local/ files HOT 3
- configure_dmc.yml failing with error HOT 1
- configure_idxc_sh and configure_idxc_member are hard coded for master_uri HOT 2
- Question about app deployment/sync HOT 2
- Setting a DS Key should change broker requireauth to true
- Splunk 9.1.1 on RHEL 9
- .bashrc Cannot find expected file ...literals.py
- Cluster deployment fails in configure_dmc.yml
- configure_shc_captain fails with no attribute
- configure_dmc.yml breaks Cluster Manager config if DMC runs on CM HOT 1
- configure_dmc.yml - multiple issues in "Configure systems as search peers to be monitored except indexers" task
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-role-for-splunk.