Skip to content

Commit

Permalink
rpm: make install with rpm idempotent
Browse files Browse the repository at this point in the history
  • Loading branch information
rpelisse committed Oct 9, 2023
1 parent aff9552 commit 303ce54
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions roles/jws/tasks/install/rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,19 @@
- dnf_command is defined
- dnf_command != "'groupinstall'"

- name: "Load stat of {{ jws_rpm_root_dir }}/enable"
ansible.builtin.stat:
path: "{{ jws_rpm_root_dir }}/enable"
register: jws_rpm_root_dir_enable_stat

- name: "Perform {{ info_msg }}"
ansible.builtin.command:
cmd: "dnf {{ dnf_command | default('groupinstall') }} -y {{ jws.rpm }}"
creates: "{{ jws_rpm_root_dir }}/enable"
when:
- jws_rpm_root_dir_enable_stat is defined and jws_rpm_root_dir_enable_stat.stat is defined
- jws_rpm_root_dir_enable_stat.stat.exists is defined
- not jws_rpm_root_dir_enable_stat
notify:
- Ensure Tomcat runs under systemd

Expand Down

0 comments on commit 303ce54

Please sign in to comment.