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 }}"
It builds a deploymentclient.conf file like this:
*[target-broker:deploymentServer]
My splunk guys say it needs to be like this:
*[target-broker:deploymentServer]
targetUri = deploymentserver.com:8089
[deployment-client]
clientName = SPLUNK-APP-NET-$HOSTNAME
So my question is:
How do I get the [deployment-client] part of the file built with my Ansible playbook?
Thanks in advance,
Rob
From your ansible playbook create a new play that will execute a script and the script will append the configuration to deploymentclient.conf