Install and Use the Liquibase Ansible Role

Use the official Liquibase Ansible role to install Liquibase on your target servers. This role handles downloading, verifying, and placing Liquibase in your desired installation path.

Note: Starting with Liquibase version 4.32.0, we will no longer update this package manager with our latest software download packages.

Before you begin

Procedure

1

Install the Role

Install the Liquibase role from Ansible Galaxy:

ansible-galaxy role install liquibase.liquibase

If you instead need to update the role, run:

ansible-galaxy install --force liquibase.liquibase

To uninstall the role:

ansible-galaxy role remove liquibase.liquibase
2

Step up your inventory.

Create an inventory file, such as inventory.ini, and list your target hosts.

[liquibase_hosts]
10.0.0.1
10.0.0.2
10.0.0.3
3

Create a Playbook

Create a playbook file, such as playbook.yml, that uses the Liquibase role

- name: Install Liquibase
  hosts: liquibase_hosts
  become: 'yes'
  roles:
    - liquibase.liquibase

This installs the latest default version of Liquibase.

To install a specific version, include the liquibase_ver variable.

- name: Install Liquibase 4.26.0
  hosts: liquibase_hosts
  become: 'yes'
  roles:
    - role: liquibase.liquibase
      liquibase_ver: 4.26.0
4

Run the Playbook.

Use the ansible-playbook command to apply the role.

ansible-playbook -i inventory.ini playbook.yml
5

Verify Installation

After running the playbook, SSH into your target servers and run:

liquibase --version

This confirms Liquibase is installed and available.