aboutsummaryrefslogtreecommitdiffstats
path: root/resources/ansible_roles/qtip-workspace
diff options
context:
space:
mode:
authorTaseer <taseer94@gmail.com>2017-04-25 17:18:27 +0500
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-05-07 18:23:08 +0800
commitebf4e585a6bbc7a08c5e779ff9863436e44484d8 (patch)
tree2b3e0853ed0b601472af446b7944dbfba7919035 /resources/ansible_roles/qtip-workspace
parent3f4432611417378eb56c962b1fbc5270722e77cb (diff)
Implement qtip workspace create
Change-Id: Ibd4213a6c4c86a7f4e8f99b16cba5055a3abba39 Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
Diffstat (limited to 'resources/ansible_roles/qtip-workspace')
-rw-r--r--resources/ansible_roles/qtip-workspace/ansible.cfg15
-rw-r--r--resources/ansible_roles/qtip-workspace/create.yml67
-rw-r--r--resources/ansible_roles/qtip-workspace/hosts1
-rw-r--r--resources/ansible_roles/qtip-workspace/tasks/main.yml4
4 files changed, 85 insertions, 2 deletions
diff --git a/resources/ansible_roles/qtip-workspace/ansible.cfg b/resources/ansible_roles/qtip-workspace/ansible.cfg
new file mode 100644
index 00000000..74075909
--- /dev/null
+++ b/resources/ansible_roles/qtip-workspace/ansible.cfg
@@ -0,0 +1,15 @@
+# config file for ansible -- https://ansible.com/
+# ===============================================
+
+# nearly all parameters can be overridden in ansible-playbook
+# or with command line flags. ansible will read ANSIBLE_CONFIG,
+# ansible.cfg in the current working directory, .ansible.cfg in
+# the home directory or /etc/ansible/ansible.cfg, whichever it
+# finds first
+
+[defaults]
+
+# some basic default values...
+
+inventory = hosts
+roles_path = ../../resources/ansible_roles
diff --git a/resources/ansible_roles/qtip-workspace/create.yml b/resources/ansible_roles/qtip-workspace/create.yml
new file mode 100644
index 00000000..66a8cf36
--- /dev/null
+++ b/resources/ansible_roles/qtip-workspace/create.yml
@@ -0,0 +1,67 @@
+##############################################################################
+# Copyright (c) 2017 ZTE Corporation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+---
+- hosts: localhost
+
+ gather_facts: no
+
+ vars_prompt:
+
+ - name: pod_name
+ prompt: 'name of the pod under test (used in reporting)'
+ default: qtip-pod
+ private: no
+
+ - name: scenario
+ prompt: 'scenario deployed in the pod:'
+ default: default
+ private: no
+
+ - name: installer
+ prompt: 'installer type of the pod (apex|fuel)'
+ default: fuel
+ private: no
+
+ - name: installer_master_host
+ prompt: 'master host/vm of the installer (accessible by `ssh <hostname>`)'
+ private: no
+
+ - name: workspace
+ prompt: 'workspace name (new directory will be created)'
+ default: workspace
+ private: no
+
+ roles:
+
+ - role: qtip-workspace
+
+ # modify or override variables to customize the workspace
+
+ # opnfv environment
+
+# installer: apex # <fuel|apex>
+# installer_master_host: apex-virtual # make sure you can login it with key authentication
+
+ # set testapi_url to enable reportint to testapi
+
+# testapi_url: http://localhost:8000/api/v1
+
+ # report variables
+
+# project_name: qtip
+# case_name: compute
+# pod_name: "{{ pod_name|default('qtip-pod') }}"
+# scenario: "{{ scenario|default('generic') }}"
+# version: master
+# scenario: demo
+
+ # qtip settings
+
+ qtip_package: ../../.. # relative path from **workspace**, not current directory
diff --git a/resources/ansible_roles/qtip-workspace/hosts b/resources/ansible_roles/qtip-workspace/hosts
new file mode 100644
index 00000000..2302edae
--- /dev/null
+++ b/resources/ansible_roles/qtip-workspace/hosts
@@ -0,0 +1 @@
+localhost ansible_connection=local
diff --git a/resources/ansible_roles/qtip-workspace/tasks/main.yml b/resources/ansible_roles/qtip-workspace/tasks/main.yml
index 4331468d..4fa60061 100644
--- a/resources/ansible_roles/qtip-workspace/tasks/main.yml
+++ b/resources/ansible_roles/qtip-workspace/tasks/main.yml
@@ -9,7 +9,7 @@
- name: creating directories
file:
- path: "{{ workspace }}/{{ item.path }}"
+ path: "{{ cwd }}/{{ workspace }}/{{ item.path }}"
state: directory
force: yes
with_filetree: template/
@@ -18,7 +18,7 @@
- name: templating files
template:
src: "{{ item.src }}"
- dest: "{{ workspace }}/{{ item.path }}"
+ dest: "{{ cwd }}/{{ workspace }}/{{ item.path }}"
force: yes
with_filetree: template/
when: item.state == 'file'