InfraRed Integration Skeleton

Make Tobiko an InfraRed plugin for simple and fine-grained
executions (both personal and in CI/CD environments).

This patch add a plugin spec, main entry playbook and several
tasks for basic config & run execution.

Change-Id: Ifcff4d79b4c920c28cc8170c4b8a8e9821c7b70d
This commit is contained in:
abregman 2019-01-11 18:47:56 +02:00
parent b97a8d9a8a
commit 160da96973
6 changed files with 121 additions and 0 deletions

11
infrared/main.yml Normal file
View File

@ -0,0 +1,11 @@
- name: Install Tobiko
import_playbook: tasks/install.yml
- name: Set up os-faults configuration
import_playbook: tasks/configure.yml
- name: Run Tobiko
import_playbook: tasks/run.yml
when:
- test.tests is defined
- test.tests

15
infrared/plugin.spec Normal file
View File

@ -0,0 +1,15 @@
---
config:
plugin_type: test
subparsers:
tobiko:
description: Tobiko Options
include_groups: ["Ansible options", "Inventory", "Common options", "Answers file"]
groups:
- title: Testing Parameters
options:
tests:
type: Value
help: |
Group of tests to execute

View File

@ -0,0 +1,12 @@
---
- name: Generate os-faults configuration
hosts: undercloud
any_errors_fatal: true
gather_facts: yes
tasks:
- name: Create os-faults configuration file
template:
src: "templates/os-faults.yaml.j2"
dest: "~/os-faults.yaml"
mode: 0755

View File

@ -0,0 +1,37 @@
---
- name: Install Tobiko
hosts: undercloud
any_errors_fatal: true
gather_facts: yes
tasks:
- name: Install required packages
become: yes
yum:
name: "{{ item }}"
state: present
with_items:
- 'python-virtualenv'
- 'git'
- name: Clone Tobiko project
git:
repo: 'https://github.com/rhos-infra/tobiko'
dest: "~/tobiko"
- name: Create Virtualenv
pip:
virtualenv: "~/tobiko_venv"
name: "{{ item }}"
state: latest
with_items:
- pip
- setuptools
- pbr
- name: Install Tobiko
pip:
chdir: "~/tobiko"
virtualenv: "~/tobiko_venv"
name: "."
editable: true

11
infrared/tasks/run.yml Normal file
View File

@ -0,0 +1,11 @@
---
- name: Run Tobiko
hosts: undercloud
any_errors_fatal: true
gather_facts: no
tasks:
- name: Run Tobiko Tests
shell: |
tobiko -e {{ test.tests }}

View File

@ -0,0 +1,35 @@
cloud_management:
driver: universal
node_discover:
driver: node_list
args:
{% for host_name in groups.overcloud_nodes|sort %}
- fqdn: {{ host_name }}
ip: {{ hostvars[host_name]['ansible_host'] }}
auth:
username: heat-admin
private_key_file: /home/stack/.ssh/id_rsa
become: true
{% endfor %}
services:
openvswitch:
driver: system_service
args:
service_name: openvswitch
grep: openvswitch
containers:
neutron_ovs_agent:
driver: docker_container
args:
container_name: neutron_ovs_agent
neutron_metadata_agent:
driver: docker_container
args:
container_name: neutron_metadata_agent
neutron_api:
driver: docker_container
args:
container_name: neutron_api