Adds InfraRed plugin support for Instance-Ha deployment on OpenStack

Change-Id: Ib4f3a1f3953339dcebb62bd4cced688d5d9e039b
This commit is contained in:
pkomarov 2017-12-21 23:33:06 +02:00
parent 00c9e0adca
commit b4c22dfff7
3 changed files with 121 additions and 0 deletions

52
infrared/README.md Normal file
View File

@ -0,0 +1,52 @@
Infrared Intance-ha Plugin Playbook
====================================
This Plugin deploys Instance-Ha on OpenStack using InfraRed
The Tasks in infrared_instance-ha_plugin_main.yml, along with the
plugin.spec at tripleo-quickstart-utils/plugin.spec provide support
for running this repo's roles and playbooks as an Infrared plugin.
[InfraRed](http://infrared.readthedocs.io/en/stable/) is a plugin based system
that aims to provide an easy-to-use CLI for Ansible based projects and
OpenStack deployment.
The plugin provides infrared plugin integration for
two OpenStack High-Availability features:
[instance-ha](https://github.com/redhat-openstack/tripleo-quickstart-utils/tree/master/roles/instance-ha)
[stonith-config](https://github.com/redhat-openstack/tripleo-quickstart-utils/tree/master/roles/stonith-config)
Usage:
=====
**Installation and deployment:**
[Setup InfraRed](http://infrared.readthedocs.io/en/stable/bootstrap.html)
ir plugin add https://github.com/redhat-openstack/tripleo-quickstart-utils
export ANSIBLE_ROLES_PATH='plugins/tripleo-quickstart-utils/roles'
ir instance-ha-deploy -v --release 12 --stonith_devices all
*notice: a fail & warning will be issued if the plugin's specific ANSIBLE_ROLES_PATH is not defined *
**Plugin help:**
ir instance-ha-deploy -h
**Plugin Uninstall:**
ir plugin remove instance-ha-deploy
Author Information
------------------
Pini Komarov pkomarov@redhat.com

View File

@ -0,0 +1,32 @@
---
- name: check ANSIBLE_ROLES_PATH variable
hosts: localhost
tasks:
- shell: |
echo $ANSIBLE_ROLES_PATH
name: check $ANSIBLE_ROLES_PATH variable
register: ansible_roles_path_out
- fail:
msg: Please export ANSIBLE_ROLES_PATH='plugins/tripleo-quickstart-utils/roles' ; Before running this playbook with infrared.
when: '"tripleo-quickstart-utils" not in ansible_roles_path_out.stdout'
- name: Configure Instance HA
hosts: undercloud
gather_facts: yes
tasks:
- include_role:
name: instance-ha
vars:
instance_ha_action: '{{ install.instance_ha_action }}'
release: '{{ install.release }}'
stonith_devices: '{{ install.stonith_devices }}'
instance_ha_shared_storage: '{{ install.instance_ha_shared_storage }}'

37
plugin.spec Normal file
View File

@ -0,0 +1,37 @@
---
config:
entry_point: ./infrared/infrared_instance-ha_plugin_main.yml
plugin_type: install
subparsers:
instance-ha-deploy:
description: Collection of instance-ha configuration tasks
include_groups: ["Ansible options", "Inventory", "Common options", "Answers file"]
groups:
- title: Instance HA
options:
instance_ha_action:
type: Value
default: install
help: |
Can be 'install' or 'uninstall'
release:
type: Value
help: |
A rhos release - version_number.
Example: "rhos-10".
required: yes
stonith_devices:
type: Value
default: controllers
help: |
Can be all, controllers or computes
instance_ha_shared_storage:
type: Bool
help: |
Do we have a shared storage or not?
default: False