Skip to content

Commit

Permalink
Fixes #37927 - Enable remote desktop in Windows template
Browse files Browse the repository at this point in the history
  • Loading branch information
nadjaheitmann authored and sbernhard committed Nov 5, 2024
1 parent 27d8e28 commit 8e36aee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/services/foreman/template_snapshot_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def define_host_params(host)
"ansible_user" => "win_ansible_user",
"create_ansible_user" => "true",
"ansible_ssh_pass" => "win_ansible_user_ssh_pass",
"remote_desktop" => "true",
}
host_params.each_pair do |name, value|
FactoryBot.build(:host_parameter, host: host, name: name, value: value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ identity:
<% if host_param('remote_desktop') %>
- "<%= powershell %> -NonInteractive -Command \"netsh advfirewall firewall set rule group=\"remote desktop\" new enable=Yes\""
- "<%= powershell %> -NonInteractive -Command \"netsh advfirewall firewall set rule group=\"remotedesktop\" new enable=Yes\""
- "<%= powershell %> -NonInteractive -Command \"Set-ItemProperty -Path 'HKLM:\\System\\CurrentControlSet\\Control\\Terminal Server' -Name 'fDenyTSConnections' -Value 0\""
- "<%= powershell %> -NonInteractive -Command \"Set-ItemProperty -Path 'HKLM:\\System\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp' -Name 'UserAuthentication' -Value 0\""
<% end %>
<% if host_param('ping') %>
- "<%= powershell %> -NonInteractive -Command \"netsh advfirewall firewall add rule name=\"Enable IPv4 ICMP\" dir=in protocol=icmpv4 action=allow\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ cmd /c winrm set winrm/config/client/auth @{Basic="true"}
cmd /c winrm set winrm/config/service/auth @{Basic="true"}


cmd /c "netsh advfirewall firewall set rule group=\"remote desktop\" new enable=Yes"
cmd /c "netsh advfirewall firewall set rule group=\"remotedesktop\" new enable=Yes"

echo Downloading Puppet installer
wget "" -O C:\puppet-agent-latest.msi
Expand Down

0 comments on commit 8e36aee

Please sign in to comment.