Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ansible.builtin.stat to check src file existence #1685

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions roles/ci_gen_kustomize_values/tasks/generate_snippets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@
cifmw_architecture_scenario must be provided.

- name: Ensure source original values file exists
ansible.builtin.assert:
that:
- cifmw_ci_gen_kustomize_values_src_file is ansible.builtin.exists
msg: >-
{{ cifmw_ci_gen_kustomize_values_src_file }} doesn't exist.
block:
- name: Stat original source file
register: _src_stat
ansible.builtin.stat:
path: "{{ cifmw_ci_gen_kustomize_values_src_file }}"
get_attributes: false
get_checksum: false
get_mime: false

- name: Assert source file exists
ansible.builtin.assert:
that:
- _src_stat.stat.exists
msg: >-
{{ cifmw_ci_gen_kustomize_values_src_file }} doesn't exist.

- name: Load original values file
register: _original
Expand Down