{"id":745,"date":"2018-06-06T13:32:12","date_gmt":"2018-06-06T13:32:12","guid":{"rendered":"https:\/\/www.nicktailor.com\/?p=745"},"modified":"2020-06-17T07:17:10","modified_gmt":"2020-06-17T07:17:10","slug":"how-to-configure-ansible-to-manage-windows-hosts-on-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/nicktailor.com\/tech-blog\/how-to-configure-ansible-to-manage-windows-hosts-on-ubuntu-16-04\/","title":{"rendered":"How to configure Ansible to manage Windows Hosts on Ubuntu 16.04"},"content":{"rendered":"<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>Note<em>: This section assumes you already have ansible installed, working, active directory setup, and test windows host in communication with AD. Although its not needed to have AD. Its good practice for to have it all setup talking to each other for learning.<\/em><\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong><span style=\"text-decoration: underline;\">Setup<\/span><\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>Now Ansible does not come with windows managing ability out of the box. Its is easier to setup on centos as the packages are better maintained on Redhat distros. However if you want to set it up on Ubuntu here is what you need to do.<\/strong><\/p>\n<div class=\"ul\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong>easy_install pip<\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong>pip install &#8211;upgrade pip<\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong> pip install pywinrm<\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong>apt-get install python-pip<\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong> apt-get install python-devel krb5-devel krb5-libs krb5-workstation<\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong> apt-get install python-devel<\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong> apt-get install python-de<\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong> apt-get install python-dev<\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong> apt-get install libkrb5-dev<\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong>apt-get install bind9<\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong>pip install pywinrm[Kerberos]<\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong>apt-get install krb5-kdc krb5-admin-server<\/strong><\/div>\n<\/div>\n<\/div>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>Next Setup your \/etc\/krb5.conf<\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><span style=\"color: #333333; background-color: #ffffff;\">[logging]<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">default = <\/span><span style=\"color: #333333; background-color: #ffffff;\">FILE:\/var\/log\/krb5libs.log<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">kdc<\/span><span style=\"color: #333333; background-color: #ffffff;\"> = FILE:\/var\/log\/krb5kdc.log<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">admin_server<\/span><span style=\"color: #333333; background-color: #ffffff;\"> = FILE:\/var\/log\/kadmind.log<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">[<\/span><span style=\"color: #333333; background-color: #ffffff;\">libdefaults<\/span><span style=\"color: #333333; background-color: #ffffff;\">]<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">default_realm<\/span><span style=\"color: #333333; background-color: #ffffff;\"> = HOME.NICKTAILOR.COM<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">dns_lookup_realm<\/span><span style=\"color: #333333; background-color: #ffffff;\"> = false<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">dns_lookup_kdc<\/span><span style=\"color: #333333; background-color: #ffffff;\"> = false<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">ticket_lifetime<\/span><span style=\"color: #333333; background-color: #ffffff;\"> = 24h<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">renew_lifetime<\/span><span style=\"color: #333333; background-color: #ffffff;\"> = 7d<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">forwardable = tr<\/span><span style=\"color: #333333; background-color: #ffffff;\">ue<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">[realms]<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">HOME.NICKTAILOR.COM = {<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">kdc<\/span><span style=\"color: #333333; background-color: #ffffff;\"> = HOME.NICKTAILOR.COM<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">admin_server<\/span><span style=\"color: #333333; background-color: #ffffff;\"> = HOME.NICKTAILOR.COM<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">}<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">[<\/span><span style=\"color: #333333; background-color: #ffffff;\">domain_realm<\/span><span style=\"color: #333333; background-color: #ffffff;\">]<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">.home.nicktailor.com = HOME.NICKTAILOR.COM<\/span><br \/>\n<span style=\"color: #333333; background-color: #ffffff;\">home.nicktailor.com = <\/span><a href=\"http:\/\/HOME.NICKTAILOR.COM\"><span style=\"background-color: #ffffff;\">HOME.NICKTAILOR.COM<\/span><\/a><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">Test Kerberos<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">Run the following commands to test Kerberos:<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">kinit administrator@HOME.NICKTAILOR.COM<\/span><span style=\"color: #333333;\">\u00a0&lt;\u2013make sure you do this exact case sensitive or your <\/span><span style=\"color: #333333;\">authenication<\/span><span style=\"color: #333333;\"> will fail. <\/span><span style=\"color: #333333;\">Also<\/span><span style=\"color: #333333;\"> the user has<\/span><span style=\"color: #333333;\"> to have domain admin privileges.\u00a0<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">You will be prompted for the administrator password\u00a0<\/span><strong><span style=\"color: #333333;\">klist<\/span><\/strong><br \/>\n<span style=\"color: #333333;\">You should see a Kerberos KEYRING record.<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">[<\/span><span style=\"color: #333333;\">root@localhost<\/span> <span style=\"color: #333333;\">win_<\/span><span style=\"color: #333333;\">playbooks<\/span><span style=\"color: #333333;\">]#<\/span> <span style=\"color: #333333;\">klist<\/span><br \/>\n<span style=\"color: #333333;\">Ticket cache: FILE:\/tmp\/krb5cc_0Default principal: administrator@HOME.NICKTAILOR.CO<\/span><span style=\"color: #333333;\">M<\/span><br \/>\n<span style=\"color: #333333;\">Valid starting\u00a0 \u00a0 \u00a0 \u00a0Expires\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Service principal05\/23\/2018 14:20:50\u00a0 05\/24\/2018 00:20:50\u00a0 krbtgt\/HOME.NICKTAILOR.COM@HOME.NICKTAILOR.COM renew until 05\/30\/2018 14:20:40<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">Configure Ansible<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">Ansible is complex and is sensitive to the <\/span><span style=\"color: #333333;\">environment. Troubleshooting an environment which has never initially worked is complex and confusing. We are going to configure Ansible with the least complex possible configuration. Once you have a working environment, you can make extensions and enhance<\/span><span style=\"color: #333333;\">ments in small steps.<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">The core configuration of Ansible resides at \/etc\/ansible<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">We are only going to update two files for this exercise.<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">Update the Ansible Inventory file<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">Edit \/etc\/ansible\/hosts and add:<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">[windows]<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">HOME.NICKTAILOR.COM<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">\u201c[windows]\u201d is a creat<\/span><span style=\"color: #333333;\">ed group of servers called \u201cwindows\u201d. <\/span><span style=\"color: #333333;\">In reality this<\/span><span style=\"color: #333333;\"> should be named something more appropriate for a group which would have similar configurations, such as \u201cActive Directory Servers\u201d, or \u201cProduction Floor Windows 10 PCs\u201d, etc.<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">Update the Ansible Group V<\/span><span style=\"color: #333333;\">ariables for Windows<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">Ansible Group Variables are variable settings for a specific inventory group. In this case, we will create the group variables for the \u201cwindows\u201d servers created in the \/etc\/ansible\/hosts file.<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">Create\u00a0<\/span><strong><span style=\"color: #333333;\"><em>\/etc\/ansible\/<\/em><\/span><span style=\"color: #333333;\"><em>group_vars<\/em><\/span><span style=\"color: #333333;\"><em>\/windows<\/em><\/span><\/strong><span style=\"color: #333333;\">\u00a0and<\/span><span style=\"color: #333333;\"> add:<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">\u2014<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">ansible_user<\/span><span style=\"color: #333333;\">: Administrator<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">ansible_password<\/span><span style=\"color: #333333;\">: Abcd1234<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">ansible_port<\/span><span style=\"color: #333333;\">: 5986<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">ansible_connection<\/span><span style=\"color: #333333;\">: <\/span><span style=\"color: #333333;\">winrm<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">ansible_winrm_server_cert_validation<\/span><span style=\"color: #333333;\">: ignore<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><em><span style=\"color: #333333;\">This is a YAML configuration file,\u00a0<\/span><strong><span style=\"color: #333333;\">so make sure the first line is three dashes \u201c\u2010\u2010\u2010\u201d<\/span><\/strong><\/em><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><em><span style=\"color: #333333;\">Naturally change the Administrator password to the password for\u00a0<\/span><strong><span style=\"color: #333333;\">WinServer1<\/span><\/strong><span style=\"color: #333333;\">.<\/span><\/em><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><em><span style=\"color: #333333;\">For best practices, Ansible can encrypt this file into the Ansible Vault. This would prevent the password from being stored here in clear text. For this lab, we are attempting to k<\/span><span style=\"color: #333333;\">eep the configuration as simple as possible. Naturally in production this would not be appropriate.<\/span><\/em><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\"><em>The <\/em><\/span><span style=\"color: #333333;\"><em>powershell<\/em><\/span><span style=\"color: #333333;\"><em> script must be run on the windows client <\/em><\/span><span style=\"color: #333333;\"><em>in order for<\/em><\/span><span style=\"color: #333333;\"><em> ansible to be table to talk to the host without issues.<\/em><\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"text-decoration: underline; color: #333333;\">Configure Windows <\/span><span style=\"text-decoration: underline; color: #333333;\">Servers to Manage<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">To configure the Windows Server for remote management by Ansible requires a bit of work. Luckily the Ansible team has created a PowerShell script for this. Download this script from [here] to each Windows Server to manage and run this scr<\/span><span style=\"color: #333333;\">ipt as Administrator.<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">Loginto\u00a0<\/span><strong><span style=\"color: #333333;\">WinServer1<\/span><\/strong><span style=\"color: #333333;\">\u00a0as Administrator, download\u00a0<\/span><a href=\"https:\/\/github.com\/ansible\/ansible\/blob\/devel\/examples\/scripts\/ConfigureRemotingForAnsible.ps1\"><span style=\"color: #fc542b;\">ConfigureRemotingForAnsible.ps1\u00a0<\/span><\/a><span style=\"color: #333333;\">and run this PowerShell script without any <\/span><span style=\"color: #333333;\">parameters.<\/span><span style=\"color: #333333;\">Once this command has been run on the\u00a0<\/span><strong><span style=\"color: #333333;\">WinServer1<\/span><\/strong><span style=\"color: #333333;\">, return to the Ansible1 Controller host.<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">Test Connectivity to the Windows Server<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">If all has gone well, we should be able to perform an Ansible PING test command. This command will simply connect<\/span><span style=\"color: #333333;\"> to the remote\u00a0<\/span><strong><span style=\"color: #333333;\">WinServer1<\/span><\/strong><span style=\"color: #333333;\">\u00a0server and report success or failure.<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\"><br \/>\nType:<\/span><br \/>\n<strong><span style=\"color: #333333;\">ansible windows -m <\/span><span style=\"color: #333333;\">win_ping<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">This command runs the Ansible module \u201c<\/span><span style=\"color: #333333;\">win_ping<\/span><span style=\"color: #333333;\">\u201d on every server in the \u201cwindows\u201d inventory group.<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">Type:\u00a0<\/span><strong><span style=\"color: #333333;\">ansible windows -m setup<\/span><\/strong><span style=\"color: #333333;\">\u00a0to retrieve a complete config<\/span><span style=\"color: #333333;\">uration of Ansible environmental settings.<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">Type:\u00a0<\/span><strong><span style=\"color: #333333;\">ansible windows -c ipconfig<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">If this command is successful, the next steps will be to build Ansible playbooks to manage Windows Servers.<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">Managing Windows Servers with Playbooks<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">\u00a0<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">Let\u2019s<\/span><span style=\"color: #333333;\"> create some <\/span><span style=\"color: #333333;\">playbooks and test Ansible for real on Windows systems.<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">Create a folder on\u00a0<\/span><strong><span style=\"color: #333333;\">Ansible1<\/span><\/strong><span style=\"color: #333333;\">\u00a0for the playbooks, YAML files, modules, scripts, etc. For these exercises we created a folder under \/root called <\/span><span style=\"color: #333333;\">win_playbooks<\/span><span style=\"color: #333333;\">.<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">Ansible has some expectations on the directo<\/span><span style=\"color: #333333;\">ry structure where playbooks reside. Create the library and scripts folders for use later in this exercise.<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">Commands:<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">cd \/root<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">mkdir<\/span> <span style=\"color: #333333;\">win_playbooks<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">mkdir<\/span> <span style=\"color: #333333;\">win_playbooks<\/span><span style=\"color: #333333;\">\/library<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">mkdir<\/span> <span style=\"color: #333333;\">win_playbooks<\/span><span style=\"color: #333333;\">\/scripts<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 7.5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">Create the first playbook example <\/span><span style=\"color: #333333;\">\u201c<\/span><span style=\"color: #333333;\">netstate.yml<\/span><span style=\"color: #333333;\">\u201d<\/span><br \/>\n<span style=\"color: #333333;\">The contents are:<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">\u2013 name: test <\/span><span style=\"color: #333333;\">cmd<\/span><span style=\"color: #333333;\"> from <\/span><span style=\"color: #333333;\">win_command<\/span><span style=\"color: #333333;\"> module<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">\u00a0 hosts: windows<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">\u00a0 tasks:<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">\u00a0\u00a0\u00a0 \u2013 name: run netstat and return Ethernet stats<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #333333;\">win_command<\/span><span style=\"color: #333333;\">: netstat -e<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">\u00a0\u00a0\u00a0\u00a0\u00a0 register: netstat<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">\u00a0\u00a0\u00a0 \u2013 debug: var=netstat<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><em><span style=\"color: #333333;\">This playbook does only one<\/span><span style=\"color: #333333;\"> task, to connect to the servers in the Ansible inventory group \u201cwindows\u201d and run the command\u00a0<\/span><strong><span style=\"color: #333333;\">netstat.exe -a<\/span><\/strong><span style=\"color: #333333;\">\u00a0and return the results.<\/span><\/em><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><em><span style=\"color: #333333;\">To run this playbook, run this command on\u00a0<\/span><strong><span style=\"color: #333333;\">Ansible1<\/span><\/strong><\/em><span style=\"color: #333333;\">:<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"text-decoration: underline; color: #333333;\">Errors that I ran into<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"color: #333333;\">Now on ubuntu you might get some SSL error when<\/span><span style=\"color: #333333;\"> trying to run a playbook. This is because the python libraries are trying to verify the <\/span><span style=\"color: #333333;\">self signed<\/span><span style=\"color: #333333;\"> cert before opening a secure connection <\/span><span style=\"color: #333333;\">via https<\/span><span style=\"color: #333333;\">. <\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">ansible windows -m <\/span><span style=\"color: #333333;\">win_ping<\/span><\/strong><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><em><span style=\"color: #455464; background-color: #ffffff;\">Wintestserver1 | UNREACHABLE! =&gt; {\u00a0<\/span><\/em><br \/>\n<em><span style=\"color: #455464; background-color: #ffffff;\">&#8220;changed&#8221;: false,\u00a0<\/span><\/em><br \/>\n<em><span style=\"color: #455464; background-color: #ffffff;\">&#8220;<\/span><span style=\"color: #455464; background-color: #ffffff;\">msg<\/span><span style=\"color: #455464; background-color: #ffffff;\">&#8220;: &#8220;<\/span><span style=\"color: #455464; background-color: #ffffff;\">ssl<\/span><span style=\"color: #455464; background-color: #ffffff;\">: <\/span><span style=\"color: #455464; background-color: #ffffff;\">500 <\/span><span style=\"color: #455464; background-color: #ffffff;\">WinRMTransport<\/span><span style=\"color: #455464; background-color: #ffffff;\">. [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)&#8221;,\u00a0<\/span><\/em><br \/>\n<em><span style=\"color: #455464; background-color: #ffffff;\">&#8220;unreachable&#8221;: true\u00a0<\/span><\/em><br \/>\n<em><span style=\"color: #455464; background-color: #ffffff;\">}\u00a0<\/span><\/em><br \/>\n<em><span style=\"color: #455464; background-color: #ffffff;\">.\u00a0<\/span><\/em><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>How you can get around the is update the python library to not care about looking for a valid cert and just open a secure connection. <\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>Edit <em>\/usr\/lib\/python2.7\/sitecustomize.py<\/em><\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>import ssl<\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>try:<\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong> _create_unverified_https_context = ssl._create_unverified_context<\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>except AttributeError:<\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong> # Legacy Python that doesn&#8217;t verify HTTPS certificates by default<\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong> pass<\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>else:<\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong> # Handle target environment that doesn&#8217;t support HTTPS verification<\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>\u00a0\u00a0\u00a0\u00a0ssl._create_default_https_context = _create_unverified_https_context<\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; <\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><span style=\"color: #455464; background-color: #ffffff;\">Then it should look like this<\/span><\/p>\n<p style=\"text-align: justify; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong><span style=\"color: #333333;\">ansible windows -m <\/span><span style=\"color: #333333;\">win_ping<\/span><\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><span style=\"color: #455464; background-color: #ffffff;\">wintestse<\/span><span style=\"color: #455464; background-color: #ffffff;\">rver1 | SUCCESS =&gt; {\u00a0<\/span><br \/>\n<span style=\"color: #455464; background-color: #ffffff;\">&#8220;changed&#8221;: false,\u00a0<\/span><br \/>\n<span style=\"color: #455464; background-color: #ffffff;\">&#8220;ping&#8221;: &#8220;pong&#8221;\u00a0<\/span><br \/>\n<span style=\"color: #455464; background-color: #ffffff;\">}<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>Proxies and WSUS:<\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>If you are using these you to disable proxies check on your host simply export<\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>export no_proxy=127.0.0.1, winserver1, etc,<\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><strong>Or add a file in \/etc\/profile.d\/whatever.sh<\/strong><\/p>\n<p style=\"margin-top: 5pt; padding-top: 0; margin-bottom: 5pt; padding-bottom: 0; line-height: 1.2; font-size: 12pt;\"><strong>If you have WSUS configured you will need to check to see if there are updates from there or they will not show when the yaml searches for new updates. <\/strong><\/p>\n<p>Test windows updates yaml: The formatting is all wrong below so click on the link and it will have the proper formatted yaml for windows update.<\/p>\n<p style=\"margin-top: 5pt; padding-top: 0; margin-bottom: 5pt; padding-bottom: 0; line-height: 1.2;\">&#8212;<br \/>\n&#8211; hosts: windows<br \/>\ngather_facts: no<\/p>\n<p style=\"margin-top: 5pt; padding-top: 0; margin-bottom: 5pt; padding-bottom: 0; line-height: 1.2;\">tasks:<br \/>\n&#8211; name: Search Windows Updates<br \/>\nwin_updates:<br \/>\ncategory_names:<br \/>\n&#8211; SecurityUpdates<br \/>\n&#8211; CriticalUpdates<br \/>\n&#8211; UpdateRollups<br \/>\n&#8211; Updates<br \/>\nstate: searched<br \/>\nlog_path: C:\\ansible_wu.txt<\/p>\n<p style=\"margin-top: 5pt; padding-top: 0; margin-bottom: 5pt; padding-bottom: 0; line-height: 1.2;\">&#8211; name: Install updates<br \/>\nwin_updates:<br \/>\ncategory_names:<br \/>\n&#8211; SecurityUpdates<br \/>\n&#8211; CriticalUpdates<br \/>\n&#8211; UpdateRollups<br \/>\n&#8211; Updates<\/p>\n<p style=\"margin-top: 5pt; padding-top: 0; margin-bottom: 5pt; padding-bottom: 0; line-height: 1.2;\">\u00a0<span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"margin-top: 5pt; padding-top: 0; margin-bottom: 5pt; padding-bottom: 0; line-height: 1.2;\">If it works properly the log file on the test host will have something like the following:\u00a0C:\\ansible_wu.txt<\/p>\n<p style=\"margin-top: 5pt; padding-top: 0; margin-bottom: 5pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"text-decoration: underline;\"><em>Logs show the update<\/em><\/span><\/strong><\/p>\n<p style=\"margin-top: 5pt; padding-top: 0; margin-bottom: 5pt; padding-bottom: 0; line-height: 1.2;\">2018-06-04 08:47:54Z Creating Windows Update session&#8230;<br \/>\n2018-06-04 08:47:54Z Create Windows Update searcher&#8230;<br \/>\n2018-06-04 08:47:54Z Search criteria: (IsInstalled = 0 AND CategoryIds contains &#8216;0FA1201D-4330-4FA8-8AE9-B877473B6441&#8217;) OR(IsInstalled = 0 AND CategoryIds contains &#8216;E6CF1350-C01B-414D-A61F-263D14D133B4&#8242;) OR(IsInstalled = 0 AND CategoryIds contains &#8217;28BC880E-0592-4CBF-8F95-C79B17911D5F&#8217;) OR(IsInstalled = 0 AND CategoryIds contains &#8216;CD5FFD1E-E932-4E3A-BF74-18BF0B1BBD83&#8217;)<br \/>\n2018-06-04 08:47:54Z Searching for updates to install in category Ids 0FA1201D-4330-4FA8-8AE9-B877473B6441 E6CF1350-C01B-414D-A61F-263D14D133B4 28BC880E-0592-4CBF-8F95-C79B17911D5F CD5FFD1E-E932-4E3A-BF74-18BF0B1BBD83&#8230;<br \/>\n2018-06-04 08:48:33Z Found 2 updates<br \/>\n2018-06-04 08:48:33Z Creating update collection&#8230;<br \/>\n2018-06-04 08:48:33Z Adding update 67a00639-09a1-4c5f-83ff-394e7601fc03 &#8211; Security Update for Windows Server 2012 R2 (KB3161949)<br \/>\n2018-06-04 08:48:33Z Adding update ba0f75ff-19c3-4cbd-a3f3-ef5b5c0f88bf &#8211; Security Update for Windows Server 2012 R2 (KB3162343)<br \/>\n2018-06-04 08:48:33Z Calculating pre-install reboot requirement&#8230;<br \/>\n2018-06-04 08:48:33Z Check mode: exiting&#8230;<br \/>\n2018-06-04 08:48:33Z Return value:<br \/>\n{<br \/>\n&#8220;updates&#8221;: {<br \/>\n&#8220;67a00639-09a1-4c5f-83ff-394e7601fc03&#8221;: {<br \/>\n&#8220;title&#8221;: &#8220;Security Update for Windows Server 2012 R2 (KB3161949)&#8221;,<br \/>\n&#8220;id&#8221;: &#8220;67a00639-09a1-4c5f-83ff-394e7601fc03&#8221;,<br \/>\n&#8220;installed&#8221;: false,<br \/>\n&#8220;kb&#8221;: [<br \/>\n&#8220;3161949&#8221;<br \/>\n]<br \/>\n},<br \/>\n&#8220;ba0f75ff-19c3-4cbd-a3f3-ef5b5c0f88bf&#8221;: {<br \/>\n&#8220;title&#8221;: &#8220;Security Update for Windows Server 2012 R2 (KB3162343)&#8221;,<br \/>\n&#8220;id&#8221;: &#8220;ba0f75ff-19c3-4cbd-a3f3-ef5b5c0f88bf&#8221;,<br \/>\n&#8220;installed&#8221;: false,<br \/>\n&#8220;kb&#8221;: [<br \/>\n&#8220;3162343&#8221;<br \/>\n]<br \/>\n}<br \/>\n},<br \/>\n&#8220;found_update_count&#8221;: 2,<br \/>\n&#8220;changed&#8221;: false,<br \/>\n&#8220;reboot_required&#8221;: false,<br \/>\n&#8220;installed_update_count&#8221;: 0,<br \/>\n&#8220;filtered_updates&#8221;: {<\/p>\n<p style=\"margin-top: 5pt; padding-top: 0; margin-bottom: 5pt; padding-bottom: 0; line-height: 1.2;\">}<br \/>\n}<\/p>\n<p>Written By Nick Tailor<\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.28;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Note: This section assumes you already have ansible installed, working, active directory setup, and test windows host in communication with AD. Although its not needed to have AD. Its good practice for to have it all setup talking to each other for learning. . Setup Now Ansible does not come with windows managing ability out of the box. Its is<a href=\"https:\/\/nicktailor.com\/tech-blog\/how-to-configure-ansible-to-manage-windows-hosts-on-ubuntu-16-04\/\" class=\"read-more\">Read More &#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[],"class_list":["post-745","post","type-post","status-publish","format-standard","hentry","category-ansible"],"_links":{"self":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts\/745","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/comments?post=745"}],"version-history":[{"count":9,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts\/745\/revisions"}],"predecessor-version":[{"id":1047,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts\/745\/revisions\/1047"}],"wp:attachment":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/media?parent=745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/categories?post=745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/tags?post=745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}