Posts by Category

powershell

Secure Azure Provisioning with Terraform Backend and Azure Key Vault

2 minute read

Scenario Terraform is my favourite tool when provisioning resources in Azure. However, by default Terraform saves a local state file (terraform.tfstate) that includes sensitive data (passwords etc) in clear text. Another issue was other collaborators could not access my state file. I needed a s...

Automate Creating a Nested vSphere Environment on a Physical ESXi Host

1 minute read

Scenario I wanted to quickly build a vSphere environment so I could test provisioning and configuration with other tools like Terraform and Ansible. I had an old desktop PC lying around with 32GB RAM and several SSDs, so decided to use that. Solution Preparation First, I prepared the physica...

Create an Azure Service Principal for Ansible Tower (AWX)

1 minute read

Scenario You want to test Azure Provisioning using Ansible Tower (or the Open Source version, AWX) so you’ll need a way to authenticate with Azure. Solution An Azure Service Principle will need to be created so that Ansible Tower can authenticate. Method 1: Azure CLI Install the Azure CLI...

DSC Package Resource Gotcha

less than 1 minute read

Scenario This quick post covers a gotcha I found using the DSC Package resource. I was having issues installing the Microsoft SQL Server 2012 Native Client (Direct Download: http://go.microsoft.com/fwlink/?LinkID=239648&clcid=0x409) like so. Package 'Sqlncli' { Ensure = 'Present' ...

Get Product ID GUID Directly From MSI File

less than 1 minute read

Scenario You need to find an MSI Product ID / GUID, but don’t want to install it first. Solution The classic way to find an MSI Product ID / GUID is the install it first and interrogate the registry using code like this: However, there is an easier way that doesn’t require installing the p...

Error defining PSDscRunAsCredential Parameter in DSC Configuration

less than 1 minute read

Scenario The following error was occurring whilst testing a DSC Configuration: At line:1 char:15 + Configuration Test { + ~~~~ ConfigurationStatementToken: System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(E...

Using VSTS Package Management for PowerShell Modules

1 minute read

Scenario I wanted to store my PowerShell Modules in VSTS and then install those modules during automated Builds / Releases. Solution Create a New Feed Install Package Management in VSTS from the Marketplace. This is free for up to 5 users. Create a feed called psmodules: Once the ...

Back to top ↑

ansible

Azure Provisioning using Ansible AWX (Tower)

1 minute read

Scenario You’ve installed and tested Ansible locally, then installed Ansible AWX (Open Source Ansible Tower) using Docker, and finally tested Ansible AWX with Windows Hosts. You now want to test Azure Provisioning using Ansible AWX. Solution Building upon the work I did in previous posts, I’v...

Create an Azure Service Principal for Ansible Tower (AWX)

1 minute read

Scenario You want to test Azure Provisioning using Ansible Tower (or the Open Source version, AWX) so you’ll need a way to authenticate with Azure. Solution An Azure Service Principle will need to be created so that Ansible Tower can authenticate. Method 1: Azure CLI Install the Azure CLI...

Azure Credential Error When Adding to a Job Template via Ansible Tower CLI

1 minute read

Problem Whilst I was working out how to automate Ansible Tower (AWX) using the tower-cli command line tool , I came across an error when trying to create a Job Template using a Microsoft Azure Resource Manager credential, and couldn’t find a solution anywhere online. These were the steps I took...

Testing Ansible AWX with Windows Hosts

2 minute read

Scenario After installing Ansible AWX using Docker to test within a Windows environment, I wanted to configure and test Ansible AWX. Solution Although there is an excellent Quick Setup Guide available for Ansible Tower (the commercial version of AWX), I’ll be going over the steps I took to imp...

Installing Ansible AWX using Docker

2 minute read

Scenario After installing Ansible to test within a Windows environment, I wanted to explore other methods of administering and using Ansible other than from the commandline. Solution Although there was a commercial product called Ansible Tower available for testing, I wanted to explore the ups...

Using Ansible and DSC with Windows

2 minute read

Updated: 2019-01-03 Changed CentOS Vagrant box to 7.6 and now using PIP for Ansible installation. Scenario For the past year or so I’ve been teaching my friend Steve about the many tools and techniques I’ve been using at work, including: Git Vagrant Packer PowerShell (various topics l...

Back to top ↑

ansible-tower

Azure Provisioning using Ansible AWX (Tower)

1 minute read

Scenario You’ve installed and tested Ansible locally, then installed Ansible AWX (Open Source Ansible Tower) using Docker, and finally tested Ansible AWX with Windows Hosts. You now want to test Azure Provisioning using Ansible AWX. Solution Building upon the work I did in previous posts, I’v...

Create an Azure Service Principal for Ansible Tower (AWX)

1 minute read

Scenario You want to test Azure Provisioning using Ansible Tower (or the Open Source version, AWX) so you’ll need a way to authenticate with Azure. Solution An Azure Service Principle will need to be created so that Ansible Tower can authenticate. Method 1: Azure CLI Install the Azure CLI...

Azure Credential Error When Adding to a Job Template via Ansible Tower CLI

1 minute read

Problem Whilst I was working out how to automate Ansible Tower (AWX) using the tower-cli command line tool , I came across an error when trying to create a Job Template using a Microsoft Azure Resource Manager credential, and couldn’t find a solution anywhere online. These were the steps I took...

Testing Ansible AWX with Windows Hosts

2 minute read

Scenario After installing Ansible AWX using Docker to test within a Windows environment, I wanted to configure and test Ansible AWX. Solution Although there is an excellent Quick Setup Guide available for Ansible Tower (the commercial version of AWX), I’ll be going over the steps I took to imp...

Installing Ansible AWX using Docker

2 minute read

Scenario After installing Ansible to test within a Windows environment, I wanted to explore other methods of administering and using Ansible other than from the commandline. Solution Although there was a commercial product called Ansible Tower available for testing, I wanted to explore the ups...

Back to top ↑

awx

Azure Provisioning using Ansible AWX (Tower)

1 minute read

Scenario You’ve installed and tested Ansible locally, then installed Ansible AWX (Open Source Ansible Tower) using Docker, and finally tested Ansible AWX with Windows Hosts. You now want to test Azure Provisioning using Ansible AWX. Solution Building upon the work I did in previous posts, I’v...

Create an Azure Service Principal for Ansible Tower (AWX)

1 minute read

Scenario You want to test Azure Provisioning using Ansible Tower (or the Open Source version, AWX) so you’ll need a way to authenticate with Azure. Solution An Azure Service Principle will need to be created so that Ansible Tower can authenticate. Method 1: Azure CLI Install the Azure CLI...

Azure Credential Error When Adding to a Job Template via Ansible Tower CLI

1 minute read

Problem Whilst I was working out how to automate Ansible Tower (AWX) using the tower-cli command line tool , I came across an error when trying to create a Job Template using a Microsoft Azure Resource Manager credential, and couldn’t find a solution anywhere online. These were the steps I took...

Testing Ansible AWX with Windows Hosts

2 minute read

Scenario After installing Ansible AWX using Docker to test within a Windows environment, I wanted to configure and test Ansible AWX. Solution Although there is an excellent Quick Setup Guide available for Ansible Tower (the commercial version of AWX), I’ll be going over the steps I took to imp...

Installing Ansible AWX using Docker

2 minute read

Scenario After installing Ansible to test within a Windows environment, I wanted to explore other methods of administering and using Ansible other than from the commandline. Solution Although there was a commercial product called Ansible Tower available for testing, I wanted to explore the ups...

Back to top ↑

azure

Secure Azure Provisioning with Terraform Backend and Azure Key Vault

2 minute read

Scenario Terraform is my favourite tool when provisioning resources in Azure. However, by default Terraform saves a local state file (terraform.tfstate) that includes sensitive data (passwords etc) in clear text. Another issue was other collaborators could not access my state file. I needed a s...

Azure Provisioning using Ansible AWX (Tower)

1 minute read

Scenario You’ve installed and tested Ansible locally, then installed Ansible AWX (Open Source Ansible Tower) using Docker, and finally tested Ansible AWX with Windows Hosts. You now want to test Azure Provisioning using Ansible AWX. Solution Building upon the work I did in previous posts, I’v...

Create an Azure Service Principal for Ansible Tower (AWX)

1 minute read

Scenario You want to test Azure Provisioning using Ansible Tower (or the Open Source version, AWX) so you’ll need a way to authenticate with Azure. Solution An Azure Service Principle will need to be created so that Ansible Tower can authenticate. Method 1: Azure CLI Install the Azure CLI...

Azure Credential Error When Adding to a Job Template via Ansible Tower CLI

1 minute read

Problem Whilst I was working out how to automate Ansible Tower (AWX) using the tower-cli command line tool , I came across an error when trying to create a Job Template using a Microsoft Azure Resource Manager credential, and couldn’t find a solution anywhere online. These were the steps I took...

Back to top ↑

dsc

Using Ansible and DSC with Windows

2 minute read

Updated: 2019-01-03 Changed CentOS Vagrant box to 7.6 and now using PIP for Ansible installation. Scenario For the past year or so I’ve been teaching my friend Steve about the many tools and techniques I’ve been using at work, including: Git Vagrant Packer PowerShell (various topics l...

DSC Package Resource Gotcha

less than 1 minute read

Scenario This quick post covers a gotcha I found using the DSC Package resource. I was having issues installing the Microsoft SQL Server 2012 Native Client (Direct Download: http://go.microsoft.com/fwlink/?LinkID=239648&clcid=0x409) like so. Package 'Sqlncli' { Ensure = 'Present' ...

Error defining PSDscRunAsCredential Parameter in DSC Configuration

less than 1 minute read

Scenario The following error was occurring whilst testing a DSC Configuration: At line:1 char:15 + Configuration Test { + ~~~~ ConfigurationStatementToken: System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(E...

Back to top ↑

windows

Testing Ansible AWX with Windows Hosts

2 minute read

Scenario After installing Ansible AWX using Docker to test within a Windows environment, I wanted to configure and test Ansible AWX. Solution Although there is an excellent Quick Setup Guide available for Ansible Tower (the commercial version of AWX), I’ll be going over the steps I took to imp...

Using Ansible and DSC with Windows

2 minute read

Updated: 2019-01-03 Changed CentOS Vagrant box to 7.6 and now using PIP for Ansible installation. Scenario For the past year or so I’ve been teaching my friend Steve about the many tools and techniques I’ve been using at work, including: Git Vagrant Packer PowerShell (various topics l...

Packer Example for Windows

5 minute read

Getting Started You can get started quickly by using Packer’s simple getting started guide, but you’ll soon want to delve into the documentation for more options and examples. Let’s install it and create our first image! You can find all example files in my GitHub repository here: https://gith...

Back to top ↑

error

Azure Credential Error When Adding to a Job Template via Ansible Tower CLI

1 minute read

Problem Whilst I was working out how to automate Ansible Tower (AWX) using the tower-cli command line tool , I came across an error when trying to create a Job Template using a Microsoft Azure Resource Manager credential, and couldn’t find a solution anywhere online. These were the steps I took...

Error defining PSDscRunAsCredential Parameter in DSC Configuration

less than 1 minute read

Scenario The following error was occurring whilst testing a DSC Configuration: At line:1 char:15 + Configuration Test { + ~~~~ ConfigurationStatementToken: System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(E...

Back to top ↑

msi

DSC Package Resource Gotcha

less than 1 minute read

Scenario This quick post covers a gotcha I found using the DSC Package resource. I was having issues installing the Microsoft SQL Server 2012 Native Client (Direct Download: http://go.microsoft.com/fwlink/?LinkID=239648&clcid=0x409) like so. Package 'Sqlncli' { Ensure = 'Present' ...

Get Product ID GUID Directly From MSI File

less than 1 minute read

Scenario You need to find an MSI Product ID / GUID, but don’t want to install it first. Solution The classic way to find an MSI Product ID / GUID is the install it first and interrogate the registry using code like this: However, there is an easier way that doesn’t require installing the p...

Back to top ↑

packer

Packer Example for Windows

5 minute read

Getting Started You can get started quickly by using Packer’s simple getting started guide, but you’ll soon want to delve into the documentation for more options and examples. Let’s install it and create our first image! You can find all example files in my GitHub repository here: https://gith...

Using Packer for Automated Machine Images

2 minute read

Before we get into the good stuff, let’s just pause for a moment and remember the “old way” of managing templates. The Old Way When I first started managing VMs many years ago, I was a big fan of using templates to quickly spin them up in a known, pre-configured state. Despite having this VM t...

Back to top ↑

templates

Packer Example for Windows

5 minute read

Getting Started You can get started quickly by using Packer’s simple getting started guide, but you’ll soon want to delve into the documentation for more options and examples. Let’s install it and create our first image! You can find all example files in my GitHub repository here: https://gith...

Using Packer for Automated Machine Images

2 minute read

Before we get into the good stuff, let’s just pause for a moment and remember the “old way” of managing templates. The Old Way When I first started managing VMs many years ago, I was a big fan of using templates to quickly spin them up in a known, pre-configured state. Despite having this VM t...

Back to top ↑

images

Packer Example for Windows

5 minute read

Getting Started You can get started quickly by using Packer’s simple getting started guide, but you’ll soon want to delve into the documentation for more options and examples. Let’s install it and create our first image! You can find all example files in my GitHub repository here: https://gith...

Using Packer for Automated Machine Images

2 minute read

Before we get into the good stuff, let’s just pause for a moment and remember the “old way” of managing templates. The Old Way When I first started managing VMs many years ago, I was a big fan of using templates to quickly spin them up in a known, pre-configured state. Despite having this VM t...

Back to top ↑

build

Packer Example for Windows

5 minute read

Getting Started You can get started quickly by using Packer’s simple getting started guide, but you’ll soon want to delve into the documentation for more options and examples. Let’s install it and create our first image! You can find all example files in my GitHub repository here: https://gith...

Using Packer for Automated Machine Images

2 minute read

Before we get into the good stuff, let’s just pause for a moment and remember the “old way” of managing templates. The Old Way When I first started managing VMs many years ago, I was a big fan of using templates to quickly spin them up in a known, pre-configured state. Despite having this VM t...

Back to top ↑

automation

Packer Example for Windows

5 minute read

Getting Started You can get started quickly by using Packer’s simple getting started guide, but you’ll soon want to delve into the documentation for more options and examples. Let’s install it and create our first image! You can find all example files in my GitHub repository here: https://gith...

Using Packer for Automated Machine Images

2 minute read

Before we get into the good stuff, let’s just pause for a moment and remember the “old way” of managing templates. The Old Way When I first started managing VMs many years ago, I was a big fan of using templates to quickly spin them up in a known, pre-configured state. Despite having this VM t...

Back to top ↑

centos

Installing Ansible AWX using Docker

2 minute read

Scenario After installing Ansible to test within a Windows environment, I wanted to explore other methods of administering and using Ansible other than from the commandline. Solution Although there was a commercial product called Ansible Tower available for testing, I wanted to explore the ups...

Using Ansible and DSC with Windows

2 minute read

Updated: 2019-01-03 Changed CentOS Vagrant box to 7.6 and now using PIP for Ansible installation. Scenario For the past year or so I’ve been teaching my friend Steve about the many tools and techniques I’ve been using at work, including: Git Vagrant Packer PowerShell (various topics l...

Back to top ↑

cli

Create an Azure Service Principal for Ansible Tower (AWX)

1 minute read

Scenario You want to test Azure Provisioning using Ansible Tower (or the Open Source version, AWX) so you’ll need a way to authenticate with Azure. Solution An Azure Service Principle will need to be created so that Ansible Tower can authenticate. Method 1: Azure CLI Install the Azure CLI...

Azure Credential Error When Adding to a Job Template via Ansible Tower CLI

1 minute read

Problem Whilst I was working out how to automate Ansible Tower (AWX) using the tower-cli command line tool , I came across an error when trying to create a Job Template using a Microsoft Azure Resource Manager credential, and couldn’t find a solution anywhere online. These were the steps I took...

Back to top ↑

vmware

Terraform vSphere Virtual Machine Customization Failed During Cloning

1 minute read

Scenario After automating the build of a nested vSphere environment, I wanted to test provisioning VMs in vSphere using Terraform. I’d created a Windows VM with some basic network configuration, sysprep’d it and powered down ready for the single snapshot expected when using Linked-Clones with T...

Automate Creating a Nested vSphere Environment on a Physical ESXi Host

1 minute read

Scenario I wanted to quickly build a vSphere environment so I could test provisioning and configuration with other tools like Terraform and Ansible. I had an old desktop PC lying around with 32GB RAM and several SSDs, so decided to use that. Solution Preparation First, I prepared the physica...

Back to top ↑

terraform

Secure Azure Provisioning with Terraform Backend and Azure Key Vault

2 minute read

Scenario Terraform is my favourite tool when provisioning resources in Azure. However, by default Terraform saves a local state file (terraform.tfstate) that includes sensitive data (passwords etc) in clear text. Another issue was other collaborators could not access my state file. I needed a s...

Terraform vSphere Virtual Machine Customization Failed During Cloning

1 minute read

Scenario After automating the build of a nested vSphere environment, I wanted to test provisioning VMs in vSphere using Terraform. I’d created a Windows VM with some basic network configuration, sysprep’d it and powered down ready for the single snapshot expected when using Linked-Clones with T...

Back to top ↑

vsts

Using VSTS Package Management for PowerShell Modules

1 minute read

Scenario I wanted to store my PowerShell Modules in VSTS and then install those modules during automated Builds / Releases. Solution Create a New Feed Install Package Management in VSTS from the Marketplace. This is free for up to 5 users. Create a feed called psmodules: Once the ...

Back to top ↑

gotcha

DSC Package Resource Gotcha

less than 1 minute read

Scenario This quick post covers a gotcha I found using the DSC Package resource. I was having issues installing the Microsoft SQL Server 2012 Native Client (Direct Download: http://go.microsoft.com/fwlink/?LinkID=239648&clcid=0x409) like so. Package 'Sqlncli' { Ensure = 'Present' ...

Back to top ↑

docker

Installing Ansible AWX using Docker

2 minute read

Scenario After installing Ansible to test within a Windows environment, I wanted to explore other methods of administering and using Ansible other than from the commandline. Solution Although there was a commercial product called Ansible Tower available for testing, I wanted to explore the ups...

Back to top ↑

fix

Azure Credential Error When Adding to a Job Template via Ansible Tower CLI

1 minute read

Problem Whilst I was working out how to automate Ansible Tower (AWX) using the tower-cli command line tool , I came across an error when trying to create a Job Template using a Microsoft Azure Resource Manager credential, and couldn’t find a solution anywhere online. These were the steps I took...

Back to top ↑