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: