How to automate provisioning Jira test environment with an orchestration pipeline like Ansible
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
It's possible to declare the state of a test environment and automate Jira installation and database configuration using Ansible and Terraform. Below are the abstract step:
The steps outlined on this article are provided AS-IS. This means we’ve had reports of them working for some customers — under certain circumstances — yet are not officially supported, nor can we guarantee they’ll work for your specific scenario.
You may follow through and validate them on your own non-prod environments prior to production or fall back to supported alternatives if they don’t work out.
We also invite you to reach out to our Community for matters that fall beyond Atlassian’s scope of support!
Solution
Declare the infrastructure and let Terraform provision the resources
Use Ansible to install Jira
Provision an empty database like PostgreSQL with the required login credentials.
Update dbconfig.xml with the credentials and URL from previous step
Use Ansible to restore a database backup from a previously configured Jira instance (Snapshot taken after manual configuration up until the login screen).
Ensure the backup is from the same major version of Jira to avoid compatibility issues.
Before starting Jira, remove any existing server ID from the database snapshot to allow Jira to regenerate it.
If necessary, update the license using SQL queries after the database restore and before the application starts.
Was this helpful?