Skip to content

Commit

Permalink
chore: Improve tasks name in uninstall role, remove dup
Browse files Browse the repository at this point in the history
  • Loading branch information
guidograzioli committed Sep 27, 2024
1 parent e9dbad9 commit e598ad1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
6 changes: 3 additions & 3 deletions roles/activemq_uninstall/tasks/systemd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
state: stopped
when: 'activemq.instance_name + ".service" in ansible_facts.services'

- name: "Delete sysconfig file for {{ activemq.instance_name }} {{ activemq.service_name }} service"
- name: "Delete sysconfig file /etc/sysconfig/{{ activemq.instance_name }}"
become: true
ansible.builtin.file:
state: absent
dest: "/etc/sysconfig/{{ activemq.instance_name }}"

- name: "Delete systemd unit file for {{ activemq.instance_name }} {{ activemq.service_name }} service"
- name: "Delete systemd unit file for /etc/systemd/system/{{ activemq.instance_name }}.service"
become: true
ansible.builtin.file:
state: absent
Expand All @@ -29,7 +29,7 @@
daemon_reload: true
changed_when: systemdunit.changed

- name: Delete instance directory
- name: "Delete instance directory {{ activemq.instance_home }}"
become: true
ansible.builtin.file:
state: absent
Expand Down
25 changes: 6 additions & 19 deletions roles/activemq_uninstall/tasks/uninstall.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
- name: "Delete service user"
- name: "Delete service user {{ activemq_service_user }}"
become: true
ansible.builtin.user:
state: absent
name: "{{ activemq_service_user }}"
when: not activemq_uninstall_skip_user

- name: "Delete service group"
- name: "Delete service group {{ activemq_service_group }}"
become: true
ansible.builtin.group:
name: "{{ activemq_service_group }}"
state: absent
when: not activemq_uninstall_skip_user

- name: "Delete {{ activemq.service_name }} install location"
- name: "Delete install location {{ activemq_dest }}"
become: true
ansible.builtin.file:
dest: "{{ activemq_dest }}"
Expand All @@ -29,7 +29,7 @@
path: "{{ archive }}"
register: archive_path

- name: Delete archive from target nodes
- name: "Delete archive from target nodes {{ archive }}"
become: true
ansible.builtin.file:
dest: "{{ archive }}"
Expand All @@ -42,28 +42,15 @@
path: "{{ activemq.home }}"
register: path_to_workdir

- name: "Delete artemis installation directory"
- name: "Delete artemis installation directory {{ activemq.home }}"
become: true
ansible.builtin.file:
dest: "{{ activemq.home }}"
state: absent
when: not activemq_uninstall_skip_artemis

- name: Link zipfile directory to wanted directory
become: true
ansible.builtin.file:
state: absent
dest: "{{ activemq.home }}"
when: not activemq_uninstall_skip_artemis

- name: Link default logs directory
- name: "Delete logs directory symlink /var/log/{{ activemq.service_name }}/{{ activemq.instance_name }}"
become: true
ansible.builtin.file:
state: absent
dest: "/var/log/{{ activemq.service_name }}/{{ activemq.instance_name }}"

- name: Create default logs directory
become: true
ansible.builtin.file:
state: absent
dest: "/var/log/{{ activemq.service_name }}"

0 comments on commit e598ad1

Please sign in to comment.