From 6022b611460ae692ba5d2f8aa47df50cbe177175 Mon Sep 17 00:00:00 2001
From: Jeffrey Zhang <zhang.lei.fly@gmail.com>
Date: Wed, 5 Jul 2017 22:04:38 +0800
Subject: [PATCH] Use proper variable in horizon copy policy task

* fix wrong variable usage for horizon copy policy task
* notify restart keystone container when policy is changed

Change-Id: I3545205d5d3cfcf7bf893187ca6e65bbc152bf33
Closes-Bug: #1702486
---
 ansible/roles/horizon/tasks/config.yml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ansible/roles/horizon/tasks/config.yml b/ansible/roles/horizon/tasks/config.yml
index 008d85a77e..326dec472b 100644
--- a/ansible/roles/horizon/tasks/config.yml
+++ b/ansible/roles/horizon/tasks/config.yml
@@ -88,8 +88,8 @@
   vars:
     horizon: "{{ horizon_services['horizon'] }}"
   template:
-    src: "{{ node_custom_config }}/horizon/{{ item[0]['name'] }}_policy.json"
-    dest: "{{ node_config_directory }}/horizon/{{ item[0]['name'] }}_policy.json"
+    src: "{{ node_custom_config }}/horizon/{{ item.item.name }}_policy.json"
+    dest: "{{ node_config_directory }}/horizon/{{ item.item.name }}_policy.json"
   register: policy_jsons
   when:
     - horizon.enabled | bool
@@ -97,6 +97,8 @@
     - item.item.enabled | bool
     - item.stat.exists
   with_items: "{{ custom_policy.results }}"
+  notify:
+    - Restart horizon container
 
 - name: Check horizon container
   vars: