Ansible is a very powerful language that can be used in infrastructure as code , or the idea of using playbooks that can deploy IT environments in a reproducible manner. One of the powerful features that Ansible provides is the concept of templates. Here, we’ll go over a simple example of how to deploy a MailEnable installation with a domain name, catch-all mailbox and other configuration options. First, we’ll need a short PowerShell script which will configure the MailEnable instance. Save this file as templates/install_mailenable.ps1 . $ErrorActionPreference = 'stop' Add-PSSnapin MailEnable.Provision.Command try { New-MailEnablePostOffice -Postoffice '' -Domain '' } catch { if (-Not ($_.Exception.Message -Like '*because they already existed')) { throw } } $mailbox_map = Get-MailEnableAddressMap -Postoffice '' -Mailbox postmaster | Where-Object { $_.SourceAddress -eq '[SMTP:*@]' } if ($mailbox_map -eq $nu
Posts about technology, DevOps, the cloud and more.