win_ansible_role_sshd/tasks/powershell.yml
2022-12-29 04:20:28 +01:00

13 lines
452 B
YAML

---
# 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"
changed_when: _fw.changed
- name: Set service startup mode to auto and ensure sshd is started
ansible.windows.win_service:
name: sshd
start_mode: auto
state: started