From 61b785cae02215e0d7dc3878da5d792e198a595c Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 29 Dec 2022 04:20:28 +0100 Subject: [PATCH] improve installation --- tasks/firewall.yml | 2 +- tasks/main.yml | 4 ++-- tasks/powershell.yml | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks/firewall.yml b/tasks/firewall.yml index d5b1b0a..ac9869c 100644 --- a/tasks/firewall.yml +++ b/tasks/firewall.yml @@ -9,4 +9,4 @@ state: present profiles: domain,private,public enabled: true - + register: _fw diff --git a/tasks/main.yml b/tasks/main.yml index 0bfece9..2757f38 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Configure Windows Firewall - ansible.builtin.include_tasks: firwall.yml + ansible.builtin.include_tasks: firewall.yml -- Name: Install OpenSSH via Powershell +- name: Install OpenSSH via Powershell ansible.builtin.include_tasks: powershell.yml diff --git a/tasks/powershell.yml b/tasks/powershell.yml index 2b09f57..b274459 100644 --- a/tasks/powershell.yml +++ b/tasks/powershell.yml @@ -3,6 +3,7 @@ - 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: