From 1e7faa670012519644df8fe129a063bda4f476f7 Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 29 Dec 2022 04:16:38 +0100 Subject: [PATCH] install and start sshd --- tasks/main.yml | 3 +++ tasks/powershell.yml | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 tasks/powershell.yml 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 +