From 923e3b3186498772aedee7a43f46b5aa8a4e27f4 Mon Sep 17 00:00:00 2001
From: Marcos Amorim <marcosmamorim@gmail.com>
Date: Wed, 04 Mar 2020 14:15:41 +0100
Subject: [PATCH] Add new module to download OSP images from IBM (#1229)

---
 ansible/configs/osp-migration/pre_infra.yml |   40 ++++++++++++++++++++++++++++++++++++++--
 1 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/ansible/configs/osp-migration/pre_infra.yml b/ansible/configs/osp-migration/pre_infra.yml
index 7386f5c..6edae48 100644
--- a/ansible/configs/osp-migration/pre_infra.yml
+++ b/ansible/configs/osp-migration/pre_infra.yml
@@ -5,6 +5,42 @@
   tags:
   - step001
   - pre_infrastructure
+  - osp_migration
   tasks:
-    - debug:
-        msg: "Step 000 Pre Infrastructure - Dummy action"
\ No newline at end of file
+    - name: Create migration host group
+      add_host:
+        name: "{{ import_host }}"
+        group: "migration"
+        ansible_user: "root"
+        ansible_become: false
+
+- name: Step 001 Migrating blueprints
+  hosts: migration
+  become: true
+  gather_facts: true
+  tags:
+  - step001
+  - pre_infrastructure
+  - osp_migration
+  tasks:
+    - name: Download images from project
+      environment:
+        OS_AUTH_URL: "{{ osp_auth_url }}"
+        OS_USERNAME: "{{ osp_auth_username }}"
+        OS_PASSWORD: "{{ osp_auth_password }}"
+        OS_PROJECT_NAME: "admin"
+        OS_PROJECT_DOMAIN_ID: "{{ osp_auth_project_domain }}"
+        OS_USER_DOMAIN_NAME: "{{ osp_auth_user_domain }}"
+        PATH: "/root/.local/bin:{{ ansible_env.PATH }}"
+        CEPH_CONF: "/etc/ceph/{{ ceph_cluster |default('red') }}.conf"
+      convert_blueprint:
+        ibm_endpoint: "{{ ibm_endpoint }}"
+        ibm_auth_endpoint: "{{ ibm_auth_endpoint }}"
+        ibm_api_key: "{{ ibm_api_key }}"
+        ibm_resource_id: "{{ ibm_resource_id }}"
+        bucket: "{{ ibm_bucket_name }}"
+        project: "{{ project }}"
+        output_dir: "{{ output_dir }}"
+        mode: "download"
+        glance_pool: "{{ ceph_cluster |default('red') }}-images"
+        overwrite: "{{ overwrite_image | default('false') }}"

--
Gitblit v1.9.3