Mike Dietrich just announced a new AutoUpgrade release. If you haven’t heard about AutoUpgrade yet, you hit the right spot: it’s a pretty cool addition to any DBA’s toolbox. I use it all the time in Ansible, mainly because it makes installing an Oracle Home on a new server much much easier compared to the manual approach I previously used. That’s of course not the end of AutoUpgade’s abilities, but it’s a pretty nifty aspect of the tool that I would like to explore in this post.
I typically spawn new cloud VMs using Terraform, based on an Oracle Linux x86-64 image. Once provisioned, Ansible takes over and installs anything I might need, including AutoUpgrade. Thankfully Oracle provides download checksums and other metadata in https://download.oracle.com/otn-pub/otn_software/autoupgrade.json. On Oct 1st, 2026, the file read:
{ "name":"autoupgrade.jar", "version": "26.6", "downloadUrl": "https://download.oracle.com/otn-pub/otn_software/autoupgrade.jar", "checksum": "fd509ade67e1b54dc0ec44c8a39bf09caf268a049d5e95db1068216703202c8e", "releaseDateTime": "2026-09-29T10:00:00.000Z", "size":7421000}
I always verify checksums of downloads as a minimum way to make sure I got the right software, so let’s put the information in this file to good use. Let’s walk through the code. The following snippets are lifted from my autoupgrade installation (Ansible-) role.
- name: Download AutoUpgrade as oracle become: true become_user: oracle block: # ... - name: Download AutoUpgrade metadata ansible.builtin.get_url: url: https://download.oracle.com/otn-pub/otn_software/autoupgrade.json dest: /home/oracle/autoupgrade/autoupgrade.json mode: '0644'
The first step is to download the metadata file mentioned earlier using the get_url built-in. Previous steps in the playbook create the oracle user, and they aren’t shown here. The code, however, runs as the oracle user.
The file exists on the remote machine, managed by Ansible. Let’s parse it as an ansible fact
- name: Read AutoUpgrade metadata
ansible.builtin.slurp:
src: /home/oracle/autoupgrade/autoupgrade.json
register: autoupgrade_metadata_file
- name: Parse AutoUpgrade metadata
ansible.builtin.set_fact:
autoupgrade_metadata: "{{ autoupgrade_metadata_file.content | b64decode | from_json }}"
The slurp module returns a base64 encoded version of the file, it must be decoded first before it can be used. Next up it’s possible to use the metadata in the playbook. This snippet ensures the relevant directory structure is in place
- name: Create AutoUpgrade version directories
ansible.builtin.file:
path: "/home/oracle/autoupgrade/{{ autoupgrade_metadata.version }}/{{ item }}"
state: directory
mode: '0755'
loop:
- bin
- logs
- patches
Finally, it’s time to download the autoupgrade.jar (unless it exists) and make sure the downloaded file matches its checksum:
- name: Check whether AutoUpgrade JAR exists
ansible.builtin.stat:
path: "/home/oracle/autoupgrade/{{ autoupgrade_metadata.version }}/bin/autoupgrade.jar"
register: autoupgrade_jar
- name: Download and verify AutoUpgrade JAR
ansible.builtin.get_url:
url: "{{ autoupgrade_metadata.downloadUrl }}"
dest: "/home/oracle/autoupgrade/{{ autoupgrade_metadata.version }}/bin/autoupgrade.jar"
checksum: "sha256:{{ autoupgrade_metadata.checksum }}"
mode: '0644'
when: not autoupgrade_jar.stat.exists
That’s it – once the tool is installed, you can use it to your heart’s delight:
[oracle@demohost bin]$ java -jar autoupgrade.jar -versionbuild.version 26.6.260925build.date 2026/09/25 22:11:20 +0000build.hash e53aa37a5build.hash_date 2026/09/25 18:13:12 +0000build.supported_target_versions 12.2,18,19,21,23,26build.type productionbuild.label (HEAD, tag: v26.6, origin/stable_devel, stable_devel)build.MOS_NOTE KB123450build.MOS_LINK https://support.oracle.com/support/?anchorId=&kmContentId=2485457
Summary
You should really investigate some time in AutoUpgrade. In Ansible in particular it is very easy to integrate and it provides real benefits when it comes to installing, patching, it is the tool of choice. If you look around on the Internet you find that the community has provided configuration tools that help you with the syntax.
Many thanks to Rodrigo Jorge and Daniel Overby Hansen for helping me work out some of the details 🙏
Happy automating!