diff --git a/Deploy_Conf-to-uf.yml b/Deploy_Conf-to-uf.yml new file mode 100644 index 0000000..2c57855 --- /dev/null +++ b/Deploy_Conf-to-uf.yml @@ -0,0 +1,25 @@ +- name: Copie de la configuration du deploiment server + become: yes + become_user: "{{ privileged_user }}" + tasks: + - name: Vérifier si le répertoire existe dans SplunkForwarder + hosts: splunk_uf_Linux_TIC + stat: + path: /opt/splunkforwarder/etc/apps/01-Conf_deploy_client + register: splunkforwarder_dir + + - name: Supprimer le répertoire non fonctionnel dans SplunkForwarder + hosts: splunk_uf_Linux_TIC + when: splunkforwarder_dir.stat.exists + file: + path: /opt/splunkforwarder/etc/apps/01-Conf_deploy_client + state: absent + force: yes + + - name: Copier le répertoire dans SplunkForwarder + hosts: splunk_uf_Linux_TIC + copy: + src: "{{ playbook_dir }}/Apps_for_Splunk/01-Conf_deploy_client" + dest: /opt/splunkforwarder/etc/apps/ + owner: splunk + group: splunk diff --git a/Deploy_Conf.yml b/Deploy_Conf.yml index 33840c2..0047baf 100644 --- a/Deploy_Conf.yml +++ b/Deploy_Conf.yml @@ -37,45 +37,23 @@ become_user: "{{ privileged_user }}" tasks: - name: Vérifier si le répertoire existe dans Splunk - hosts: all:!splunk_deployement_TIC:!splunk_monitoring_TIC:!splunk_uf_Linux_TIC + hosts: all:!splunk_uf_Linux_TIC stat: path: /opt/splunk/etc/apps/01-Conf_deploy_client register: splunk_dir - name: Supprimer le répertoire non fonctionnel dans Splunk - hosts: all:!splunk_deployement_TIC:!splunk_monitoring_TIC:!splunk_uf_Linux_TIC + hosts: all:!splunk_uf_Linux_TIC when: splunk_dir.stat.exists file: path: /opt/splunk/etc/apps/01-Conf_deploy_client state: absent force: yes - - name: Vérifier si le répertoire existe dans SplunkForwarder - hosts: splunk_uf_Linux_TIC - stat: - path: /opt/splunkforwarder/etc/apps/01-Conf_deploy_client - register: splunkforwarder_dir - - - name: Supprimer le répertoire non fonctionnel dans SplunkForwarder - hosts: splunk_uf_Linux_TIC - when: splunkforwarder_dir.stat.exists - file: - path: /opt/splunkforwarder/etc/apps/01-Conf_deploy_client - state: absent - force: yes - - name: Copier le répertoire dans Splunk hosts: all:!splunk_deployement_TIC:!splunk_monitoring_TIC:!splunk_uf_Linux_TIC copy: src: "{{ playbook_dir }}/Apps_for_Splunk/01-Conf_deploy_client" dest: /opt/splunk/etc/apps/ owner: splunk - group: splunk - - - name: Copier le répertoire dans SplunkForwarder - hosts: splunk_uf_Linux_TIC - copy: - src: "{{ playbook_dir }}/Apps_for_Splunk/01-Conf_deploy_client" - dest: /opt/splunkforwarder/etc/apps/ - owner: splunk - group: splunk + group: splunk \ No newline at end of file