From a64db2afecffbc30eb87b310ba5c6f32945b8240 Mon Sep 17 00:00:00 2001 From: admingit Date: Mon, 9 Dec 2024 20:48:43 +0100 Subject: [PATCH] Add_HF --- .DS_Store | Bin 10244 -> 8196 bytes Deploy_HF_Linux.yml | 7 +++ install_splunk_hf.yml | 46 ++++++++++++++++++ inventories/cluster/hosts_SPL.yml | 5 +- .../tasks/Deploy_Conf-to-hf.yml | 23 +++++++++ 5 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 Deploy_HF_Linux.yml create mode 100755 install_splunk_hf.yml create mode 100644 roles/splunk_deploy_uf/tasks/Deploy_Conf-to-hf.yml diff --git a/.DS_Store b/.DS_Store index 36e1c3efc3c57d70e901e045de8be4673a3f1ecd..eaf765f491456a9a77a3675a42e25ef8cf567321 100644 GIT binary patch delta 111 zcmZn(XmOBWU|?W$DortDU;r^WfEYvza8E20o2aMAD7!IWH$S87W*&i$%$p-cRxoW2 z7f)goWCp4M0ts#);R;f|vG6*>XK&lfNQYQZqP~7}q zco~zqG*AP`kW!#zHc-1KkS+!qln4~d0cyl$fP{ej=A~juj2j#L*aew^t^@)FZXn?b za`48&@640=WdcQ*Al}dbNi#Aq7=Y->1v0&?IY5WyO)d}=+k8OeDI+D$n7mYMEdVs= BL74ym diff --git a/Deploy_HF_Linux.yml b/Deploy_HF_Linux.yml new file mode 100644 index 0000000..334b0a1 --- /dev/null +++ b/Deploy_HF_Linux.yml @@ -0,0 +1,7 @@ +--- +- name: "Deploy Conf for Splunk UniversalForwarder Linux" + become: yes + hosts: splunk_hf_Linux + tasks: + - name: Deploy_Hf_LIN + include_tasks: roles/splunk_deploy_uf/tasks/Deploy_Conf-to-hf.yml \ No newline at end of file diff --git a/install_splunk_hf.yml b/install_splunk_hf.yml new file mode 100755 index 0000000..0dcbac0 --- /dev/null +++ b/install_splunk_hf.yml @@ -0,0 +1,46 @@ +--- +- hosts: splunk_hf_Linux + tasks: + - name: "Configuration des lvm hf" + include_tasks: roles/splunk_common_uf/tasks/pre_install_subtasks/config_lvm_uf.yml + + +- hosts: splunk_hf_Linux + tasks: + - name: Gathering Facts + include_tasks: roles/splunk_common/tasks/pre_install_subtasks/get_facts.yml + when: + - splunk_get_fact is not defined + +- hosts: splunk_hf_Linux + serial: + - 1 + - 100% + roles: + - splunk_common + tags: all,installation + +- hosts: localhost + connection: local + tasks: + - name: Cleanup secret + file: + dest: "/tmp/splunk_secret" + state: "absent" + become: yes + become_user: root + +- hosts: splunk_hf_Linux + become: true + become_user: root + tasks: + + - name: "Start Splunk via cli" + command: "{{ splunk_exec }} start --accept-license --answer-yes --no-prompt" + become: yes + become_user: "{{ privileged_user }}" + + - name: "Boot-Start Splunk via cli" + command: "{{ splunk_exec }} enable boot-start" + become: yes + become_user: "{{ privileged_user }}" diff --git a/inventories/cluster/hosts_SPL.yml b/inventories/cluster/hosts_SPL.yml index 3d89108..99840b0 100755 --- a/inventories/cluster/hosts_SPL.yml +++ b/inventories/cluster/hosts_SPL.yml @@ -25,4 +25,7 @@ SPLDSMC.jpit.com: splunk_cluster_master: hosts: - SPLCLM01.jpit.com: \ No newline at end of file + SPLCLM01.jpit.com: + splunk_hf_Linux: + hosts: + SRVHF01.jpit.com: \ No newline at end of file diff --git a/roles/splunk_deploy_uf/tasks/Deploy_Conf-to-hf.yml b/roles/splunk_deploy_uf/tasks/Deploy_Conf-to-hf.yml new file mode 100644 index 0000000..52bab68 --- /dev/null +++ b/roles/splunk_deploy_uf/tasks/Deploy_Conf-to-hf.yml @@ -0,0 +1,23 @@ +- name: Copier le répertoire dans SplunkForwarder + become: yes + become_user: "{{ privileged_user }}" + copy: + src: "{{ playbook_dir }}/Apps_for_Splunk/01-Conf_deploy_client" + dest: /opt/splunk/etc/apps/ + owner: splunk + group: splunk + +- name: "Stop Splunk via cli" + command: "{{ splunk_exec }} stop" + become: yes + become_user: "{{ splunk_user }}" + +- name: "Enable boot-start Splunk via cli" + command: "{{ splunk_exec }} enable boot-start" + become: yes + become_user: "{{ privileged_user }}" + +- name: "Start Splunk via cli" + command: "{{ splunk_exec }} start" + become: yes + become_user: "{{ privileged_user }}" \ No newline at end of file