splunk / splunk/docker-splunk

Conf setting is duplicating configuration

Open
#601 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
549
Forks
277
Avg merge
3d 9h
Merged PRs (30d)
2

Description

Issue

When you want to set a configuration using the default.yml - configuration-files option the resulting Splunk configuration is broken as options are duplicated:

[kvstore]
storageEngine = wiredTiger
storageEngine

Splunk image: splunk/splunk:9.0.5@sha256:aa74f1f9dbe37eb8710ad79bd5c0ce5229b236c737a8a3aa4143dc9c4023ae7f

Replication:

  1. Spawn a Splunk with a config setting in the default.yml - here is an example:
splunk:
  conf:
    - key: server
      value:
        directory: /opt/splunk/etc/system/local
        content:
          kvstore:
            storageEngine: wiredTiger
  1. Start the Splunk container
  2. Check the /opt/splunk/etc/system/local/server.conf file - everything should be fine
  3. Stop container
  4. Start container
  5. Check the /opt/splunk/etc/system/local/server.conf file - now you will see duplicated and empty keys without values

Debugging

I tried to figure out why this happens - IMHO this seems to be a bug in the shipped Ansible/ini_file module.
I use this setting quite frequently and never had any issue with this in the older releases.

In addition I noticed that this is only possible because the allow_no_value was explicitly for false to true - see set_config_stanza.yml#L21. I am not sure why this was done as I cannot think of any Splunk configuration that would utilize this option.

Can you please have a look?
If you need further information just let me know!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with roles/splunk_common/tasks/set_config_stanza.yml, especially the allow_no_value setting linked in the issue. Reproduce the configuration from the default.yml example, restart the Splunk container, and compare server.conf before and after. Done means the configured kvstore stanza retains its value without duplicated or empty keys after restart.

Written by the indexing model from the issue text.

Assessment

Tech stack
ansible, docker
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.