You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to set up a universal forwarder where I have two forward_servers defined. The scripts are failing because they now try to do this before splunk is started.
in roles/splunk_common_tasks/main.yml line 111:
# Generate outputs.conf before splunk starts to prevent data being indexed locally
- include_tasks: enable_forwarding.yml
when:
# Indexers should never forward
- splunk.role != "splunk_indexer"
- (splunk.role != "splunk_standalone" and splunk.role != "splunk_search_head") or
(splunk_indexer_cluster | bool or splunk_forward_servers is defined)
then in roles/splunk_common/tasks/enable_forwarding.yml line 68:
# set up forward servers set by get_facts
- name: Add forward_servers
include_tasks: ../../../roles/splunk_common/tasks/add_forward_server.yml
vars:
forward_servers: "{{ splunk_forward_servers }}"
when:
- not splunk_indexer_cluster | bool
- splunk_forward_servers is defined
and finally in roles/splunk_common/tasks/add_forward_server.yml line 2:
- name: "Enable forwarding to {{ forward_servers }}"
command: "{{ splunk.exec }} add forward-server {{ item }}:{{ splunk.s2s.port if splunk.s2s.port is defined else splunk.s2s_port }} -auth {{ splunk.admin_user }}:{{ splunk.password }} --accept-license --answer-yes --no-prompt"
become: yes
become_user: "{{ splunk.user }}"
with_items: "{{ forward_servers }}"
register: forward_status
when: '("s2s" not in splunk and "s2s_port" in splunk) or ("s2s" in splunk and ("ssl" not in splunk.s2s or ("ssl" in splunk.s2s and not splunk.s2s.ssl))) | bool'
changed_when:
- "'Added forwarding to: ' in forward_status.stdout"
- "'forwarded-server already present' not in forward_status.stderr"
failed_when:
- forward_status.rc != 0
- "'forwarded-server already present' not in forward_status.stderr"
no_log: "{{ hide_password }}"
I can try to submit a PR to fix it, but I want to know what direction to go before I make it. Should I move the add_forward_server to after splunk starts so that we can continue to use the splunk binary to add the forward servers, or should I change it to edit the outputs.conf directly?
The text was updated successfully, but these errors were encountered:
I am trying to set up a universal forwarder where I have two forward_servers defined. The scripts are failing because they now try to do this before splunk is started.
in roles/splunk_common_tasks/main.yml line 111:
then in roles/splunk_common/tasks/enable_forwarding.yml line 68:
and finally in roles/splunk_common/tasks/add_forward_server.yml line 2:
I can try to submit a PR to fix it, but I want to know what direction to go before I make it. Should I move the add_forward_server to after splunk starts so that we can continue to use the splunk binary to add the forward servers, or should I change it to edit the outputs.conf directly?
The text was updated successfully, but these errors were encountered: