diff --git a/Deploy_UF_Linux.yml b/Deploy_UF_Linux.yml index 761c42e..8d4bcbe 100644 --- a/Deploy_UF_Linux.yml +++ b/Deploy_UF_Linux.yml @@ -4,4 +4,4 @@ hosts: splunk_uf_Linux tasks: - name: Deploy_Uf_LIN - include_tasks: roles/splunk_deploy_uf_lin/tasks/Deploy_Conf-to-uf.yml \ No newline at end of file + include_tasks: roles/splunk_deploy_uf/tasks/Deploy_Conf-to-uf.yml \ No newline at end of file diff --git a/Deploy_UF_Windows.yml b/Deploy_UF_Windows.yml new file mode 100644 index 0000000..4ace273 --- /dev/null +++ b/Deploy_UF_Windows.yml @@ -0,0 +1,7 @@ +--- +- name: "Deploy Conf for Splunk UniversalForwarder Linux" + become: yes + hosts: splunk_uf_Windows + tasks: + - name: Deploy_Uf_Win + include_tasks: roles/splunk_deploy_uf/tasks/Deploy_Conf-to-uf_Win.yml \ No newline at end of file diff --git a/install_splunk_uf_win.yml b/install_splunk_uf_win.yml index 8798066..b4674d0 100755 --- a/install_splunk_uf_win.yml +++ b/install_splunk_uf_win.yml @@ -1,10 +1,7 @@ -- hosts: splunk_uf_win_m-tic - name: Copy source forwarder windows - ansible.windows.win.copy: - src: "{{ playbook_dir }}/roles/sources/{{ hostvars ['127.0.0.1'].splunkforwarder-8.1.3-63079c59e632-x64-release.msi }}" - dest: "C:\Temp\" - -- hosts: splunk_uf_win_m-tic - name: Install SplunkForwarder Windows - win_command: C:\Windows\System32\msiexec.exe /i C:\Temp\splunkforwarder-8.1.3-63079c59e632-x64-release.msi AGREETOLICENSE=Yes SPLUNKUSERNAME=admin SPLUNKPASSWORD=Adm1nPa$$w0rd /quiet - when: splunkforwarder_installed.exists == false \ No newline at end of file +--- +- name: "Install Splunk UniversalForwarder Windows" + become: yes + hosts: splunk_uf_Windows + tasks: + - name: "Install UF Windows" + include_tasks: roles/splunk_common_uf/tasks/install_uf_Win.yml \ No newline at end of file diff --git a/roles/splunk_common_uf/tasks/install_uf_Win.yml b/roles/splunk_common_uf/tasks/install_uf_Win.yml new file mode 100644 index 0000000..db85be9 --- /dev/null +++ b/roles/splunk_common_uf/tasks/install_uf_Win.yml @@ -0,0 +1,6 @@ +- name: "Install UF Windows" + win_package: + path: "C:\Temp\splunkforwarder-9.0.4-de405f4a7979-x64-release.msi" + product_id: "{6C243C23-42E6-46E7-AECC-81428601A55E}" + state: present + arguments: 'INSTALLDIR="C:\Program Files\SplunkUniversalForwarder" AGREETOLICENSE=Yes /quiet SPLUNK_USER="{{ splunk_admin_user }}" SPLUNK_PASSWORD="{{ splunk_password }}"' \ No newline at end of file diff --git a/roles/splunk_deploy_uf_lin/tasks/Deploy_Conf-to-uf.yml b/roles/splunk_deploy_uf/tasks/Deploy_Conf-to-uf.yml similarity index 100% rename from roles/splunk_deploy_uf_lin/tasks/Deploy_Conf-to-uf.yml rename to roles/splunk_deploy_uf/tasks/Deploy_Conf-to-uf.yml diff --git a/roles/splunk_deploy_uf/tasks/Deploy_Conf-to-uf_Win.yml b/roles/splunk_deploy_uf/tasks/Deploy_Conf-to-uf_Win.yml new file mode 100644 index 0000000..70d0d81 --- /dev/null +++ b/roles/splunk_deploy_uf/tasks/Deploy_Conf-to-uf_Win.yml @@ -0,0 +1,11 @@ +- name: Copier le répertoire dans SplunkForwarder + become: yes + become_user: "{{ privileged_user }}" + win_copy: + src: "{{ playbook_dir }}/Apps_for_Splunk/01-Conf_deploy_client" + dest: "C:/Program Files/SplunkUniversalForwarder/etc/apps" + +- name: "Reboot service" + win_service: + name: "splunkforwarder" + state: restarted \ No newline at end of file