--- - name: checking if splunk is installed tags: install stat: path: "{{ splunk_home }}" register: splunk_path - name: is splunk installed? tags: install debug: msg='splunk is already installed under /opt/splunk' when: splunk_path.stat.exists - name: Check if Splunk is already upgraded? stat: path: /opt/splunk/{{ splunk_manifest }} register: splunk_mani when: splunk_path.stat.exists - name: Splunk upgraded debug: msg: Splunk Manifest is already installed! when: splunk_mani.stat.exists - name: copy splunk binary tags: - install copy: src: "{{ splunk_archive }}" dest: /tmp/splunk mode: 775 when: splunk_path.stat.exists and not splunk_mani.stat.exists - name: Stop Splunk command: /opt/splunk/bin/splunk stop become_user: splunk when: splunk_path.stat.exists and not splunk_mani.stat.exists - name: install splunk binary tags: - install unarchive: src: "/tmp/splunk/{{ splunk_archive }}" dest: /opt/ owner: "{{ splunk_user }}" group: "{{ splunk_user }}" remote_src: true notify: Start Splunk (No Warning) when: splunk_path.stat.exists and not splunk_mani.stat.exists