Skip to content

Commit

Permalink
fix(configure_license): use version_compare (#172)
Browse files Browse the repository at this point in the history
* fix(configure_license): use version_compare

comparing float doesn't work with MAJOR.MINOR.PATCH semantic versioning Splunk uses.
  • Loading branch information
zyphermonkey authored Feb 8, 2023
1 parent 342a9a9 commit df95bf3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions roles/splunk/tasks/configure_license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

- name: Setting licensing mode based on Splunk version number
set_fact:
mode_option: "{% if splunk_version_release | float < 9.0 %}master{% else %}manager{% endif %}_uri"
mode_option: "{{ splunk_version_release is version('9.0', '<') | ternary('master_uri', 'manager_uri') }}"

- name: Configure Local License
block:
Expand All @@ -30,7 +30,7 @@
become: yes
when:
- splunk_license_group=="Enterprise"
- name: Remove master_uri when using local license
- name: "Remove {{ mode_option }} when using local license"
ini_file:
path: "{{ splunk_home }}/etc/system/local/server.conf"
section: license
Expand All @@ -56,7 +56,7 @@

- name: Configure License Peer
block:
- name: Set license master_uri
- name: "Set license {{ mode_option }}"
ini_file:
path: "{{ splunk_home }}/etc/system/local/server.conf"
section: license
Expand Down

0 comments on commit df95bf3

Please sign in to comment.