Ansible, Windows and PowerShell: the Basics – Part 4, Invoking PowerShell Code

In Part 4 of this series we’ll continue our journey with Ansible, Windows and PowerShell and look at how we can use Ansible to invoke PowerShell code directly. Our job template in AWX to test out the possible different scenarios is _3_invoke-powershell The contents of _3_invoke-powershell.yml are are follows: There are three main options we can take for approaching invoking PowerShell code, all using the win_shell module in some form.

Ansible, Windows and PowerShell: the Basics – Part 3, Windows Roles and Features

In Part 3 of this series we’ll continue our journey with Ansible, Windows and PowerShell and look at how we can use Ansible to prepare servers with Windows Roles and Features. The PowerShell story around support for Windows Roles and Features can be a little confusing, since there are two different sets of PowerShell cmdlets as well as the cmdline tools dism.exe and pkgmgr.exe. So knowing which tool to use to start with requires some effort itself.

Ansible, Windows and PowerShell: the Basics - Part 2, Install PowerShell Modules

In Part 2 of this series we’ll move on from the introductory topics and look at how we can use Ansible to prepare servers with any external PowerShell Modules they need from the PowerShell Gallery. Our job template in AWX is _1_install-psmodule The contents of _1_install-psmodule.yml are are follows: We can use the native Ansible module win_psmodule to do the work for us. In addition, we can ensure multiple modules are installed without needing a separate task for each one by looping using with_items.

Ansible, Windows and PowerShell: the Basics - Part 1, Windows Services

In Part 1 of this series we’ll warm up by taking a look at the lab setup I am using, configuring some basics in AWX and what’s possible with the Ansible win_service module to configure Windows services. Lab details: For Ansible, I’m using AWX deployed in containers based from the example documented here. Additionally, I have two Windows 2016 VMs. One to provide some basic Windows services such as DNS and Active Directory.

Ansible, Windows and PowerShell: the Basics - Introduction

Back in June of this year I presented a session at PowerShell Southampton on using Ansible and PowerShell together. There was a fair amount of interest in this topic both at the event and online afterwards, so I decided to follow it up here with a series of posts looking at the basics for someone getting started with Ansible. In particular using it to automate and configure Windows, where to use PowerShell for that task and sometimes where not to if there is native functionality already available within Ansible.

Connecting To An ESXi Host With No Root Password Set

As part of some automated deployment work for ESXi I was assisting a colleague with, they had hit an issue with an out of the box deployment of ESXi beginning with a blank password for the root account. The automation tool of choice Ansible was using an SSH connection to ESXi to make the initial configuration and was blocked at the first step since it was unable to connect because the fresh ESXi install had no password set.

PSDayUK 2019 Schedule - Track 3

PSDay.UK 2019 takes place on Saturday 28th September 2019 in Birmingham at the International Convention Centre (ICC) for a fun day learning PowerShell, DevOps, Cloud & Automation from community & industry experts for Beginners to Advanced practitioners. In this short series of posts, I’m going to highlight the three session tracks from which you can pick during the day. https://psday.uk/ In this post, we’ll look at Track 3. https://twitter.com/cj_berlin https://twitter.com/rsiddaway

PSDayUK 2019 Schedule - Track 2

PSDay.UK 2019 takes place on Saturday 28th September 2019 in Birmingham at the International Convention Centre (ICC) for a fun day learning PowerShell, DevOps, Cloud & Automation from community & industry experts for Beginners to Advanced practitioners. In this short series of posts, I’m going to highlight the three session tracks from which you can pick during the day. https://psday.uk/ In this post, we’ll look at Track 2. https://twitter.com/chri_tea https://twitter.com/cbergmeister

PSDayUK 2019 Schedule - Track 1

PSDay.UK 2019 takes place on Saturday 28th September 2019 in Birmingham at the International Convention Centre (ICC) for a fun day learning PowerShell, DevOps, Cloud & Automation from community & industry experts for Beginners to Advanced practitioners. In this short series of posts, I’m going to highlight the three session tracks from which you can pick during the day. https://psday.uk/ In this post, we’ll look at Track 1. https://twitter.com/jamesoneill https://twitter.com/nohwnd

Running PowerShell Core Commands in a Linux Target from Ansible

Ansible has modules shell, for executing commands against Linux targets, and win_shell for executing commands against Windows targets - typically using PowerShell. So I was curious to see if it was possible to execute commands in a Linux target using PowerShell Core and if so, how to do it. For my test I have an Ubuntu 18.04 VM with PowerShell 7.3.5 installed: The shell module has an executable parameter described as “Change the shell used to execute the command.