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"
|
- name: "Set privilege escalation user"
|
||||||
set_fact:
|
set_fact:
|
||||||
privileged_user: "{% if ansible_system is match('CYGWIN*|Win32NT') %}Administrator{% else %}root{% endif %}"
|
privileged_user: "{% if ansible_system is match('CYGWIN*|Win32NT') %}Administrator{% else %}root{% endif %}"
|
||||||
|
|
||||||
- name: "Check for existing installation"
|
- name: "Check for existing installation"
|
||||||
stat:
|
stat:
|
||||||
path: "{{ splunk_exec_uf }}"
|
path: /opt/splunkforwarder/bin/splunk
|
||||||
become: yes
|
become: yes
|
||||||
register: pre_existing_splunk_exec
|
register: pre_existing_splunk_exec
|
||||||
|
|
||||||
- name: "Set splunk install fact"
|
- name: "Set splunk install fact"
|
||||||
set_fact:
|
set_fact:
|
||||||
splunk_install: "{{ not pre_existing_splunk_exec.stat.exists | default(True) }}"
|
splunk_install: "{{ not pre_existing_splunk_exec.stat.exists | default(True) }}"
|
||||||
|
|
||||||
- name: "Check for existing splunk secret"
|
- name: "Check for existing splunk secret"
|
||||||
stat:
|
stat:
|
||||||
path: "{{ splunk_home_uf }}/etc/auth/splunk.secret"
|
path: "{{ splunk_home_uf }}/etc/auth/splunk.secret"
|
||||||
register: pre_existing_splunk_secret
|
register: pre_existing_splunk_secret
|
||||||
become: yes
|
become: yes
|
||||||
|
|
||||||
- name: "Set first run fact"
|
- name: "Set first run fact"
|
||||||
set_fact:
|
set_fact:
|
||||||
first_run: "{{ not pre_existing_splunk_secret.stat.exists | default(True) }}"
|
first_run: "{{ not pre_existing_splunk_secret.stat.exists | default(True) }}"
|
||||||
|
|
||||||
- name: "Set splunk_build_type fact"
|
- name: "Set splunk_build_type fact"
|
||||||
include_tasks: get_facts_build_type.yml
|
include_tasks: get_facts_build_type.yml
|
||||||
|
|
||||||
- name: "Set target version fact"
|
- name: "Set target version fact"
|
||||||
include_tasks: get_facts_target_version.yml
|
include_tasks: get_facts_target_version.yml
|
||||||
when: splunk_target_version is not defined or splunk_target_version == none
|
when: splunk_target_version is not defined or splunk_target_version == none
|
||||||
|
|
||||||
- name: "Find manifests"
|
- name: "Find manifests"
|
||||||
find:
|
find:
|
||||||
paths: "{{ splunk_home_uf }}"
|
paths: "{{ splunk_home_uf }}"
|
||||||
patterns: ".*-manifest$"
|
patterns: ".*-manifest$"
|
||||||
use_regex: yes
|
use_regex: yes
|
||||||
become: yes
|
become: yes
|
||||||
register: manifests
|
register: manifests
|
||||||
|
|
||||||
- name: "Set current version fact"
|
- name: "Set current version fact"
|
||||||
set_fact:
|
set_fact:
|
||||||
splunk_current_version: "{{ manifests.files[0].path | regex_search(regexp, '\\1') if (manifests.matched == 1) else '0' }}"
|
splunk_current_version: "{{ manifests.files[0].path | regex_search(regexp, '\\1') if (manifests.matched == 1) else '0' }}"
|
||||||
vars:
|
vars:
|
||||||
regexp: 'splunk\D*?-((\d+)\.(\d+)\.(\d+))'
|
regexp: 'splunk\D*?-((\d+)\.(\d+)\.(\d+))'
|
||||||
|
|
||||||
- name: "Setting upgrade fact"
|
- name: "Setting upgrade fact"
|
||||||
set_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) }}"
|
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"
|
- name: "Register the fact that we've gather the fact"
|
||||||
set_fact:
|
set_fact:
|
||||||
splunk_get_fact: true
|
splunk_get_fact: true
|
||||||
Loading…
Reference in new issue