Due to billing or organizational structures, certain parts of the infrastructure could be divided over several Azure subscriptions. From an infrastructure management point of view however, it might be interesting to manage the resources in those multiple subscriptions in one Terraform playbook. In the required_providers section, the configuration_aliases must be configured first (usually in the…
Tag: Automation
Deploy a PostgreSQL database with an initial schema using Ansible
Ansible is a great automation tool to manage operating systems, but also to manage database like PostgreSQL. Many Ansible modules are available to create playbooks which execute various database administration tasks. In this article we will have a closer look how to ensure that a default database has been created a set of configured extensions…
Using Ansible to finalize Hashicorp Packer images
Ansible provides a more flexible way to fine-tune Hashicorp Packer images compared to cloud-init. Playbooks can be executed once the guest image building is ready and boots up for the first time. This allows to create different types of Packer images based on different playbooks. In this article, Packer images will created for Azure using…
Import configuration from Hiera or a Git repository with YAML files into Terraform
De-duplication of configuration information is key when managing large environments which use different types of automation (Terraform, Jenkins, Ansible, scripts executed as Systemd timers, Puppet…). Although many different configuration management tools exist (RDBMS, Consul, …), one of the easiest to use is Hiera or just a plain normal Git repository with YAML files, in some…
Terraform: Create a map of subnet IDs in Azure
The subnets accessor in the azurerm_virtual_network Terraform data source returns a list of subnet names only. In most cases however, you will need to use a or multiple subnet IDs, for instance when deploying virtual machines. Instead of creating a new datasource (for possibly a small list of subnets) for each virtual machine you want…