From 844d5f011ac27e0b2c441217669cb349f49a8f94 Mon Sep 17 00:00:00 2001 From: abrown38 Date: Fri, 27 Sep 2024 17:37:58 +0100 Subject: [PATCH] set wsus content dir --- ansible/roles/win_wsus/tasks/configure.yml | 53 ++++++++++++---------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/ansible/roles/win_wsus/tasks/configure.yml b/ansible/roles/win_wsus/tasks/configure.yml index a031094..76dd9cb 100644 --- a/ansible/roles/win_wsus/tasks/configure.yml +++ b/ansible/roles/win_wsus/tasks/configure.yml @@ -6,29 +6,36 @@ win_file: path: "{{ wsus_content_directory }}" state: directory - #- name: Ensure WSUS server is deployed (UpdateServicesDSC) - Errors here :( - # tags: testing - # win_dsc: - # resource_name: UpdateServicesServer - # Ensure: Present - # ContentDir: '{{ wsus_content_directory }}' - # Languages: en - # #Products: "{{ wsus_products }}" - # Products: "Windows Admin Center" - # PsDscRunAsCredential_username: Administrator - # PsDscRunAsCredential_password: "{{ ansible_password }}" - # #ErrorRecord: test - # Classifications: - # - "{{ CriticalUpdates }}" - # #- "{{ DefinitionUpdates }}" - # #- "{{ SecurityUpdates }}" - # #- "{{ ServicePacks }}" - # #- "{{ UpdateRollups }}" - # #- "{{ Updates }}" - # #Synchronize: True - # SynchronizeAutomatically: True - # SynchronizeAutomaticallyTimeOfDay: '15:30:00' - # ClientTargetingMode: "{{ wsus_client_targeting_mode }}" + +- name: Set WSUS Content Directory + tags: set_wsus_content_dir + win_shell: | + CD "C:\Program Files\Update Services\Tools" + .\wsusutil.exe postinstall CONTENT_DIR=W:\WSUS + +#- name: Ensure WSUS server is deployed (UpdateServicesDSC) - Errors here :( +# tags: testing +# win_dsc: +# resource_name: UpdateServicesServer +# Ensure: Present +# ContentDir: '{{ wsus_content_directory }}' +# Languages: en +# #Products: "{{ wsus_products }}" +# Products: "Windows Admin Center" +# PsDscRunAsCredential_username: Administrator +# PsDscRunAsCredential_password: "{{ ansible_password }}" +# #ErrorRecord: test +# Classifications: +# - "{{ CriticalUpdates }}" +# #- "{{ DefinitionUpdates }}" +# #- "{{ SecurityUpdates }}" +# #- "{{ ServicePacks }}" +# #- "{{ UpdateRollups }}" +# #- "{{ Updates }}" +# #Synchronize: True +# SynchronizeAutomatically: True +# SynchronizeAutomaticallyTimeOfDay: '15:30:00' +# ClientTargetingMode: "{{ wsus_client_targeting_mode }}"