From e764e8522d0acdadda9c745a9f46b384b8aea368 Mon Sep 17 00:00:00 2001
From: SamYaple <sam@yaple.net>
Date: Tue, 5 Jan 2016 18:06:20 +0000
Subject: [PATCH] Allow murano role to pull images

Change-Id: I0971ddcff7b688ae0dee7658ab4be7ca3fbbdc28
Partially-Implements: blueprint pre-pull-images
---
 ansible/roles/murano/tasks/deploy.yml | 14 ++++++++++++++
 ansible/roles/murano/tasks/main.yml   | 14 +-------------
 ansible/roles/murano/tasks/pull.yml   | 14 ++++++++++++++
 3 files changed, 29 insertions(+), 13 deletions(-)
 create mode 100644 ansible/roles/murano/tasks/deploy.yml
 create mode 100644 ansible/roles/murano/tasks/pull.yml

diff --git a/ansible/roles/murano/tasks/deploy.yml b/ansible/roles/murano/tasks/deploy.yml
new file mode 100644
index 0000000000..13d6447329
--- /dev/null
+++ b/ansible/roles/murano/tasks/deploy.yml
@@ -0,0 +1,14 @@
+---
+- include: register.yml
+  when: inventory_hostname in groups['murano-api']
+
+- include: config.yml
+  when: inventory_hostname in groups['murano-api'] or
+        inventory_hostname in groups['murano-engine']
+
+- include: bootstrap.yml
+  when: inventory_hostname in groups['murano-api']
+
+- include: start.yml
+  when: inventory_hostname in groups['murano-api'] or
+        inventory_hostname in groups['murano-engine']
diff --git a/ansible/roles/murano/tasks/main.yml b/ansible/roles/murano/tasks/main.yml
index 13d6447329..b017e8b4ad 100644
--- a/ansible/roles/murano/tasks/main.yml
+++ b/ansible/roles/murano/tasks/main.yml
@@ -1,14 +1,2 @@
 ---
-- include: register.yml
-  when: inventory_hostname in groups['murano-api']
-
-- include: config.yml
-  when: inventory_hostname in groups['murano-api'] or
-        inventory_hostname in groups['murano-engine']
-
-- include: bootstrap.yml
-  when: inventory_hostname in groups['murano-api']
-
-- include: start.yml
-  when: inventory_hostname in groups['murano-api'] or
-        inventory_hostname in groups['murano-engine']
+- include: "{{ action }}.yml"
diff --git a/ansible/roles/murano/tasks/pull.yml b/ansible/roles/murano/tasks/pull.yml
new file mode 100644
index 0000000000..5f979e56aa
--- /dev/null
+++ b/ansible/roles/murano/tasks/pull.yml
@@ -0,0 +1,14 @@
+---
+- name: Pulling murano-api image
+  kolla_docker:
+    action: "pull_image"
+    common_options: "{{ docker_common_options }}"
+    image: "{{ murano_api_image_full }}"
+  when: inventory_hostname in groups['murano-api']
+
+- name: Pulling murano-engine image
+  kolla_docker:
+    action: "pull_image"
+    common_options: "{{ docker_common_options }}"
+    image: "{{ murano_engine_image_full }}"
+  when: inventory_hostname in groups['murano-engine']
-- 
GitLab