diff --git a/Deploy_Splunk.yml b/Deploy_Splunk.yml new file mode 100644 index 0000000..c606e79 --- /dev/null +++ b/Deploy_Splunk.yml @@ -0,0 +1,14 @@ +--- +- name: "Deploy Configuration for Instance Splunk" + become: yes + hosts: all:!splunk_uf_Linux + tasks: + - name: Deploy_Configuration + include_tasks: roles/splunk_deploy/tasks/Deploy_Conf-to-Splunk.yml + +- name: "Deploy Configuration for Instance Splunk DSMC" + become: yes + hosts: splunk_deployement_TIC + tasks: + - name: Deploy_Configuration + include_tasks: roles/splunk_deploy/tasks/Deploy_Conf_DSMC.yml \ No newline at end of file diff --git a/roles/splunk_deploy/tasks/Deploy_Conf-to-Splunk.yml b/roles/splunk_deploy/tasks/Deploy_Conf-to-Splunk.yml new file mode 100644 index 0000000..ca515a7 --- /dev/null +++ b/roles/splunk_deploy/tasks/Deploy_Conf-to-Splunk.yml @@ -0,0 +1,22 @@ +--- +- name: Copier le configuration DS dans Splunk + 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: "{{ privileged_user }}" + +- name: "Enable boot-start Splunk via cli" + shell: "/opt/splunk/bin/splunk enable boot-start" + +- name: "Start Splunk via cli" + command: "{{ splunk_exec }} start" + become: yes + become_user: "{{ privileged_user }}" \ No newline at end of file diff --git a/roles/splunk_deploy/tasks/Deploy_Conf_DSMC.yml b/roles/splunk_deploy/tasks/Deploy_Conf_DSMC.yml new file mode 100644 index 0000000..9b17af8 --- /dev/null +++ b/roles/splunk_deploy/tasks/Deploy_Conf_DSMC.yml @@ -0,0 +1,47 @@ +--- +- name: Copie de la configuration du DSMC + become: yes + become_user: "{{ privileged_user }}" + tasks: + - name: Copier configuration serverClass sur le DS + copy: + src: "{{ playbook_dir }}/Apps_for_Splunk/01-Conf_ServerClass" + dest: /opt/splunk/etc/apps/ + owner: splunk + group: splunk + - name: Copier configuration cluster_SH sur le DS + copy: + src: "{{ playbook_dir }}/Apps_for_DS/02-M-TIC_sh_cluster_base" + dest: /opt/splunk/etc/apps/ + owner: splunk + group: splunk + - name: Copier configuration deployer sur le DS + copy: + src: "{{ playbook_dir }}/Apps_for_DS/02-M-TIC_deployer_base" + dest: /opt/splunk/etc/apps/ + owner: splunk + group: splunk + - name: Copier configuration volume_sh sur le DS + copy: + src: "{{ playbook_dir }}/Apps_for_DS/02-M-TIC_sh_volume_indexes" + dest: /opt/splunk/etc/apps/ + owner: splunk + group: splunk + - name: Copier configuration distributsearch + copy: + src: "{{ playbook_dir }}/Apps_for_DS/For_MC/local/" + dest: /opt/splunk/etc/system/local/ + owner: splunk + group: splunk + - name: Copier configuration MonitoringConsole + copy: + src: "{{ playbook_dir }}/Apps_for_DS/splunk_monitoring_console/" + dest: /opt/splunk/etc/apps/splunk_monitoring_console/ + owner: splunk + group: splunk + - name: Copier application sur le DS + copy: + src: "{{ playbook_dir }}/Apps_for_DS/" + dest: /opt/splunk/etc/deployment-apps/ + owner: splunk + group: splunk \ No newline at end of file diff --git a/roles/splunk_deploy/tasks/Deploy_apps-to_DS.yml.old b/roles/splunk_deploy/tasks/Deploy_apps-to_DS.yml.old new file mode 100644 index 0000000..9114739 --- /dev/null +++ b/roles/splunk_deploy/tasks/Deploy_apps-to_DS.yml.old @@ -0,0 +1,17 @@ +--- +- name: Copie des apps sur le deploiment server + become: yes + become_user: "{{ privileged_user }}" + hosts: splunk_deployement_TIC + tasks: + - name: Copier application sur le DS + copy: + src: "{{ playbook_dir }}/Apps_for_DS/" + dest: /opt/splunk/etc/deployment-apps/ + owner: splunk + group: splunk + +# - name: "Restart Splunk via cli" +# command: "{{ splunk_exec }} restart" +# become: yes +# become_user: "{{ privileged_user }}" \ No newline at end of file