From 7747be71b4018e990ee25087e6b898cfef82fb04 Mon Sep 17 00:00:00 2001 From: Trond Hindenes Date: Mon, 6 Jun 2016 23:32:33 +0200 Subject: [PATCH] Return reboot pending as true/false --- lib/ansible/modules/windows/setup.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/modules/windows/setup.ps1 b/lib/ansible/modules/windows/setup.ps1 index 63e5597d861..1f1c4a3b07b 100644 --- a/lib/ansible/modules/windows/setup.ps1 +++ b/lib/ansible/modules/windows/setup.ps1 @@ -153,6 +153,9 @@ if ($winrm_cert_expiry) Set-Attr $result.ansible_facts "ansible_winrm_certificate_expires" $winrm_cert_expiry.NotAfter.ToString("yyyy-MM-dd HH:mm:ss") } +$PendingReboot = Get-PendingRebootStatus +Set-Attr $result.ansible_facts "ansible_reboot_pending" $PendingReboot + # See if Facter is on the System Path Try { $facter_exe = Get-Command facter -ErrorAction Stop