Upgrade JIRA with Ansible?

jmooo October 17, 2017

It looks like you can do an unattended install of JIRA, but I don't see a method to do an unattended upgrade?

Specifically my Ansible role currently has to download the latest .bin installer...and quit. I then have to log manually into the server to run the upgrade, I would much prefer Ansible to complete the upgrade on its own without my human fallibility!

6 answers

2 accepted

1 vote
Answer accepted
Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 1, 2018

Dear @jmooo,

I totally understand your needs. I was same once in the situation to make upgrades more comfortable. So I did this with several RPMs.

It work somehow little bit better, but not unattended. In the end I stopped it.

My recommendation is not to do this with Ansible or any other tool, if data integrity is very important for you (several hundred serious users). There are so many pitfalls, that can make your life harder than upgrading manually. To name some:

  • plugins, that need to be installed via UPM and not just copied inside the plugin directory
  • dependencies to Jira (other linked Apps) that are not notified
  • extra installation steps for specific versions
  • config files that change, where patches cannot be applied

So long

Thomas

Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2018

Dear @jmooo,

was my answer fine enough to be also "accepted"?

Many Thanks

Thomas

jmooo February 5, 2018

Yes thanks for this detailed answer Thomas, I'm glad someone has at least tried to work around Atlassian's limitations. Basically the headaches to upgrading manually (updating multiple config files in multiple places, for ex) pale in comparison to the headaches for trying to upgrade automatically.

0 votes
Answer accepted
jmooo February 5, 2018

Ultimately it looks like this is a shortcoming of JIRA, and an example of the incongruities of how apps in the Atlassian suite are installed/updated/maintained. For example Bamboo, Confluence, Crowd and more can have their installations/updates automated, but not JIRA. It would be nice if all the apps in the suite were designed by be administered the same way.

Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2018

Very true. Probably once Atlassian will pick up your suggestion and realize it. Who knows ...

2 votes
Dithmar Reutlinger March 20, 2019

Why should this not be possible for JIRA? I am running all updates via ansible. For example: 

# Create response.varfile from for unattended installation
- name: Create response.varfile
file:
path: /{{ app_path }}/response.varfile
state: touch
mode: 0755
- name: Fill response.varfile
lineinfile:
path: /{{app_path}}/response.varfile
line: "{{ item.line }}"
state: present
create: yes
with_items:
- { line: 'backupJira$Boolean=true' }
- { line: 'app.install.service$Boolean=false' }
- { line: 'existingInstallationDir=/{{ app_path }}/{{ app }}' }
- { line: 'app.jiraHome=/data/{{ app }}' }
- { line: 'sys.confirmedUpdateInstallationString=true' }
- { line: 'sys.languageId=en' }
- { line: 'sys.installationDir=/{{ app_path }}/{{ app }}' }
- { line: 'executeLauncherAction$Boolean=true' }
- { line: 'httpPort$Long=8080' }
- { line: 'portChoice=custom' }

After that you can run the .bin file: 

 - name: Run Upgrade 
command: /{{ app_path }}/atlassian-jira-software-{{jira_version}}-x64.bin -q -varfile /{{app_path}}/response.varfile

 

Worked fine for me. 

Francis Isabel January 28, 2020

Do you have a repo for this role I am curious to see the source code.

Charles Mervin September 17, 2020

Hi @Dithmar Reutlinger , Your suggestion worked like a charm. Can you please let me know how you got the parameters for the response file? It will be helpful for me to do the same for Confluence and Bitbucket.

 

Thanks,

Charles

Dithmar Reutlinger September 28, 2020

Hi @Charles Mervin ,

Here is an example for Confluence: 

with_items:
- { 
line'executeLauncherAction$Boolean=true' }      
- { 
line'app.confluenceHome=/data/{{ app}}' }      
- { 
line'sys.confirmedUpdateInstallationString=true' }     
- { 
line'launch.application$Boolean=false' }      
- { 
line'existingInstallationDir=/app/{{ app }}' }      
- { 
line'sys.languageId=en' }      
- { 
line'sys.installationDir=/app/{{ app }}' }     
- { 
line'backupConfluence$Boolean=false' }

 

I am not running Bitbucket so I am not able to support here. 

Regards, Dithmar

Charles Mervin October 11, 2020

Hi @Dithmar Reutlinger ,

Many thanks, this helped with my Confluence upgrade. 

Thanks,

Charles 

RITISH RANJAN KHAN December 8, 2020

Hello @Dithmar Reutlinger ,

I am getting the below error while executing the ansible play book but notable to understood which directory I have missed,

"invocation": {
    "module_args": {
         "_raw_params": "/tmp/atlassian-jira-software-8.1.0-x64.bin -q -varfile                /tmp/response.varfile",
         "_uses_shell": false,
         "argv": null,
         "chdir": null,
         "creates": null,
         "executable": null,
         "removes": null,
         "stdin": null,
         "stdin_add_newline": true,
         "strip_empty_ends": true,
         "warn": true
       }
  },
"msg": "non-zero return code",
"rc": 1,
"start": "2020-12-08 14:30:45.984883",
"stderr": "No directory found in specified location",
"stderr_lines": [
      "No directory found in specified location"
],
"stdout": "Unpacking JRE ...\nStarting Installer ...",
"stdout_lines": [
       "Unpacking JRE ...",
       "Starting Installer ..."
]

RITISH RANJAN KHAN June 13, 2021

Hello @Dithmar Reutlinger @Dithmar Reutlinger 

Application upgrade is happening in test env perfectly with fewer data. But I am facing a problem in production with back up the JIRA_HOME directory. Due to huge data and attachments, it is taking lots of time. While doing manually we are skipping to back up the JIRA home directory. 

Please let us know how we can skip the JIRA_HOME directory (/var/Atlassian/..) in the upgrade process through the Ansible playbook.

1 vote
Sid
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 16, 2020

Are there any repos that I can take a look to start with ?

0 votes
Sid
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 1, 2021

I kinda finished it and we are live as well. I will publish it soon

pop75 pop75 May 18, 2021

Hi @Sid 

Do you have a chance to publish it already ?

 

BR

poli

0 votes
Yves Martin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 6, 2020

Our team has started to automate Jira with Ansible when installer does not exist yet.

So our playbook operates a similar way for most Atlassian products:

- prepare database

- download zip package

- extract it at /opt/atlassian/ and creates a shortcut link as /opt/atlassian/jira

- create service account and configure systemd service

- prepare JIRA_HOME location at /var/atlassian/application-data/jira/

- apply configuration: dbconfig.xml, jira.properties, custom release notes templates, sso support...

- download and apply patches from Jira Field Security, for instance

Some manual steps remains for an effective installation but almost complete an upgrade process. What may be really useful from Ansible too:

- Apps management in UPM but this may help: https://github.com/tschaefer/upmctl at least to bootstrap and get JCLI available: https://marketplace.atlassian.com/apps/6398/jira-command-line-interface-cli?hosting=server&tab=overview

- Update license if renewed since last playbook execution

- Trigger full reindex if put off to upgrade faster

- Integrity checks execution

- Report health check status

If fact, I cannot compare this Ansible playbook usage with Atlassian installer as I have never used it.

Suggest an answer

Log in or Sign up to answer