win_ansible_role_sshd/tasks/powershell.yml

13 lines
424 B
YAML
Raw Normal View History

2022-12-29 04:16:38 +01:00
---
# 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