Skip to content

Commit

Permalink
refactor: update variable names and quote strings (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
antmelekhin authored Apr 18, 2024
1 parent ce45063 commit 5d47b4e
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jira_download_url: 'https://www.atlassian.com/software/jira/downloads/binary'

# Jira user.
jira_username: 'jira'
jira_group: 'jira'
jira_usergroup: '{{ jira_username }}'

# Jira directories.
jira_root_path: '/opt/atlassian/jira'
Expand Down
4 changes: 2 additions & 2 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: 'Restart Jira'
ansible.builtin.systemd:
name: jira
name: 'jira'
daemon_reload: true
state: restarted
state: 'restarted'
when: not ansible_check_mode
become: true
2 changes: 1 addition & 1 deletion molecule/default/converge-with-postgresql.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Converge
- name: 'Converge'
hosts: all
vars:
db_name: 'jira'
Expand Down
2 changes: 1 addition & 1 deletion molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Converge
- name: 'Converge'
hosts: all
roles:
- role: antmelekhin.java
Expand Down
12 changes: 6 additions & 6 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
src: 'jira.service.j2'
dest: '/etc/systemd/system/jira.service'
owner: '{{ jira_username }}'
group: '{{ jira_group }}'
group: '{{ jira_usergroup }}'
mode: 0644
notify: 'Restart Jira'

Expand All @@ -16,7 +16,7 @@
src: 'server.xml.j2'
dest: '{{ _jira_application_path }}/conf/server.xml'
owner: '{{ jira_username }}'
group: '{{ jira_group }}'
group: '{{ jira_usergroup }}'
mode: 0644
notify: 'Restart Jira'

Expand All @@ -25,7 +25,7 @@
src: 'setenv.sh.j2'
dest: '{{ _jira_application_path }}/bin/setenv.sh'
owner: '{{ jira_username }}'
group: '{{ jira_group }}'
group: '{{ jira_usergroup }}'
mode: 0755
notify: 'Restart Jira'

Expand All @@ -34,14 +34,14 @@
src: 'dbconfig.xml.j2'
dest: '{{ jira_home_path }}/dbconfig.xml'
owner: '{{ jira_username }}'
group: '{{ jira_group }}'
group: '{{ jira_usergroup }}'
mode: 0600
notify: 'Restart Jira'
when: jira_db_configuration | bool

- name: 'Ensure Jira is running and enabled at boot'
ansible.builtin.systemd:
name: jira
state: started
name: 'jira'
state: 'started'
enabled: true
when: not ansible_check_mode
4 changes: 2 additions & 2 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
src: '/tmp/{{ jira_archive_name }}'
dest: '{{ _jira_install_path }}'
owner: '{{ jira_username }}'
group: '{{ jira_group }}'
group: '{{ jira_usergroup }}'
extra_opts:
- --strip-components=1
become: true
Expand All @@ -33,6 +33,6 @@
ansible.builtin.file:
src: '{{ _jira_install_path }}'
dest: '{{ _jira_application_path }}'
state: link
state: 'link'
when: not ansible_check_mode
become: true
14 changes: 7 additions & 7 deletions tasks/pre-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@
block:
- name: 'Install fontconfig'
ansible.builtin.package:
name: fontconfig
state: present
name: 'fontconfig'
state: 'present'

- name: 'Create Jira group'
ansible.builtin.group:
name: '{{ jira_group }}'
name: '{{ jira_usergroup }}'

- name: 'Create Jira user'
ansible.builtin.user:
name: '{{ jira_username }}'
group: '{{ jira_group }}'
group: '{{ jira_usergroup }}'
comment: 'Atlassian JIRA'
shell: /bin/bash
shell: '/bin/bash'

- name: 'Create Jira directories'
ansible.builtin.file:
path: '{{ jira_path }}'
owner: '{{ jira_username }}'
group: '{{ jira_group }}'
state: directory
group: '{{ jira_usergroup }}'
state: 'directory'
mode: 0755
loop:
- '{{ _jira_install_path }}'
Expand Down

0 comments on commit 5d47b4e

Please sign in to comment.