diff --git a/tasks/main.yml b/tasks/main.yml index 07dd752..0bfece9 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 diff --git a/tasks/powershell.yml b/tasks/powershell.yml new file mode 100644 index 0000000..2b09f57 --- /dev/null +++ b/tasks/powershell.yml @@ -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 +