ansible/roles/common/tasks/main.yml in subspace-2.5.4 vs ansible/roles/common/tasks/main.yml in subspace-2.5.5
- old
+ new
@@ -151,11 +151,11 @@
body:
client_stat:
key: os_upgrades
value: "{{stats_os_upgrades.stdout}}"
hostname: "{{hostname}}"
- when: send_stats == true and stats_url is defined and stats_api_key is defined
+ when: (send_stats == true) and (stats_url is defined) and (stats_api_key is defined) and (stats_os_upgrades.stdout | length > 0)
tags:
- maintenance
- stats
- name: Get unattended security updates
@@ -220,10 +220,10 @@
body:
client_stat:
key: os_security_upgrades
value: "{{stats_os_security_upgrades.stdout}}"
hostname: "{{hostname}}"
- when: send_stats == true and stats_url is defined and stats_api_key is defined
+ when: (send_stats == true) and (stats_url is defined) and (stats_api_key is defined) and (stats_os_security_upgrades.stdout | length > 0)
tags:
- maintenance
- stats
- name: Clear updates.log