Skip to content

Commit e92de87

Browse files
author
Mason Morales
authored
Merge pull request #16 from splunk/fix_splunk_use_initd
[SAS-5445] Fix issue #15 and minor cleanup in install_apps.yml
2 parents 120128d + 8ed54b7 commit e92de87

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

roles/splunk/handlers/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- ulimit -Sn 32768
1414
become: yes
1515
ignore_errors: true
16-
when: splunk_use_initd == "true" and ansible_os_family == "RedHat" and ansible_distribution_major_version|int > 6
16+
when: splunk_use_initd and ansible_os_family == "RedHat" and ansible_distribution_major_version|int > 6
1717

1818
- name: stop splunk
1919
service:

roles/splunk/tasks/configure_splunk_boot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
- name: enable splunk boot-start via initd
33
shell: "{{ splunk_home }}/bin/splunk enable boot-start -user {{ splunk_nix_user }} -systemd-managed 0 --answer-yes --auto-ports --no-prompt --accept-license"
44
become: yes
5-
when: splunk_use_initd == "true"
5+
when: splunk_use_initd
66
notify:
77
- set ulimits in init.d
88

99
- name: enable splunk boot-start via systemd
1010
shell: "{{ splunk_home }}/bin/splunk enable boot-start -user {{ splunk_nix_user }} -systemd-managed 1 --answer-yes --auto-ports --no-prompt --accept-license"
1111
become: yes
12-
when: splunk_use_initd == "false"
12+
when: not splunk_use_initd

roles/splunk/tasks/install_apps.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
- name: Trigger failure if target_shc_group_name var is undefined
2121
fail:
2222
msg: "Please add a target_shc_group_name variable to the host_vars for your SH Deployer host(s) before proceeding."
23-
when: not (target_shc_group_name is defined)
23+
when: target_shc_group_name is not defined
2424

2525
- name: Trigger failure if splunk_admin_username var is undefined
2626
fail:
2727
msg: "Please add a splunk_admin_username variable to the host_vars for your SHC hosts before proceeding."
28-
when: not (splunk_admin_username is defined)
28+
when: splunk_admin_username is not defined
2929

3030
- name: Trigger failure if splunk_admin_password var is undefined
3131
fail:
3232
msg:
3333
- "Please add a splunk_admin_password variable to the host_vars or group_vars for your SHC hosts before proceeding."
3434
- "Tip: To encrypt the var value, you can use: ansible-vault encrypt_string --ask-vault-pass 'var_value_to_encrypt' --name 'splunk_admin_password' then, use the --ask-vault-pass argument when running the play."
35-
when: not (splunk_admin_password is defined)
35+
when: splunk_admin_password is not defined
3636

3737
- name: Get SHC status from first SH under the "target_shc_group_name" inventory group specified in the shdeployer host_vars
3838
uri:
@@ -61,7 +61,6 @@
6161
- service_ready_state == false
6262

6363
when: handler == "apply shcluster-bundle"
64-
run_once: true
6564

6665
- name: "Set default restart splunk handler for all other paths (e.g. etc/auth)"
6766
set_fact:

0 commit comments

Comments
 (0)