splunk / splunk-ansible

Ansible playbooks for configuring and managing Splunk Enterprise and Universal Forwarder deployments

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cluster Master doesn't run set_deployment_client

auzroz opened this issue · comments

The splunk_cluster_master role doesn't run a set_deployment_client task. Ironically, indexers do though. In our configuration, we load apps from the DS to the CM.

I think we can add support for this, with the caveat that apps installed on the CM through the DS will be placed into /opt/splunk/etc/deployment-apps, which means that the CM will not distribute apps to any downstream indexers.

Why would we need to caveat that? The Cluster Master should just have a simple deploymentclient configuration generated and then allow the Deployment Server to handle the locations of the deployed files.

Snippets from current environment:

[serverClass:Cluster Master]
whitelist.0 = *cluster_master*
issueReload=true
restartIfNeeded=true
[serverClass:Cluster Master:app:Splunk_TA_nix]
[serverClass:Cluster Master Master-Apps]
stateOnClient = noop
excludeFromUpdate = $app_root$/default/inputs.conf
excludeFromUpdate = $app_root$/default/indexes.conf
targetRepositoryLocation = $SPLUNK_HOME/etc/master-apps
whitelist.0 = *cluster_master*
[serverClass:Cluster Master Master-Apps:app:Splunk_TA_nix]

Here is the ansible pre-task I am running to patch it:

- name: "add deployment client to cluster master"
  become: yes
  become_user: root
  lineinfile:
    path: /opt/ansible/roles/splunk_cluster_master/tasks/main.yml
    insertbefore: "^- include_tasks: setup_multisite.yml"
    line: |-
      - include_tasks: ../../../roles/splunk_common/tasks/set_as_deployment_client.yml
        when:
          - splunk.deployment_server is defined
          - splunk.deployment_server
          - not splunk_indexer_cluster | bool

Gotcha - in that case, it should work for your use case. I was referring to the default, out-of-the-box use of the deployment server will treat all clients the same. I can add that play in.