ansible-ThoTeam / nexus3-oss

Ansible role to install and provision sonatype nexus3-oss
GNU General Public License v3.0
293 stars 209 forks source link

Question: Rationale for `notify: -nexus-service-stop` in task `Download nexus_package` #406

Open bzakdd opened 10 months ago

bzakdd commented 10 months ago

Hello! I have a question regarding following task:

- name: Download nexus_package
  ansible.builtin.get_url:
    url: "{{ nexus_download_url }}/{{ nexus_package }}"
    dest: "{{ nexus_download_dir }}/{{ nexus_package }}"
    force: false
    validate_certs: "{{ nexus_download_ssl_verify | default(omit) }}"
    owner: root
    group: root
    mode: "0644"
  check_mode: false
  register: download_status
  until: download_status.status_code == 200
  retries: "{{ nexus_download_retries }}"
  delay: "{{ nexus_download_delay }}"
  notify:
    - nexus-service-stop

Why is notify: - nexus-service-stop here? I don't see the need to restart Nexus if only it's package was downloaded. True change happens when unpacking Nexus:

- name: Unpack Nexus download
  ansible.builtin.unarchive:
    src: "{{ nexus_download_dir }}/{{ nexus_package }}"
    dest: "{{ nexus_installation_dir }}"
    creates: "{{ nexus_installation_dir }}/nexus-{{ nexus_version }}"
    copy: false
    mode: "0755"
  notify:
    - nexus-service-stop

So which triggers nexus-service-stop by itself if it changes.


Furthermore I encountered case, when this (in my opinion useless notify: - nexus-service-stop) restarts Nexus needlessly:


If notify: - nexus-service-stop has no purpose in task - name: Download nexus_package task, then I'd consider removing it.

If you agree, I can create a PR.