Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.

Commit fc4cfc0

Browse files
authored
#332 Setup OpenSSH Portable for windows (#333)
1 parent 98550f7 commit fc4cfc0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

ansible/win-simple.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
vars:
55
bleachbit_url: https://download.bleachbit.org/BleachBit-4.4.0-portable.zip
6+
openssh_url: https://github.com/PowerShell/Win32-OpenSSH/releases/download/V8.6.0.0p1-Beta/OpenSSH-Win64.zip
67

78
roles:
89
- role: ansible-role-virtio-win
@@ -57,6 +58,31 @@
5758
register: result
5859
until: result is succeeded
5960

61+
- name: Download OpenSSH
62+
win_get_url:
63+
url: "{{ openssh_url }}"
64+
dest: "%HOMEDRIVE%\\OpenSSH-portable.zip"
65+
register: result
66+
until: result is succeeded
67+
68+
- name: Unzip downloaded OpenSSH
69+
win_unzip:
70+
src: "%HOMEDRIVE%\\OpenSSH-portable.zip"
71+
dest: "%HOMEDRIVE%\\"
72+
delete_archive: yes
73+
74+
- name: Install OpenSSH
75+
win_shell: "C:\\OpenSSH-Win64\\install-sshd.ps1"
76+
77+
- name: Set OpenSSH Service to automatic startup and ensure it is up
78+
win_service:
79+
name: sshd
80+
start_mode: auto
81+
state: started
82+
83+
- name: Enable Firewall for OpenSSH
84+
win_shell: New-NetFirewallRule -DisplayName "ssh" -Direction Inbound -Action Allow -Protocol "TCP" -LocalPort "22"
85+
6086
- name: Unzip downloaded BleachBit
6187
win_unzip:
6288
src: "%HOMEDRIVE%\\BleachBit-portable.zip"

0 commit comments

Comments
 (0)