Last active
April 11, 2018 18:20
-
-
Save michaelgugino/795024043ab34a1596fd21078a96be6e to your computer and use it in GitHub Desktop.
Something better than what I was given.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: all # Never a good idea to use all group unless testing | |
sudo: yes # don't do this, use inventory to set the ansible_become=True variable. | |
tasks: | |
- name: Cat inputs out of splunk in opt | |
slurp: | |
src: "{{ splunk_inputs_file }}" | |
register: splunk_inputs_file_slurp | |
when: | |
- ansible_distribution == 'RedHat' | |
vars: | |
file1: "/opt/splunkforwarder/etc/system/local/inputs.conf" | |
file2: "/app/splunkforwarder/etc/system/local/inputs.conf" | |
splunk_inputs_file: "{{ (ansible_distribution_major_version == '7' | bool) | ternary(file1, file2) }}" | |
- debug: | |
var: file_content_decoded | |
vars: | |
file_content_decoded: "{{ splunk_inputs_file_slurp.content | b64decode }}" | |
when: | |
- splunk_inputs_file_slurp is defined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment