Skip to content

Conversation

@nwang92
Copy link
Contributor

@nwang92 nwang92 commented Apr 13, 2020

This should fix + add support for #426 and #375

@nwang92
Copy link
Contributor Author

nwang92 commented Apr 13, 2020

Adding some more context behind this PR.

This changes some of the type handling that splunk.conf supports. In the currently published form, splunk.conf is a dict that looks something like:

conf:
    user-prefs:
      directory: /opt/splunk/etc/users/admin/user-prefs/local
      content:
        general:
          default_namespace: appboilerplate
          search_syntax_highlighting: dark
          search_assistant:
        "serverClass:secrets:app:test": {}

Maps can't be used to achieve the goal of #426, so instead we should be accepting an array. The new schema for this will look like:

conf:
  - key: user-prefs
    value:
       directory: /opt/splunk/etc/users/admin/user-prefs/local
       content:
         general:
           default_namespace: appboilerplate
           search_syntax_highlighting: dark
           search_assistant:
         "serverClass:secrets:app:test": {}

This isn't the desired schema I'd ordinarily go with, but it actually makes support for both dict and array inputs easier which is probably best for backwards compatibility. If splunk.conf is of the original dict type, we can use Ansible's dict2items filter to convert it to the aforementioned array.

I also added support for empty stanzas as seen with "serverClass:secrets:app:test": {} which should address #375

@nwang92 nwang92 merged commit 5d88b95 into develop Apr 14, 2020
@nwang92 nwang92 deleted the bugfix/support-conf-array branch April 14, 2020 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants