zuul-jobs/roles/find-constraints/tasks/main.yaml
Tristan Cacqueray e2058a6b75 Fix deprecation warning of ansible-2.5
This change fixes this upcoming deprecation warning:

[DEPRECATION WARNING]: Using tests as filters is deprecated. Instead of using
`result|skipped` instead use `result is skipped`. This feature will be removed
in version 2.9.

Change-Id: Ic0c93f2ea896ead76922694e6150882d8a280daf
2018-06-04 00:17:18 +00:00

19 lines
606 B
YAML

- name: Check to see if the constraints file exists
stat:
path: "{{ constraints_file|default('missing') }}"
get_checksum: false
get_mime: false
get_md5: false
register: stat_results
when: constraints_file is defined
- name: Require defined constraints file to be found
fail:
msg: constraints_file was defined but was not found on the system
when: constraints_file is defined and not stat_results.stat.exists
- name: Record file location
set_fact:
upper_constraints: "-c {{ constraints_file|realpath }}"
when: not stat_results is skipped and stat_results.stat.exists