Prompt Title: Help Request Received

Created 9 months ago
Votes 0
Views 115 times
0

Prompt Detail:

Here's an example Ansible playbook to install Splunk on a Linux virtual machine:

  1. Create a file named install_splunk.yml:
yaml
--- - name: Install Splunk hosts: your_vm become: true tasks: - name: Download Splunk package get_url: url: "https://download.splunk.com/products/splunk/releases/{{ splunk_version }}/linux/splunk-{{ splunk_version }}-{{ splunk_build }}-linux-2.6-amd64.deb" dest: "/tmp/splunk-{{ splunk_version }}-{{ splunk_build }}-linux-2.6-amd64.deb" - name: Install Splunk package apt: deb: "/tmp/splunk-{{ splunk_version }}-{{ splunk_build }}-linux-2.6-amd64.deb" state: present - name: Start Splunk command: "/opt/splunk/bin/splunk start --accept-license --answer-yes --auto-ports --no-prompt" - name: Set admin password shell: "/opt/splunk/bin/splunk edit user admin -password {{ splunk_admin_password }} -auth admin:changeme"
  1. Create a file named hosts to specify the target VM:
csharp
[your_vm] your_vm_ip_address
  1. Run the playbook:
bash
ansible-playbook -i hosts install_splunk.yml --extra-vars "splunk_version=8.2.2 splunk_build=9ae0b036e1db splunk_admin_password=your_admin_password"

Make sure to replace your_vm_ip_address with the IP address of your Linux virtual machine and your_admin_password with the desired admin password for Splunk.

This playbook will download the specified version and build of Splunk for Linux, install it, and start the Splunk service. The --accept-license, --answer-yes, and --auto-ports options in the splunk start command automatically accept the Splunk license, answer "yes" to prompts, and configure Splunk to use automatic port assignment respectively. The --no-prompt option prevents the need for user interaction during the installation.

avatar
PraveenKumar
Shared 1 prompt
Created 9 months ago

Leave a Comment

Related Tag Prompts

0
0
add newuser
1 year ago 2023-04-13 11:58:49 nags
0
0
another1 related useradd
1 year ago 2023-04-13 11:59:33 nags
0
0
Ansible
11 months ago 2023-05-16 11:30:00 Envy
0
0
RPM Summary Script
9 months ago 2023-07-12 19:27:33 Anthony Barnett