Skip to content

Commit

Permalink
used stat module to check rpm file existence
Browse files Browse the repository at this point in the history
  • Loading branch information
hurngchunlee committed May 29, 2019
1 parent d5918f5 commit 8c9b978
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions scripts/ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@
gather_facts: false
become: yes
tasks:
- name: check existence of the RPMs
register: ls
shell: ls -l hpc-utility-{{ release | mandatory }}.rpm
args:
chdir: /mnt/install/kickstart-7/miscpkgs/torque-helper
- name: check RPM file on nodes
stat:
path: /mnt/install/kickstart-7/miscpkgs/torque-helper/hpc-utility-{{ release | mandatory }}.rpm
register: rpmfile
- name: fail on RPM file not available
fail:
msg: "rpm not found: /mnt/install/kickstart-7/miscpkgs/torque-helper/hpc-utility-{{ release | mandatory }}.rpm"
when: rpmfile.stat.exists == False
#- debug: var=ls.stdout_lines
- name: install/update hpc-utility package
register: yum
Expand Down

0 comments on commit 8c9b978

Please sign in to comment.