6d49dbb48a
- Horizon This will copy only yaml or json policy file if they exist. Change-Id: Ib8875ca54dc9dc69abc8338413f7724d9d4ecc45 Implements: blueprint support-custom-policy-yaml Co-authored-By: Duong Ha-Quang <duonghq@vn.fujitsu.com>
23 lines
635 B
YAML
23 lines
635 B
YAML
---
|
|
|
|
# Update policy file name
|
|
- set_fact:
|
|
supported_policy_files: "{{ supported_policy_format_list | map('regex_replace', '(.*)', '{{ project_name }}_\\1') | list }}"
|
|
|
|
- name: Check if policies shall be overwritten
|
|
local_action: stat path="{{ fullpath }}"
|
|
run_once: True
|
|
register: overwritten_files
|
|
with_first_found:
|
|
- files: "{{ supported_policy_files }}"
|
|
paths:
|
|
- "{{ node_custom_config }}/horizon/"
|
|
skip: true
|
|
loop_control:
|
|
loop_var: fullpath
|
|
|
|
- set_fact:
|
|
custom_policy: "{{ custom_policy }} + [ '{{ overwritten_files.results.0.stat.path }}' ]"
|
|
when:
|
|
- overwritten_files.results
|