Skip to content

Commit

Permalink
fix!: rename jira_root_path variable
Browse files Browse the repository at this point in the history
  • Loading branch information
antmelekhin committed Aug 16, 2024
1 parent 419cda9 commit 4fddb6d
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 16 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ Jira

An Ansible role to install, configure and update [Jira](https://www.atlassian.com/ru/software/jira).

Upgrade to 2.x
--------------

In version 2.0.0, the `jira_root_path` variable was renamed to `jira_install_path`.

Requirements
------------

Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jira_user: 'jira'
jira_group: '{{ jira_user }}'

# The Jira directories
jira_root_path: '/opt/atlassian/jira'
jira_install_path: '/opt/atlassian/jira'
jira_home_path: '/var/atlassian/application-data/jira'

# The Jira environment configuration
Expand Down
2 changes: 1 addition & 1 deletion meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ argument_specs:
type: 'str'
description: 'System group that will be created.'
default: '{{ jira_user }}'
jira_root_path:
jira_install_path:
type: 'path'
description: 'The Jira installation directory.'
default: '/opt/atlassian/jira'
Expand Down
4 changes: 2 additions & 2 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- name: 'Configure the Jira server settings'
ansible.builtin.template:
src: 'server.xml.j2'
dest: '{{ _jira_application_path }}/conf/server.xml'
dest: '{{ __jira_root_path }}/conf/server.xml'
owner: '{{ jira_user }}'
group: '{{ jira_group }}'
mode: 0644
Expand All @@ -23,7 +23,7 @@
- name: 'Configure the Jira environment'
ansible.builtin.template:
src: 'setenv.sh.j2'
dest: '{{ _jira_application_path }}/bin/setenv.sh'
dest: '{{ __jira_root_path }}/bin/setenv.sh'
owner: '{{ jira_user }}'
group: '{{ jira_group }}'
mode: 0755
Expand Down
11 changes: 5 additions & 6 deletions tasks/install.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: 'Check the current Jira version'
ansible.builtin.command:
cmd: grep -Po '(?<=^version=)\N*$' '{{ _jira_application_path }}/atlassian-jira/META-INF/maven/com.atlassian.jira/jira-webapp-dist/pom.properties'
cmd: grep -Po '(?<=^version=)\N*$' '{{ __jira_root_path }}/atlassian-jira/META-INF/maven/com.atlassian.jira/jira-webapp-dist/pom.properties'
failed_when: false
changed_when: false
register: __jira_version_check
Expand All @@ -23,17 +23,16 @@
- name: 'Unarchive Jira'
ansible.builtin.unarchive:
src: '{{ jira_download_path }}/{{ jira_archive_name }}'
dest: '{{ _jira_install_path }}'
dest: '{{ jira_install_path }}/{{ jira_version }}'
owner: '{{ jira_user }}'
group: '{{ jira_group }}'
extra_opts:
- '--strip-components=1'
extra_opts: ['--strip-components=1']
become: true

- name: 'Create the symbolic link to Jira installation path'
ansible.builtin.file:
src: '{{ _jira_install_path }}'
dest: '{{ _jira_application_path }}'
src: '{{ jira_install_path }}/{{ jira_version }}'
dest: '{{ __jira_root_path }}'
state: 'link'
when: not ansible_check_mode
become: true
2 changes: 1 addition & 1 deletion tasks/pre-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
state: 'directory'
mode: 0755
loop:
- '{{ _jira_install_path }}'
- '{{ jira_install_path }}/{{ jira_version }}'
- '{{ jira_home_path }}'
loop_control:
loop_var: jira_path
6 changes: 3 additions & 3 deletions templates/jira.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ After=network.target
[Service]
Type=forking
User={{ jira_user }}
PIDFile={{ _jira_application_path }}/work/catalina.pid
ExecStart={{ _jira_application_path }}/bin/start-jira.sh
ExecStop={{ _jira_application_path }}/bin/stop-jira.sh
PIDFile={{ __jira_root_path }}/work/catalina.pid
ExecStart={{ __jira_root_path }}/bin/start-jira.sh
ExecStop={{ __jira_root_path }}/bin/stop-jira.sh

[Install]
WantedBy=multi-user.target
3 changes: 1 addition & 2 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
---
_jira_install_path: '{{ jira_root_path }}/{{ jira_version }}'
_jira_application_path: '{{ jira_root_path }}/current'
__jira_root_path: '{{ jira_install_path }}/current'

0 comments on commit 4fddb6d

Please sign in to comment.