aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/horizon/tasks/policy_item.yml
blob: 7350dc75548d5eaf2bf967d3113d2f20706c6999 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---

- name: 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
  stat:
    path: "{{ fullpath }}"
  delegate_to: localhost
  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

- name: Update custom policy file name
  set_fact:
    custom_policy: "{{ custom_policy }} + [ '{{ overwritten_files.results.0.stat.path }}' ]"
  when:
    - overwritten_files.results