From fb0a74795222751de9d4a09a7cf8faa2f98a9ae7 Mon Sep 17 00:00:00 2001 From: zyphermonkey Date: Thu, 9 Feb 2023 11:43:40 +0000 Subject: [PATCH 1/3] feat(configure_license): enable custom src vs dest Allow license files to be stored in custom src dir for better organization. Retains backwards compatability by using `default` filter. Example Var definition ```yaml splunk_license_file: - src: licenses/splunk1.lic dest: splunk1.lic - src: licenses/Splunk2.lic dest: Splunk2.lic ``` --- roles/splunk/tasks/configure_license.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/splunk/tasks/configure_license.yml b/roles/splunk/tasks/configure_license.yml index 439ed760..667bd704 100644 --- a/roles/splunk/tasks/configure_license.yml +++ b/roles/splunk/tasks/configure_license.yml @@ -21,8 +21,8 @@ - splunk_license_group=="Enterprise" - name: Copy license file copy: - src: "{{ item }}" - dest: "{{ splunk_home }}/etc/licenses/enterprise/{{ item }}" + src: "{{ item.src | default(item) }}" + dest: "{{ splunk_home }}/etc/licenses/enterprise/{{ item.dest | default(item) }}" owner: "{{ splunk_nix_user }}" group: "{{ splunk_nix_group }}" mode: "0600" From e627147d3af08176458c3f650cb5a7876c96d340 Mon Sep 17 00:00:00 2001 From: zyphermonkey Date: Thu, 9 Feb 2023 11:44:33 +0000 Subject: [PATCH 2/3] fix(configure_license): restart required to apply new license(s) --- roles/splunk/tasks/configure_license.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/splunk/tasks/configure_license.yml b/roles/splunk/tasks/configure_license.yml index 667bd704..21e74273 100644 --- a/roles/splunk/tasks/configure_license.yml +++ b/roles/splunk/tasks/configure_license.yml @@ -28,6 +28,7 @@ mode: "0600" loop: "{{ splunk_license_file }}" become: yes + notify: restart splunk when: - splunk_license_group=="Enterprise" - name: "Remove {{ mode_option }} when using local license" From 376470e79e17dd36ec6fdb057ed75cf24aa9bed3 Mon Sep 17 00:00:00 2001 From: zyphermonkey Date: Thu, 9 Feb 2023 12:24:48 +0000 Subject: [PATCH 3/3] fix(configure_license): ensure pass4SymmKey is set on licensemaster pass4SymmKey needs to match on peers and licensemaster --- roles/splunk/tasks/configure_license.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/roles/splunk/tasks/configure_license.yml b/roles/splunk/tasks/configure_license.yml index 21e74273..3234c246 100644 --- a/roles/splunk/tasks/configure_license.yml +++ b/roles/splunk/tasks/configure_license.yml @@ -51,6 +51,18 @@ group: "{{ splunk_nix_group }}" become: yes notify: restart splunk + - name: Set pass4SymmKey on LM + ini_file: + path: "{{ splunk_home }}/etc/system/local/server.conf" + section: general + option: pass4SymmKey + value: "{{ splunk_general_key }}" + owner: "{{ splunk_nix_user }}" + group: "{{ splunk_nix_group }}" + become: yes + notify: restart splunk + when: + - splunk_license_group=="Enterprise" when: - not splunk_license_group=="Peer" - splunk_install_type=="full"