From 5ac006600b63f7446676b4e98cd5b3171ed22bf3 Mon Sep 17 00:00:00 2001
From: Amol Ghatol <amol_g@techjoomla.com>
Date: Wed, 24 Jul 2019 14:21:29 +0530
Subject: [PATCH] =?UTF-8?q?Issue=20#SB-13565=20fix:=20Import=20client=20on?=
 =?UTF-8?q?ly=20once=20to=20fix=20client=20already=20ex=E2=80=A6=20(#655)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* Issue #SB-13565 fix: Import client only once to fix client already exist issue

* Issue #SB-13565 fix: Import client only once to fix client already exist issue

* Issue #SB-13565 fix: Import client only once to fix client already exist issue
---
 ansible/roles/sunbird-auth-deploy/tasks/custom.yml | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/ansible/roles/sunbird-auth-deploy/tasks/custom.yml b/ansible/roles/sunbird-auth-deploy/tasks/custom.yml
index 3a0e310e7..9a5f580fe 100644
--- a/ansible/roles/sunbird-auth-deploy/tasks/custom.yml
+++ b/ansible/roles/sunbird-auth-deploy/tasks/custom.yml
@@ -5,31 +5,40 @@
   with_items:
     - python-pip
     - python-setuptools
+  run_once: true
 
 - name: Copying python libraries
   copy: src={{ role_path }}/files/python-keycloak-0.12.0 dest=/tmp/
+  run_once: true
 
 - name: Initialize python library to run keycloak paython script
   shell: cd /tmp/python-keycloak-0.12.0 && python setup.py install
+  run_once: true
 
 - name: Save keycloak vars to json
   template: src="keycloak-bootstrap.conf.j2" dest="/tmp/keycloak-bootstrap.conf.json" mode="0644"
+  run_once: true
 
 - name: Copy realm json file to tmp location
   template: src="keycloak-realm.j2" dest="/tmp/keycloak-realm.json" mode="0644"
+  run_once: true
 
 - name: Copy clients file to tmp location
   template: src="clients.j2" dest="/tmp/clients.json" mode="0644"
+  run_once: true
 
 - name: Copy user manager roles file to tmp location
   copy: src="files/python-keycloak-0.12.0/roles.json" dest="/tmp/roles.json" mode="0644"
+  run_once: true
 
 - name: Copy the keycloak paython script
   copy:  src={{ role_path }}/files/python-keycloak-0.12.0/keycloak dest=/tmp
+  run_once: true
 
 - name: Run the keycloak paython script
   shell:  cd /tmp/keycloak/ && python keycloak_patch.py /tmp/keycloak-bootstrap.conf.json
   register: out
   until: '"404" not in out.stderr'
   retries: 2
-  delay: 10
\ No newline at end of file
+  delay: 10
+  run_once: true
-- 
GitLab