Merge pull request 'Mise à jour de 'roles/splunk_common_uf/tasks/pre_install_subtasks/get_facts.yml'' (#8) from main into master
Reviewed-on: #8main
commit
9e03540838
@ -1,53 +1,53 @@
|
||||
---
|
||||
- name: "Set privilege escalation user"
|
||||
set_fact:
|
||||
privileged_user: "{% if ansible_system is match('CYGWIN*|Win32NT') %}Administrator{% else %}root{% endif %}"
|
||||
|
||||
- name: "Check for existing installation"
|
||||
stat:
|
||||
path: "{{ splunk_exec_uf }}"
|
||||
become: yes
|
||||
register: pre_existing_splunk_exec
|
||||
|
||||
- name: "Set splunk install fact"
|
||||
set_fact:
|
||||
splunk_install: "{{ not pre_existing_splunk_exec.stat.exists | default(True) }}"
|
||||
|
||||
- name: "Check for existing splunk secret"
|
||||
stat:
|
||||
path: "{{ splunk_home_uf }}/etc/auth/splunk.secret"
|
||||
register: pre_existing_splunk_secret
|
||||
become: yes
|
||||
|
||||
- name: "Set first run fact"
|
||||
set_fact:
|
||||
first_run: "{{ not pre_existing_splunk_secret.stat.exists | default(True) }}"
|
||||
|
||||
- name: "Set splunk_build_type fact"
|
||||
include_tasks: get_facts_build_type.yml
|
||||
|
||||
- name: "Set target version fact"
|
||||
include_tasks: get_facts_target_version.yml
|
||||
when: splunk_target_version is not defined or splunk_target_version == none
|
||||
|
||||
- name: "Find manifests"
|
||||
find:
|
||||
paths: "{{ splunk_home_uf }}"
|
||||
patterns: ".*-manifest$"
|
||||
use_regex: yes
|
||||
become: yes
|
||||
register: manifests
|
||||
|
||||
- name: "Set current version fact"
|
||||
set_fact:
|
||||
splunk_current_version: "{{ manifests.files[0].path | regex_search(regexp, '\\1') if (manifests.matched == 1) else '0' }}"
|
||||
vars:
|
||||
regexp: 'splunk\D*?-((\d+)\.(\d+)\.(\d+))'
|
||||
|
||||
- name: "Setting upgrade fact"
|
||||
set_fact:
|
||||
splunk_upgrade: "{{ splunk_build_location_uf and not splunk_install and splunk_target_version and splunk_target_version != splunk_current_version | default(False) }}"
|
||||
|
||||
- name: "Register the fact that we've gather the fact"
|
||||
set_fact:
|
||||
---
|
||||
- name: "Set privilege escalation user"
|
||||
set_fact:
|
||||
privileged_user: "{% if ansible_system is match('CYGWIN*|Win32NT') %}Administrator{% else %}root{% endif %}"
|
||||
|
||||
- name: "Check for existing installation"
|
||||
stat:
|
||||
path: /opt/splunkforwarder/bin/splunk
|
||||
become: yes
|
||||
register: pre_existing_splunk_exec
|
||||
|
||||
- name: "Set splunk install fact"
|
||||
set_fact:
|
||||
splunk_install: "{{ not pre_existing_splunk_exec.stat.exists | default(True) }}"
|
||||
|
||||
- name: "Check for existing splunk secret"
|
||||
stat:
|
||||
path: "{{ splunk_home_uf }}/etc/auth/splunk.secret"
|
||||
register: pre_existing_splunk_secret
|
||||
become: yes
|
||||
|
||||
- name: "Set first run fact"
|
||||
set_fact:
|
||||
first_run: "{{ not pre_existing_splunk_secret.stat.exists | default(True) }}"
|
||||
|
||||
- name: "Set splunk_build_type fact"
|
||||
include_tasks: get_facts_build_type.yml
|
||||
|
||||
- name: "Set target version fact"
|
||||
include_tasks: get_facts_target_version.yml
|
||||
when: splunk_target_version is not defined or splunk_target_version == none
|
||||
|
||||
- name: "Find manifests"
|
||||
find:
|
||||
paths: "{{ splunk_home_uf }}"
|
||||
patterns: ".*-manifest$"
|
||||
use_regex: yes
|
||||
become: yes
|
||||
register: manifests
|
||||
|
||||
- name: "Set current version fact"
|
||||
set_fact:
|
||||
splunk_current_version: "{{ manifests.files[0].path | regex_search(regexp, '\\1') if (manifests.matched == 1) else '0' }}"
|
||||
vars:
|
||||
regexp: 'splunk\D*?-((\d+)\.(\d+)\.(\d+))'
|
||||
|
||||
- name: "Setting upgrade fact"
|
||||
set_fact:
|
||||
splunk_upgrade: "{{ splunk_build_location_uf and not splunk_install and splunk_target_version and splunk_target_version != splunk_current_version | default(False) }}"
|
||||
|
||||
- name: "Register the fact that we've gather the fact"
|
||||
set_fact:
|
||||
splunk_get_fact: true
|
||||
Loading…
Reference in new issue