Deployment Architecture

docker installed splunkforwarder config help in ansible deployment

Telstra_rdavis
New Member

I have a SUF installed in a docker container and all works OK It is deployed via Ansible. A snip of my Ansible playbook:
*- name: Start Splunk Forwarder container
docker_container:
name: splunk_uf
image: "{{ registry_url}}/splunkuniversalforwarder:7.3"
state: started
hostname: "{{ fqdn }}"
volumes:
- /home/app:/home/app
- /var/log:/var/log
published_ports:
- "9997:9997"
env:
SPLUNK_START_ARGS: "--accept-license"
SPLUNK_PASSWORD: "{{ splunk_forwarder_password }}"

SPLUNK_DEPLOYMENT_SERVER: "{{ splunk_dep_serv }}"*

It builds a deploymentclient.conf file like this:
*[target-broker:deploymentServer]

targetUri = deploymentserver.com:8089*

My splunk guys say it needs to be like this:
*[target-broker:deploymentServer]
targetUri = deploymentserver.com:8089
[deployment-client]
clientName = SPLUNK-APP-NET-$HOSTNAME

disabled=false*

So my question is:
How do I get the [deployment-client] part of the file built with my Ansible playbook?

Thanks in advance,
Rob

0 Karma

DevProfile101
Loves-to-Learn

From your ansible playbook create a new play that will execute a script and the script will append the configuration to deploymentclient.conf 

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...