Cloud automation and infrastructure standardization at Red Hat Open Tour 2022

We participated in Red Hat Open Tour 2022 Tallinn a while back. Johan Wennerberg, who is a Solution Architect for Red Hat Nordics in Stockholm, gave a presentation titled “Gain robust repeatability as self.service, by automating your automation”. Among other things he discussed the importance and use-cases of Cloud infrastructure standardization and automation. Here I willsummarize his views on standardization and automation and explain how they tie in with our focus on quality in the Cloud infrastructure and elsewhere.
Enabling Azure Backup on Linux VMs with Terraform
This article shows you how to enable Azure Backup on Linux VMs. It is recommended to read the Understanding Azure Backup for Linux VMs article first before trying to enable backups with Terraform. Terraform AzureRM provider has three relevant resources:
- azurerm_linux_virtual_machine: parameters provision_vm_agent and allow_extension_operations should be true or enabling backups will fail (with or without Terraform)
- azurerm_virtual_machine_extension: this can be used to run/enable a VM extension on a VM
- azurerm_backup_protected_vm: this resource enables backups on a VM
- azurerm_recovery_services_vault: the recovery services vault where backups will be stored
- azurerm_backup_policy_vm: backup schedule and retainment rules
I’ll go through the basic process first, which may work for some people. I’ll then take a deep dive into the timeout issues you may or may not encounter in your environment.
Understanding Azure Backup for Linux VMs
Azure Backup is an Azure service that allows, among other things, backing up Windows and Linux VMs in Azure. The backups are essentially virtual machine snapshots, but backing up and/or restoring individual files is also possible. This article tries to explain how Azure Backup and Linux VMs interact and what is required for them to work. If you’re interested in using Terraform to configure Azure Backup, please have a look at the Enabling Azure Backup on Linux VMs with Terraform article.
Terraform: converting an aws_instance network interface into an explicitly managed interface
The aws_instance resource in Terraform can automatically create the default network interface for you. There are cases, however, when you notice that the default network interface is not enough anymore, and modifying it via the limited aws_instance parameters is not sufficient. In these cases you can convert the interface into an aws_network_interface resource, but the process is far from straightforward.
The first step is to create a Terraform resource for the network interface:
Managing custom realm keys in Keycloak programmatically
What are Keycloak realm keys?
Keycloak’s authentication protocols make use of private and public keys for signing and encrypting, as described in the official documentation. These keys are realm-specific, and by default managed internally in Keycloak. So, when you create a realm using the Keycloak Admin API, kcadm.sh or manually using the Web UI, new keypair(s) get generated automatically. These are called “Managed keys”. However, you can also use custom realm keys in Keycloak, which is what this article is about. Using custom realm keys allow you, for example, to use a single keypair in multiple realms. When you import a custom private key, Keycloak uses it to automatically create a certificate. If you want, you can pass both a private key and a certificate signed with that private key instead. That way you can bypass Keycloak’s automatic certificate generation, should you need to.
Modern cronjob part 1: Azure Automation with Terraform
Microsoft Azure has a nice service for scheduling tasks called Azure Automation. While Azure Automation is able to other things as well, such as being able to act as a Powershell DSC pull server, we’ll focus on the runbooks and scheduling. Runbooks are scripts that do things, e.g. run maintenance and reporting tasks. Runbooks often, but not necessarily manipulate objects in Azure. Runbooks are serverless like Azure Functions and the pricing is therefore similar - you pay for the amount of computing resources you use and don’t have to pay for a server that’s mostly idle.
Multi-part cloud-init provisioning with Terraform
Cloud-Init is “a standard for customizing” cloud instances, typically on their first boot. It is allows mixing state-based configuration management with imperative provisioning commands (details in our IaC article). By using cloud-init most of the annoyances of SSH-based provisioning can be avoided:
-
Having to use (possibly shared) SSH keys for provisioning
-
Having to have direct network access to the VM being provisioned (may require a VPN connection)
That said, neither cloud-init itself, nor its use within Terraform is particularly well documented. Therefore it can be an effort to create cloud-init-based provisioning that works and adapts easily to different use-cases. This article attempts to fill that gap to some extent.
Data-driven Terraform: Kubernetes cluster in Hetzner Cloud
Terraform does not have a particularly strong decoupling between data and code, at least not from a best practices perspective. It is possible and useful, however, to use data to define Terraform resources - if not for any other reason but to reduce code repetition for common resources that require defining lots of parameters. Here’s an example of setting up a Kubernetes cluster in Hetzner Cloud using Terraform with a “data-driven” approach:
Debugging Puppet Bolt inventory plugins
Puppet Bolt handles inventories in a very flexible and powerful manner: you can combine static target definitions and different targets into a single inventory. For example, you can have an inventory which defines some static node names combined with the AWS inventory, or one that combines static nodes with the Vagrant inventory.
Puppet Bolt inventory plugins do their magic and then output what is essentially a static inventory generated dynamically. When dynamic inventory plugins do not work (as in my case) it can be challenging to figure out what is wrong, let alone how to fix it. However, there’s is a very handy way to print out a static version of the entire inventory, including the dynamically created content:
Are Corporate Vision awards fake?
This was a burning question in my head in September 2021 but didn’t have much luck googling it. Here’s our experience and analysis of Small Business Awards by Corporate Vision. Read on to find out whether the awards handed out by Corporate Vision awards truly are a legit or not.
How did we hear about Corporate Vision?
Corporate Vision contacted us in September 2021 announcing us that we were nominated as candidate for being the best company in the ‘IT Infrastructure Management Specialists - Finland’ category for Small Business Awards. At that time (before this blog post) there was very little information online about Small Business Awards or the company behind them. What I learned at that time was that they seemed to be a so-called ‘vanity award’, where winners have been preselected and everything else was just for show. We could not be absolutely sure about that then, and we thought that “winning” might have some marketing value, so we decided to play along and see where it leads us. I will first go through the process, then I’ll try to give an answer the question in the title.