install and start sshd

This commit is contained in:
L3D 2022-12-29 04:16:38 +01:00
parent c9ce2c8906
commit 1e7faa6700
Signed by: l3d
GPG key ID: CD08445BFF4313D1
2 changed files with 15 additions and 0 deletions

View file

@ -1,3 +1,6 @@
---
- name: Configure Windows Firewall
ansible.builtin.include_tasks: firwall.yml
- Name: Install OpenSSH via Powershell
ansible.builtin.include_tasks: powershell.yml

12
tasks/powershell.yml Normal file
View file

@ -0,0 +1,12 @@
---
# See https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=powershell
- name: Install the OpenSSH Server
ansible.windows.win_powershell:
script: "Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0"
- name: Set service startup mode to auto and ensure sshd is started
ansible.windows.win_service:
name: sshd
start_mode: auto
state: started