Menu

Virtual Geek

Tales from real IT system administrators world and non-production environment

Blog posts : "automation"

Terraform count vs for_each for examples with map of objects

In this Terraform article I have two examples for loop and count loop. I have one map of object. Where I will use both the loops on map to show how to use them in different way. You can check my earlier articles for different loops examples - Terraform for_each loop on map example and Terraform…

Read more

Terraform remote-exec provisioner with ssh connection in null_resource

This is a Terraform example of remote-exec provisioner with ssh connection using null_resource. To use remote-exec you need to provide remote server connection information. In my below example I am using and creating connection with ssh protocol to linux servers with terraform configuration. If you …

Read more

Terraform testing local variables and output csv file without resource Part 1

This is article is about how I test and verify my maps, list, object and sets values without any resources and to check provided objects are mentioned correctly. Here in below example I wanted to test csv file content in terraform. To check the same I created local variables from CSV file and watch …

Read more

Running Your First PowerShell Scripts With Jenkins and Git

Jenkins is the the top and leading open source automation server, It offers hundreds of plugins to help building (develop), deploying and automating any project. It is a great orchestration tool for automation. In this article I will use it to schedule a simple Job for PowerShell script using Git. 

Read more

Azure add create a Subnet to existing Virtual Network using PowerShell

This is second part of the earlier written article Create a Azure Virtual Network with Subnet using PowerShell. Here in this blog I will create subnet in already created Azure vNET (Virtual Network). I have defined Azure vNET and subnets in Powershell variables. I am creating a Azure vNET without a…

Read more

Ansible authenticate to Microsoft Azure using credential profiles Part 2

This part is continuation of Ansible authenticate to Microsoft Azure using credential profiles Part 1. Earlier I used automatic variables to use profile while executing ansible yaml script. But it is sometimes very inefficient, So inside the Ansible azure yaml code you can use profile parameter as…

Read more

Ansible authenticate to Microsoft Azure using credential profiles Part 1

My earlier article Quickstart How to authenticate Ansible with Microsoft Azure was for basic and foundation for authentication to azure using Ansible. But I have scenarios with multiple subscriptions to automate multiple azure clouds using Ansible, in that case I will make use of multiple credentia…

Read more

Deploy create Virtual Network vNET in Azure cloud using Ansible

This is ansible code example for deploying creating vNET (Virtual Network) on Microsoft Azure cloud. This is working basic ansible yaml/yaml script.

Below example shows how it is deployed using ansible-playbook command from the linux using ansible-playbook command.

Download this script here …

Read more

Azure PowerShell Get-AzStorageShare Could not get the storage context

While working with Azure Storage Account Shares report, while running below Azure az PowerShell command to get shares list, it was throwing error.

Get-AzStorageShare -Name testbackup
Get-AzStorageShare: could not get the storage context. Please pass in a storage context or set the current stor…

Read more

PowerCLI The SSL connection could not be established see inner exception

Recently while working with Vmware PowerCLI on one of my new laptop, when connecting to esxi server and vCenter server with Connect-VIserver command, I was receiving below error.

Connect-VIServer $esxiserver -User $user -Password $password
Connect-VIServer The SSL connection could not be estab…

Read more

Install the Microsoft Azure CLI on Ubuntu Linux

While working on one of the client's project I wanted to install and use Microsoft Azure-cli to manage Azure cloud on ubuntu (Get Started: Configure Ansible for Azure Cloud Infrastructure). This is step by step guide, First step I am updating and upgrading ubuntu system using apt-get. 

Microsoft Azure azure-cli az cli installation on linux sudo su - sudo apt-get update upgrade autoremove azure cloud automation.png

vj…

Read more

Hashicorp Terraform dynamic block for_each loop with example

I use Terraform IAC (Infrastructure as a code) a lot to design Azure resources, While deploying Azure Resource NSG (Network Security Group), I was defining multiple roles inside NSG, Roles were mentioned inside the main.tf code script file. I wanted roles values to be moved to variables inside v…

Read more

PowerShell convert string to base64 value

Base-64 encoding is a way of taking binary data and turning it into text so that it's more easily transmitted in things like e-mail and HTML form data. I had few requirement to convert / encode text string to Base64 string and vice versa, From encoded Base64 string to convert/decode to normal string…

Read more

Configure a Azure VM with Desired State Configuration in Automation Account

While working on one of the Azure Automation Accounts project I had to test and provide a demo of Desired State Configuration (DSC) on the Azure Virtual Machine, how it can be useful. There was a client requirment to not to use Group Policy for hardening, but the configuration must be done through D…

Read more

VMware PowerCLI Connect-VIserver Could not connect using the requested protocol

While working on one of the client systems, I freshly installed PowerCLI module and while connecting to VMware vCenter server I was receiving below error.

Another Error: VMware PowerCLI The remote server returned an error: (407) Proxy Authentication Required

Connect-VIServer :  6/05/2021 3:…

Read more

VMware ansible Error couldn't resolve module community.vmware

Recently while working with one of the old ansible server where I wanted to automation to get the list of VMware vCenter virtual machines list, and the ansible playbook was failing due to few prerequisite, In below script I was using community.vmware.vmware_vm_info ansible module/plugin to get th…

Read more

Microsoft Azure Rest API using PowerShell

Using Microsoft Azure REST API is great way to automate Azure Resources and operations. Some times I have found PowerShell Az module is not present on remote servers and I need to automate azure things, Rest API is very handy at the time when features which are not available on PowerShell module AZ.…

Read more

Reset Ansible AWX Tower admin password

While working on one of the project I came accross a Ansible AWX server where 'admin' password as missing, and I wanted to reset forgotten awx password, the steps given here will also work on RedHat Ansible Tower. In my case AWX is containerised and installed on docker, and I will run highlighted co…

Read more

Ansible AWX Tower create Manual SCM (Source Control Credential Type) project

I had a instance where I wanted to test Manual SCM (Source Control Credential Type) project on new Project on Ansible AWX tower instead of git repository. While creating a new project when choosing Manual from the Source Control Credential Type (SCM), I was receiving below error.

Getting started …

Read more

docker: Got permission denied while trying to connect to the Docker daemon socket

20 blog posts

Blog Search

Page Views

11241086

Follow me on Blogarama