When I tried to install the Linux instance, I got the following problem:
TASK [linux_universal_forwarder : setup to start at boot] ********************** │ fatal: [x.x.x.x]: FAILED! => {"changed": true, "cmd": ["/opt/splunkforwarder/bin/splunk", "enable", "boot-start"], "delta": "0:00:00.025995", "end": "2023-01-27 16:43:58.761699", "msg": "non-zero return code", "rc": 255, "start":"2023-01-27 16:43:58.735704", "stderr": "splunk is currently running, please stop it before running enable/disable boot-start", "stderr_lines": ["splunk is currently running, please stop it before running enable/disable boot-start"], "stdout": "", "stdout_lines": []}
My workaround:
In /attack_range/packer/ansible/roles/linux_universal_forwarder/tasks/install_universal_forwarder.yml, I changed:
- name: setup to start at boot become: true command: "/opt/splunkforwarder/bin/splunk enable boot-start -user splunk"
Working on 992e107.
When I tried to install the Linux instance, I got the following problem:
TASK [linux_universal_forwarder : setup to start at boot] **********************
│ fatal: [x.x.x.x]: FAILED! => {"changed": true, "cmd": ["/opt/splunkforwarder/bin/splunk", "enable", "boot-start"], "delta": "0:00:00.025995", "end": "2023-01-27 16:43:58.761699", "msg": "non-zero return code", "rc": 255, "start":"2023-01-27 16:43:58.735704", "stderr": "splunk is currently running, please stop it before running enable/disable boot-start", "stderr_lines": ["splunk is currently running, please stop it before running enable/disable boot-start"], "stdout": "", "stdout_lines": []}
My workaround: In
/attack_range/packer/ansible/roles/linux_universal_forwarder/tasks/install_universal_forwarder.yml
, I changed:- name: setup to start at boot
become: true
command: "/opt/splunkforwarder/bin/splunk enable boot-start -user splunk"
To:
- name: Stop splunk uf
become: true
command: "/opt/splunkforwarder/bin/splunk stop"
- name: setup to start at boot
become: true
command: "/opt/splunkforwarder/bin/splunk enable boot-start -user splunk"
- name: Start splunk uf
become: true
command: "/opt/splunkforwarder/bin/splunk start"