From 294b0a2b4195ec6b531f33c42372ad55eb03b180 Mon Sep 17 00:00:00 2001 From: abrown38 Date: Wed, 8 Jan 2025 12:59:37 +0000 Subject: [PATCH 01/12] use variable for vm flavor --- ansible/playbooks/openstack-vms.yml | 16 ++++++++-------- ansible/vars/common.yml | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ansible/playbooks/openstack-vms.yml b/ansible/playbooks/openstack-vms.yml index 16e3685..23e0856 100644 --- a/ansible/playbooks/openstack-vms.yml +++ b/ansible/playbooks/openstack-vms.yml @@ -17,7 +17,7 @@ name: "{{ os_project }}-{{ win_project }}-wb{{ '%02d' | format(item+1) }}" state: "{{ state }}" image: "{{ vm_image }}" - flavor: 3661211f-673a-4777-8857-fd243d6c407d + flavor: "{{ user_vm_flavor }}" timeout: 900 boot_from_volume: true volume_size: 40 @@ -52,7 +52,7 @@ name: "{{ os_project }}-{{ win_project }}-wb{{ '%02d' | format(item+1) }}" state: "{{ state }}" image: "{{ vm_image }}" - flavor: 3661211f-673a-4777-8857-fd243d6c407d + flavor: "{{ user_vm_flavor }}" timeout: 900 boot_from_volume: true volume_size: 40 @@ -93,7 +93,7 @@ name: "{{ os_project }}-{{ win_project }}-app{{ '%02d' | format(item+1) }}" state: "{{ state }}" image: "{{ vm_image }}" - flavor: 3661211f-673a-4777-8857-fd243d6c407d + flavor: "{{ user_vm_flavor }}" timeout: 900 boot_from_volume: true volume_size: 40 @@ -128,7 +128,7 @@ name: "{{ os_project }}-{{ win_project }}-app{{ '%02d' | format(item+1) }}" state: "{{ state }}" image: "{{ vm_image }}" - flavor: 3661211f-673a-4777-8857-fd243d6c407d + flavor: "{{ user_vm_flavor }}" timeout: 900 boot_from_volume: true volume_size: 40 @@ -169,7 +169,7 @@ name: "{{ os_project }}-{{ win_project }}-gpu{{ '%02d' | format(item+1) }}" state: "{{ state }}" image: "{{ vm_image }}" - flavor: 3661211f-673a-4777-8857-fd243d6c407d + flavor: "{{ user_vm_flavor }}" timeout: 900 boot_from_volume: true volume_size: 40 @@ -204,7 +204,7 @@ name: "{{ os_project }}-{{ win_project }}-gpu{{ '%02d' | format(item+1) }}" state: "{{ state }}" image: "{{ vm_image }}" - flavor: 3661211f-673a-4777-8857-fd243d6c407d + flavor: "{{ user_vm_flavor }}" timeout: 900 boot_from_volume: true volume_size: 40 @@ -247,7 +247,7 @@ name: "{{ item.name }}" state: "{{ state }}" image: "{{ vm_image }}" - flavor: 3661211f-673a-4777-8857-fd243d6c407d + flavor: "{{ user_vm_flavor }}" timeout: 3600 boot_from_volume: true volume_size: 40 @@ -290,7 +290,7 @@ name: "{{ os_project }}-{{ win_project }}-proxy" state: "{{ state }}" image: "{{ proxy_image }}" - flavor: 3661211f-673a-4777-8857-fd243d6c407d + flavor: "{{ user_vm_flavor }}" timeout: 900 boot_from_volume: true volume_size: 40 diff --git a/ansible/vars/common.yml b/ansible/vars/common.yml index 7be21e6..6760b6e 100644 --- a/ansible/vars/common.yml +++ b/ansible/vars/common.yml @@ -13,6 +13,7 @@ vm_image: 3f193ea7-321d-418b-a233-da64661b08b1 proxy_image: 62669efd-ee43-4148-848c-b82f49ca2f45 server_vm_flavor: 3661211f-673a-4777-8857-fd243d6c407d user_vm_flavor: 3661211f-673a-4777-8857-fd243d6c407d +#user_vm_flavor: a82596d8-175b-45d2-b7db-d1658b3dd643 gpu_flavor: b07fc115-e48e-4289-b220-baae18c8db8a filetransfer_user: file-transfer From a1f7e14b7712cb90dfab819d5d3c531741982cb8 Mon Sep 17 00:00:00 2001 From: abrown38 Date: Thu, 9 Jan 2025 15:58:35 +0000 Subject: [PATCH 02/12] Remove single quotes --- register_vms.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/register_vms.sh b/register_vms.sh index 1b5f4a5..688189d 100644 --- a/register_vms.sh +++ b/register_vms.sh @@ -65,7 +65,7 @@ post_request() { -H "content-type: application/json" \ -H "accept: application/json" \ -H "Authorization: Token $API_TOKEN" \ - -d "'$(jq -c . $VM_JSON)'" \ + -d "$(jq -c . $VM_JSON)" \ $API_ENDPOINT } From 220b663ccb00d54aa9aeeb319bba3acf409eab25 Mon Sep 17 00:00:00 2001 From: abrown38 Date: Thu, 9 Jan 2025 15:59:04 +0000 Subject: [PATCH 03/12] prevent warning about characters in inventory --- ansible/ansible.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg index 7c99a3d..4b7aa6c 100644 --- a/ansible/ansible.cfg +++ b/ansible/ansible.cfg @@ -7,6 +7,7 @@ ask_pass=False forks=30 host_key_checking=False +force_valid_group_names=ignore # Stuff for Dynamic Inventories fast_caching = ansible.builtin.jsonfile @@ -18,4 +19,4 @@ cache = yes cache_connection = /tmp/ansible_inventory [inventory_plugins] -use_extra_vars = true \ No newline at end of file +use_extra_vars = true From 4ab7f110b6e02a69b737707e6087e32af0511282 Mon Sep 17 00:00:00 2001 From: abrown38 Date: Thu, 9 Jan 2025 15:59:29 +0000 Subject: [PATCH 04/12] allow role to be rerun --- ansible/roles/win_dfs/tasks/configure.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ansible/roles/win_dfs/tasks/configure.yml b/ansible/roles/win_dfs/tasks/configure.yml index f71b919..61bca92 100644 --- a/ansible/roles/win_dfs/tasks/configure.yml +++ b/ansible/roles/win_dfs/tasks/configure.yml @@ -60,4 +60,6 @@ DomainName: "{{ win_project }}.loc" PsDscRunAsCredential_username: Administrator PsDscRunAsCredential_password: "{{ ansible_password }}" - when: inventory_hostname in groups['meta-name_fs01'] + when: | # maybe change second condition or use resuce + inventory_hostname in groups['meta-name_fs01'] and + feature_status.reboot_required == true From 83e2e24e6b50fc37f5b92b8c8e6e8c8dc9bd7be5 Mon Sep 17 00:00:00 2001 From: abrown38 Date: Mon, 13 Jan 2025 12:49:42 +0000 Subject: [PATCH 05/12] use variables for VM flavors --- ansible/playbooks/openstack-vms.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/playbooks/openstack-vms.yml b/ansible/playbooks/openstack-vms.yml index 23e0856..feef99a 100644 --- a/ansible/playbooks/openstack-vms.yml +++ b/ansible/playbooks/openstack-vms.yml @@ -169,7 +169,7 @@ name: "{{ os_project }}-{{ win_project }}-gpu{{ '%02d' | format(item+1) }}" state: "{{ state }}" image: "{{ vm_image }}" - flavor: "{{ user_vm_flavor }}" + flavor: "{{ gpu_flavor }}" timeout: 900 boot_from_volume: true volume_size: 40 @@ -204,7 +204,7 @@ name: "{{ os_project }}-{{ win_project }}-gpu{{ '%02d' | format(item+1) }}" state: "{{ state }}" image: "{{ vm_image }}" - flavor: "{{ user_vm_flavor }}" + flavor: "{{ gpu_flavor }}" timeout: 900 boot_from_volume: true volume_size: 40 @@ -247,7 +247,7 @@ name: "{{ item.name }}" state: "{{ state }}" image: "{{ vm_image }}" - flavor: "{{ user_vm_flavor }}" + flavor: "{{ server_vm_flavor }}" timeout: 3600 boot_from_volume: true volume_size: 40 @@ -290,7 +290,7 @@ name: "{{ os_project }}-{{ win_project }}-proxy" state: "{{ state }}" image: "{{ proxy_image }}" - flavor: "{{ user_vm_flavor }}" + flavor: 3661211f-673a-4777-8857-fd243d6c407d timeout: 900 boot_from_volume: true volume_size: 40 From fa7e4aa7616d8dda7bf0123a70715049c51bf910 Mon Sep 17 00:00:00 2001 From: cfinlay Date: Wed, 22 Jan 2025 14:18:26 +0000 Subject: [PATCH 06/12] Setup login script task --- .../win_domain_controller/tasks/dc-logon.yml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 ansible/roles/win_domain_controller/tasks/dc-logon.yml diff --git a/ansible/roles/win_domain_controller/tasks/dc-logon.yml b/ansible/roles/win_domain_controller/tasks/dc-logon.yml new file mode 100644 index 0000000..1849b9c --- /dev/null +++ b/ansible/roles/win_domain_controller/tasks/dc-logon.yml @@ -0,0 +1,45 @@ +--- +- name: Set Reg Keys + tags: + - logon + block: + - name: Configure Windows Logon Script via GPO + tasks: + #- name: Ensure script file is present in shared directory + # ansible.windows.win_copy: + # src: /path/to/logon.ps1 + # dest: "C:\\eidf\\logon.ps1" + # remote_src: false + + - name: Create a new Group Policy Object (GPO) + ansible.windows.win_shell: + command: | + Import-Module GroupPolicy + if (!(Get-GPO -Name "User Logon Script" -ErrorAction SilentlyContinue)) { + New-GPO -Name "User Logon Script" -Domain "yourdomain.local" + } + ignore_errors: true + + - name: Link GPO to Organizational Unit (OU) + ansible.windows.win_shell: + command: | + Import-Module GroupPolicy + if (!(Get-GPLink -Name "User Logon Script" -Target "OU=YourOU,DC=yourdomain,DC=local" -ErrorAction SilentlyContinue)) { + New-GPLink -Name "User Logon Script" -Target "OU=YourOU,DC=yourdomain,DC=local" + } + + - name: Configure the logon script in GPO + ansible.windows.win_shell: + command: | + Import-Module GroupPolicy + Set-GPRegistryValue -Name "User Logon Script" -Key "HKCU\Environment" -ValueName "LogonScript" -Type String -Value "C:\\eidf\\logon.ps1" + + - name: Allow PowerShell scripts to execute + ansible.windows.win_shell: + command: | + Import-Module GroupPolicy + Set-GPRegistryValue -Name "User Logon Script" -Key "HKLM\Software\Policies\Microsoft\Windows\PowerShell" -ValueName "ExecutionPolicy" -Type String -Value "Unrestricted" + + - name: Force Group Policy update on clients + ansible.windows.win_command: + command: gpupdate /Force From 3d346b586c65beccdaefd74bb644d38846d509ce Mon Sep 17 00:00:00 2001 From: cfinlay Date: Wed, 22 Jan 2025 15:14:38 +0000 Subject: [PATCH 07/12] removing comment for syntax --- ansible/roles/win_domain_controller/tasks/dc-logon.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ansible/roles/win_domain_controller/tasks/dc-logon.yml b/ansible/roles/win_domain_controller/tasks/dc-logon.yml index 1849b9c..359ee58 100644 --- a/ansible/roles/win_domain_controller/tasks/dc-logon.yml +++ b/ansible/roles/win_domain_controller/tasks/dc-logon.yml @@ -5,12 +5,6 @@ block: - name: Configure Windows Logon Script via GPO tasks: - #- name: Ensure script file is present in shared directory - # ansible.windows.win_copy: - # src: /path/to/logon.ps1 - # dest: "C:\\eidf\\logon.ps1" - # remote_src: false - - name: Create a new Group Policy Object (GPO) ansible.windows.win_shell: command: | From e14096aac4d15a1a7427943d85869a8e55b249b4 Mon Sep 17 00:00:00 2001 From: cfinlay Date: Thu, 23 Jan 2025 09:42:49 +0000 Subject: [PATCH 08/12] all files moved to single role, regs keys in files --- ansible/roles/win_client/tasks/main.yml | 1 - .../files/OpenStackADBuildv7.5.3.ps1 | 8 ++++++++ .../{win_client => win_domain_controller}/tasks/logon.yml | 0 ansible/roles/win_domain_controller/tasks/main.yml | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) rename ansible/roles/{win_client => win_domain_controller}/tasks/logon.yml (100%) diff --git a/ansible/roles/win_client/tasks/main.yml b/ansible/roles/win_client/tasks/main.yml index 9acaa5e..2ba3891 100644 --- a/ansible/roles/win_client/tasks/main.yml +++ b/ansible/roles/win_client/tasks/main.yml @@ -3,4 +3,3 @@ - import_tasks: chocolatey.yml - import_tasks: rdgw.yml - import_tasks: start_menu.yml -- import_tasks: logon.yml diff --git a/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 b/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 index ab6aae3..9b7d7d4 100644 --- a/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 +++ b/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 @@ -411,6 +411,14 @@ New-GPLink -Name "Firefox" -Target $workbenchou New-GPLink -Name "Chrome" -Target $workbenchou #New-GPLink -Name "firewall" -Target $workbenchou +#Logon Script Reg Keys +Import-Module GroupPolicy +if (!(Get-GPLink -Name "User Logon Script" -Target "OU=YourOU,DC=yourdomain,DC=local" -ErrorAction SilentlyContinue)) { +New-GPLink -Name "User Logon Script" -Target "OU=YourOU,DC=yourdomain,DC=local" +} +Set-GPRegistryValue -Name "User Logon Script" -Key "HKCU\Environment" -ValueName "LogonScript" -Type String -Value "C:\\eidf\\logon.ps1" +Set-GPRegistryValue -Name "User Logon Script" -Key "HKLM\Software\Policies\Microsoft\Windows\PowerShell" -ValueName "ExecutionPolicy" -Type String -Value "Unrestricted" + #add entry for WSUS diff --git a/ansible/roles/win_client/tasks/logon.yml b/ansible/roles/win_domain_controller/tasks/logon.yml similarity index 100% rename from ansible/roles/win_client/tasks/logon.yml rename to ansible/roles/win_domain_controller/tasks/logon.yml diff --git a/ansible/roles/win_domain_controller/tasks/main.yml b/ansible/roles/win_domain_controller/tasks/main.yml index 7663b70..3666add 100644 --- a/ansible/roles/win_domain_controller/tasks/main.yml +++ b/ansible/roles/win_domain_controller/tasks/main.yml @@ -1,3 +1,4 @@ --- - import_tasks: features.yml - import_tasks: setup.yml +- import_tasks: logon.yml From 8f2a04e82e96297286b05ebf7706ec2c725c70e0 Mon Sep 17 00:00:00 2001 From: cfinlay Date: Thu, 23 Jan 2025 15:22:28 +0000 Subject: [PATCH 09/12] simplifing process --- ansible/roles/win_client/files/logon.ps1 | 28 ------------- .../files/OpenStackADBuildv7.5.3.ps1 | 7 +--- .../win_domain_controller/files/logon.ps1 | 5 +++ .../win_domain_controller/tasks/dc-logon.yml | 39 ------------------- 4 files changed, 6 insertions(+), 73 deletions(-) delete mode 100644 ansible/roles/win_client/files/logon.ps1 create mode 100644 ansible/roles/win_domain_controller/files/logon.ps1 delete mode 100644 ansible/roles/win_domain_controller/tasks/dc-logon.yml diff --git a/ansible/roles/win_client/files/logon.ps1 b/ansible/roles/win_client/files/logon.ps1 deleted file mode 100644 index f552d70..0000000 --- a/ansible/roles/win_client/files/logon.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -$bashProfilePath = Join-Path $HOME ".bash_profile" - -$condaPath = "C:\tools\miniforge3\Scripts\conda.exe" - -$requiredLine = 'eval "$(''/C/tools/miniforge3/Scripts/conda.exe'' ''shell.bash'' ''hook'')"' - -if (Test-Path $condaPath) { - Write-Host "Miniforge3 is installed at $condaPath" - - if (Test-Path $bashProfilePath) { - $currentContent = Get-Content -Path $bashProfilePath -ErrorAction SilentlyContinue - - if ($currentContent -contains $requiredLine) { - Write-Host "The required line is already present in .bash_profile" - } else { - Add-Content -Path $bashProfilePath -Value $requiredLine - Write-Host "The required line has been added to .bash_profile" - } - } else { - Set-Content -Path $bashProfilePath -Value $requiredLine -Force - Write-Host ".bash_profile created with the required line" - } - - Set-ItemProperty -Path $bashProfilePath -Name Attributes -Value ([System.IO.FileAttributes]::Hidden) - Write-Host ".bash_profile is set to hidden" -} else { - Write-Host "Miniforge3 is not installed. Exiting." -} diff --git a/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 b/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 index 9b7d7d4..e76218e 100644 --- a/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 +++ b/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 @@ -412,12 +412,7 @@ New-GPLink -Name "Chrome" -Target $workbenchou #New-GPLink -Name "firewall" -Target $workbenchou #Logon Script Reg Keys -Import-Module GroupPolicy -if (!(Get-GPLink -Name "User Logon Script" -Target "OU=YourOU,DC=yourdomain,DC=local" -ErrorAction SilentlyContinue)) { -New-GPLink -Name "User Logon Script" -Target "OU=YourOU,DC=yourdomain,DC=local" -} -Set-GPRegistryValue -Name "User Logon Script" -Key "HKCU\Environment" -ValueName "LogonScript" -Type String -Value "C:\\eidf\\logon.ps1" -Set-GPRegistryValue -Name "User Logon Script" -Key "HKLM\Software\Policies\Microsoft\Windows\PowerShell" -ValueName "ExecutionPolicy" -Type String -Value "Unrestricted" +New-ItemProperty -Path "Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce" -Name "CreateBashProfile" -Value "powershell.exe -ExecutionPolicy Bypass -File C:\eidf\logon.ps1" -PropertyType String #add entry for WSUS diff --git a/ansible/roles/win_domain_controller/files/logon.ps1 b/ansible/roles/win_domain_controller/files/logon.ps1 new file mode 100644 index 0000000..fadf979 --- /dev/null +++ b/ansible/roles/win_domain_controller/files/logon.ps1 @@ -0,0 +1,5 @@ +$bashProfilePath = Join-Path $HOME ".bash_profile" +$requiredLine = 'eval "$(''/C/tools/miniforge3/Scripts/conda.exe'' ''shell.bash'' ''hook'')"' + +Add-Content -Path $bashProfilePath -Value $requiredLine +Set-ItemProperty -Path $bashProfilePath -Name Attributes -Value ([System.IO.FileAttributes]::Hidden) diff --git a/ansible/roles/win_domain_controller/tasks/dc-logon.yml b/ansible/roles/win_domain_controller/tasks/dc-logon.yml deleted file mode 100644 index 359ee58..0000000 --- a/ansible/roles/win_domain_controller/tasks/dc-logon.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -- name: Set Reg Keys - tags: - - logon - block: - - name: Configure Windows Logon Script via GPO - tasks: - - name: Create a new Group Policy Object (GPO) - ansible.windows.win_shell: - command: | - Import-Module GroupPolicy - if (!(Get-GPO -Name "User Logon Script" -ErrorAction SilentlyContinue)) { - New-GPO -Name "User Logon Script" -Domain "yourdomain.local" - } - ignore_errors: true - - - name: Link GPO to Organizational Unit (OU) - ansible.windows.win_shell: - command: | - Import-Module GroupPolicy - if (!(Get-GPLink -Name "User Logon Script" -Target "OU=YourOU,DC=yourdomain,DC=local" -ErrorAction SilentlyContinue)) { - New-GPLink -Name "User Logon Script" -Target "OU=YourOU,DC=yourdomain,DC=local" - } - - - name: Configure the logon script in GPO - ansible.windows.win_shell: - command: | - Import-Module GroupPolicy - Set-GPRegistryValue -Name "User Logon Script" -Key "HKCU\Environment" -ValueName "LogonScript" -Type String -Value "C:\\eidf\\logon.ps1" - - - name: Allow PowerShell scripts to execute - ansible.windows.win_shell: - command: | - Import-Module GroupPolicy - Set-GPRegistryValue -Name "User Logon Script" -Key "HKLM\Software\Policies\Microsoft\Windows\PowerShell" -ValueName "ExecutionPolicy" -Type String -Value "Unrestricted" - - - name: Force Group Policy update on clients - ansible.windows.win_command: - command: gpupdate /Force From c101a58c44bb3d6d5041cba067c374ab410e4691 Mon Sep 17 00:00:00 2001 From: cfinlay Date: Thu, 23 Jan 2025 16:03:38 +0000 Subject: [PATCH 10/12] changes to reg keys --- .../win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 b/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 index e76218e..b38bab1 100644 --- a/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 +++ b/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 @@ -412,7 +412,11 @@ New-GPLink -Name "Chrome" -Target $workbenchou #New-GPLink -Name "firewall" -Target $workbenchou #Logon Script Reg Keys -New-ItemProperty -Path "Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce" -Name "CreateBashProfile" -Value "powershell.exe -ExecutionPolicy Bypass -File C:\eidf\logon.ps1" -PropertyType String +New-GPO -Name "User Logon Script" +Set-GPRegistryValue -Name "User Logon Script" -Key "HKCU\Environment" -ValueName "LogonScript" -Type String -Value "C:\eidf\logon.ps1" +Set-GPRegistryValue -Name "User Logon Script" -Key "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce" -ValueName "ExecutionPolicy" -Type String -Value "C:\eidf\logon.ps1" +New-GPLink -Name "User Logon Script" -Target $workbenchou + #add entry for WSUS From 9286e4c8058e99ad0f0cf6520d4792df44f77d34 Mon Sep 17 00:00:00 2001 From: cfinlay Date: Thu, 23 Jan 2025 16:29:09 +0000 Subject: [PATCH 11/12] powershell fix --- .../win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 | 2 +- ansible/roles/win_domain_controller/tasks/logon.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 b/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 index b38bab1..caa7578 100644 --- a/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 +++ b/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 @@ -414,7 +414,7 @@ New-GPLink -Name "Chrome" -Target $workbenchou #Logon Script Reg Keys New-GPO -Name "User Logon Script" Set-GPRegistryValue -Name "User Logon Script" -Key "HKCU\Environment" -ValueName "LogonScript" -Type String -Value "C:\eidf\logon.ps1" -Set-GPRegistryValue -Name "User Logon Script" -Key "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce" -ValueName "ExecutionPolicy" -Type String -Value "C:\eidf\logon.ps1" +Set-GPRegistryValue -Name "User Logon Script" -Key "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce" -ValueName "ExecutionPolicy" -Type String -Value "powershell C:\eidf\logon.ps1" New-GPLink -Name "User Logon Script" -Target $workbenchou diff --git a/ansible/roles/win_domain_controller/tasks/logon.yml b/ansible/roles/win_domain_controller/tasks/logon.yml index fd61f8b..83e63cd 100644 --- a/ansible/roles/win_domain_controller/tasks/logon.yml +++ b/ansible/roles/win_domain_controller/tasks/logon.yml @@ -1,7 +1,7 @@ --- - name: Copy logon script to VMs tags: - - copy_logon_script + - logon block: - name: Copy logon script to VMs win_copy: From bfb8e22f4724a23e25205b3680f564737b4b98c8 Mon Sep 17 00:00:00 2001 From: cfinlay Date: Sun, 26 Jan 2025 14:01:35 +0000 Subject: [PATCH 12/12] fixing script, and reg keys --- .../roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 b/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 index caa7578..06886fd 100644 --- a/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 +++ b/ansible/roles/win_domain_controller/files/OpenStackADBuildv7.5.3.ps1 @@ -413,7 +413,6 @@ New-GPLink -Name "Chrome" -Target $workbenchou #Logon Script Reg Keys New-GPO -Name "User Logon Script" -Set-GPRegistryValue -Name "User Logon Script" -Key "HKCU\Environment" -ValueName "LogonScript" -Type String -Value "C:\eidf\logon.ps1" Set-GPRegistryValue -Name "User Logon Script" -Key "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce" -ValueName "ExecutionPolicy" -Type String -Value "powershell C:\eidf\logon.ps1" New-GPLink -Name "User Logon Script" -Target $workbenchou