Skip to content

Commit

Permalink
Merge pull request #67 from splunk/update_deploymentclient
Browse files Browse the repository at this point in the history
Add support for phoneHomeIntervalInSecs and deployment pass4SymmKey
  • Loading branch information
Mason Morales authored Apr 29, 2021
2 parents 0c3912c + 7a4de90 commit 3b04101
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 12 deletions.
2 changes: 2 additions & 0 deletions roles/splunk/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ splunk_uri_lm: undefined
splunk_uri_cm: undefined
splunk_uri_ds: undefined # e.g. mydeploymentserver.mydomain.com:8089 ; Note that you must also configure the clientName var under either group_vars or host_vars for deploymentclient.conf to be configured
clientName: undefined
phoneHomeIntervalInSecs: undefined
splunk_ds_key: undefined # Configures a pass4SymmKey in server.conf for authenticating against a deployment server
splunk_admin_username: admin
splunk_admin_password: undefined # Use ansible-vault encrypt_string, e.g. ansible-vault encrypt_string --ask-vault-pass 'var_value_to_encrypt' --name 'var_name'
splunk_configure_secret: false # If set to true, you need to update files/splunk.secret
Expand Down
54 changes: 47 additions & 7 deletions roles/splunk/tasks/configure_deploymentclient.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,52 @@
---
- name: Create deploymentclient.conf config
template:
src: deploymentclient.conf.j2
dest: "{{ splunk_home }}/etc/system/local/deploymentclient.conf"
- name: Configure DS URI in deploymentclient.conf
ini_file:
path: "{{ splunk_home }}/etc/system/local/deploymentclient.conf"
section: 'target-broker:deploymentServer'
option: targetUri
value: "{{ splunk_uri_ds }}"
owner: "{{ splunk_nix_user }}"
group: "{{ splunk_nix_group }}"
mode: 0644
become: true
notify: restart splunk
when:
- clientName != 'undefined'
- splunk_uri_ds != 'undefined'
when: splunk_uri_ds != 'undefined'

- name: Configure client name in deploymentclient.conf
ini_file:
path: "{{ splunk_home }}/etc/system/local/deploymentclient.conf"
section: 'deployment-client'
option: clientName
value: "{{ clientName }}"
owner: "{{ splunk_nix_user }}"
group: "{{ splunk_nix_group }}"
mode: 0644
become: true
notify: restart splunk
when: clientName != 'undefined'

- name: Configure phoneHomeIntervalInSecs in deploymentclient.conf
ini_file:
path: "{{ splunk_home }}/etc/system/local/deploymentclient.conf"
section: deployment-client
option: phoneHomeIntervalInSecs
value: "{{ phoneHomeIntervalInSecs }}"
owner: "{{ splunk_nix_user }}"
group: "{{ splunk_nix_group }}"
mode: 0644
become: true
notify: restart splunk
when: phoneHomeIntervalInSecs != 'undefined'

- name: Configure deployment server pass4SymmKey in server.conf
ini_file:
path: "{{ splunk_home }}/etc/system/local/server.conf"
section: deployment
option: pass4SymmKey
value: "{{ splunk_ds_key }}"
owner: "{{ splunk_nix_user }}"
group: "{{ splunk_nix_group }}"
mode: 0644
become: true
notify: restart splunk
when: splunk_ds_key != 'undefined'
5 changes: 0 additions & 5 deletions roles/splunk/templates/deploymentclient.conf.j2

This file was deleted.

0 comments on commit 3b04101

Please sign in to comment.