diff --git a/defaults/main.yml b/defaults/main.yml index f707ad4..8c247d0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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' diff --git a/handlers/main.yml b/handlers/main.yml index e012e80..e7adc19 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -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 diff --git a/molecule/default/converge-with-postgresql.yml b/molecule/default/converge-with-postgresql.yml index deb4b87..43c5fc4 100644 --- a/molecule/default/converge-with-postgresql.yml +++ b/molecule/default/converge-with-postgresql.yml @@ -1,5 +1,5 @@ --- -- name: Converge +- name: 'Converge' hosts: all vars: db_name: 'jira' diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 7c21c5a..30b465d 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -1,5 +1,5 @@ --- -- name: Converge +- name: 'Converge' hosts: all roles: - role: antmelekhin.java diff --git a/tasks/configure.yml b/tasks/configure.yml index 0bac415..4f4a99a 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -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' @@ -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' @@ -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' @@ -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 diff --git a/tasks/install.yml b/tasks/install.yml index cd73db4..5fdc5c1 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -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 @@ -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 diff --git a/tasks/pre-install.yml b/tasks/pre-install.yml index 6fde2de..bda2d00 100644 --- a/tasks/pre-install.yml +++ b/tasks/pre-install.yml @@ -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 }}'