In check mode, check if update applies but don't actually apply

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
Patrick Uiterwijk 2016-01-21 12:55:10 +00:00
parent 1241409443
commit d77dec24a3

View file

@ -37,11 +37,13 @@
tasks:
- name: Create drop place for upgrades
always_run: true
when: ansible_virtualization_role == "host"
file: path=/root/firmware-upgrades
state=directory
- name: Check which updates to copy
always_run: true
stat: path=/root/firmware-upgrades/{{ item.1}}.applied
register: is_applied_results
when: item.0.vendor == ansible_system_vendor and item.0.product == ansible_product_name
@ -50,6 +52,7 @@
- files
- name: Copy updates
always_run: true
copy: src={{ bigfiles }}/firmware/{{ item.item.0.dirname }}/{{ item.item.1}}
dest=/root/firmware-upgrades/
mode=0700
@ -60,6 +63,7 @@
# Dell updates here
- name: Check Dell updates
always_run: true
command: /root/firmware-upgrades/{{ item.item.1}} -qc
register: check_results
failed_when: "'System(s) supported by this package' in check_results.stdout"
@ -85,6 +89,7 @@
# We are cleaning up all files we copied, regardless of update result
- name: Delete update files
always_run: true
file: path=/root/firmware-upgrades/{{ item.item.1 }}
state=absent
when: "'stat' in item and not item.stat.exists"