Merge "Use stat module instead of "test -s""

This commit is contained in:
Zuul 2020-12-16 19:12:33 +00:00 committed by Gerrit Code Review
commit 93c2e27178
1 changed files with 7 additions and 4 deletions

View File

@ -261,10 +261,13 @@ outputs:
register: os_net_config_need_upgrade
when: step|int == 3
- name: Check that os-net-config has configuration
shell: test -s /etc/os-net-config/config.json
register: os_net_config_has_config
failed_when: false
when: step|int == 3
stat:
path: /etc/os-net-config/config.json
get_attributes: false
get_checksum: false
get_mime: false
register: stat_config_json
- block:
- name: Upgrade os-net-config
package: name=os-net-config state=latest
@ -276,7 +279,7 @@ outputs:
when:
- step|int == 3
- os_net_config_need_upgrade.stdout
- os_net_config_has_config.rc == 0
- stat_config_json.stat.exists
# Exclude ansible until https://github.com/ansible/ansible/issues/56636
# is available
- name: Update all packages