Fill in the content
This commit is contained in:
parent
6d3c5fb31c
commit
8edd924e59
|
@ -1 +1,95 @@
|
|||
# defaults for blazar
|
||||
---
|
||||
# Copyright 2018, taseer94@gmail.com
|
||||
# All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
blazar_package_state: "latest"
|
||||
|
||||
blazar_git_repo: https://git.openstack.org/openstack/blazar
|
||||
blazar_git_install_branch: master
|
||||
blazar_developer_mode: false
|
||||
blazar_requirements_git_repo: https://git.openstack.org/openstack/requirements
|
||||
blazar_requirements_git_install_branch: master
|
||||
|
||||
blazar_venv_tag: untagged
|
||||
blazar_bin: "/openstack/venvs/blazar-{{ blazar_venv_tag }}/bin"
|
||||
|
||||
blazar_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/blazar.tgz
|
||||
|
||||
blazar_etc_dir: "{{ blazar_bin | dirname }}/etc/blazar"
|
||||
blazar_conf_dir: /etc/blazar
|
||||
|
||||
## Required PIP packages
|
||||
blazar_requires_pip_packages:
|
||||
- tox
|
||||
- virtualenv
|
||||
- virtualenv-tools
|
||||
- python-keystoneclient
|
||||
|
||||
## blazar developer constraint
|
||||
blazar_developer_constraints:
|
||||
- - "git+{{ blazar_git_repo }}@{{ blazar_git_install_branch }}#egg=blazar"
|
||||
|
||||
## System info
|
||||
blazar_system_user_name: blazar
|
||||
blazar_system_group_name: blazar
|
||||
blazar_system_shell: /bin/false
|
||||
blazar_system_comment: blazar system user
|
||||
blazar_system_user_home: "/var/lib/{{ blazar_system_user_name }}"
|
||||
|
||||
## Database credentials
|
||||
blazar_db_name: blazar
|
||||
blazar_db_user: root
|
||||
blazar_db_login_host: ""
|
||||
blazar_db_login_user: ""
|
||||
blazar_db_login_password: ""
|
||||
blazar_db_user_password: ""
|
||||
|
||||
## Service Type and Data
|
||||
blazar_service_region: RegionOne
|
||||
blazar_service_name: blazar
|
||||
blazar_service_proto: http
|
||||
blazar_service_type: policy
|
||||
blazar_service_description: "blazar service"
|
||||
blazar_service_publicuri: "{{ blazar_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ blazar_service_port }}"
|
||||
blazar_service_publicurl: "{{ blazar_service_publicuri }}"
|
||||
blazar_service_internaluri: "{{ blazar_service_internaluri_proto }}://{{ internal_lb_vip_address }}:{{ blazar_service_port }}"
|
||||
blazar_service_internalurl: "{{ blazar_service_internaluri }}"
|
||||
blazar_service_adminuri: "{{ blazar_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ blazar_service_port }}"
|
||||
blazar_service_adminurl: "{{ blazar_service_adminuri }}"
|
||||
blazar_service_registry_proto: "{{ blazar_service_proto }}"
|
||||
blazar_service_publicuri_proto: "{{ openstack_service_publicuri_proto | default(blazar_service_proto) }}"
|
||||
blazar_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(blazar_service_proto) }}"
|
||||
blazar_service_internaluri_proto: "{{ openstack_service_internaluri_proto | default(blazar_service_proto) }}"
|
||||
|
||||
#NOTE: move password to tests/test-vars.yml
|
||||
blazar_service_password: password
|
||||
|
||||
## Keystone
|
||||
blazar_service_project_domain_id: default
|
||||
blazar_service_project_name: service
|
||||
blazar_service_user_domain_id: default
|
||||
blazar_service_user_name: blazar
|
||||
blazar_keystone_auth_plugin: password
|
||||
|
||||
blazar_service_in_ldap: false
|
||||
|
||||
## DB info
|
||||
blazar_galera_database: blazar
|
||||
blazar_galera_user: blazar
|
||||
|
||||
blazar_role_name: admin
|
||||
blazar_bind_address: 0.0.0.0
|
||||
blazar_service_port: 9800
|
||||
blazar_program_name: blazar-server
|
|
@ -1 +1,41 @@
|
|||
# meta
|
||||
---
|
||||
# Copyright 2018, taseer94@gmail.com
|
||||
# All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
galaxy_info:
|
||||
author: Taseer
|
||||
description: Blazar deployment with OpenStack Ansible
|
||||
company: Independent
|
||||
license: Apache2
|
||||
|
||||
min_ansible_version: 1.0
|
||||
|
||||
platforms:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- trusty
|
||||
- xenial
|
||||
galaxy_tags:
|
||||
- cloud
|
||||
- openstack
|
||||
- blazar
|
||||
- python
|
||||
|
||||
dependencies:
|
||||
- pip_install
|
||||
- role: apt_package_pinning
|
||||
when:
|
||||
- ansible_pkg_mgr == 'apt'
|
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
# Copyright 2018, taseer94@gmail.com
|
||||
# All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- name: install apt packages
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
with_items:
|
||||
- git
|
||||
- gcc
|
||||
- python-dev
|
||||
- python-antlr3
|
||||
- libxml2
|
||||
- libxslt1-dev
|
||||
- libzip-dev
|
||||
- build-essential
|
||||
- build-essential
|
||||
- libssl-dev
|
||||
- libffi-dev
|
||||
- python-setuptools
|
||||
- python-mysqldb
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
# Copyright 2018, taseer94@gmail.com
|
||||
# All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- name: create blazar database schema
|
||||
command: "{{ blazar_bin }}/blazar-db-manage
|
||||
--config-file {{ blazar_conf_dir }}/blazar.conf upgrade head"
|
||||
become: yes
|
||||
become_user: "{{ blazar_system_user_name }}"
|
||||
changed_when: False
|
|
@ -0,0 +1,100 @@
|
|||
---
|
||||
# Copyright 2018, taseer94@gmail.com
|
||||
# All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- name: Create developer mode constraint file
|
||||
copy:
|
||||
dest: "/opt/developer-pip-constraints.txt"
|
||||
content: |
|
||||
{% for item in blazar_developer_constraints %}
|
||||
{{ item }}
|
||||
{% endfor %}
|
||||
when: blazar_developer_mode | bool
|
||||
|
||||
- name: Install required pip packages
|
||||
pip:
|
||||
name: "{{ blazar_requires_pip_packages | join(' ') }}"
|
||||
state: "{{ blazar_package_state }}"
|
||||
extra_args: >-
|
||||
{{ blazar_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }}
|
||||
{{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }}
|
||||
{{ pip_install_options | default('') }}
|
||||
register: install_packages
|
||||
until: install_packages|success
|
||||
retries: 5
|
||||
delay: 2
|
||||
|
||||
- name: Retrieve checksum for venv download
|
||||
uri:
|
||||
url: "{{ blazar_venv_download_url | replace('tgz', 'checksum') }}"
|
||||
return_content: yes
|
||||
register: blazar_venv_checksum
|
||||
when: not blazar_developer_mode | bool
|
||||
|
||||
- name: Attempt venv download
|
||||
get_url:
|
||||
url: "{{ blazar_venv_download_url }}"
|
||||
dest: "/var/cache/{{ blazar_venv_download_url | basename }}"
|
||||
checksum: "sha1:{{ blazar_venv_checksum.content | trim }}"
|
||||
register: blazar_get_venv
|
||||
when: not blazar_developer_mode | bool
|
||||
|
||||
- name: Remove existing venv
|
||||
file:
|
||||
path: "{{ blazar_bin | dirname }}"
|
||||
state: absent
|
||||
when: blazar_get_venv | changed
|
||||
|
||||
- name: Create blazar venv dir
|
||||
file:
|
||||
path: "{{ blazar_bin | dirname }}"
|
||||
state: directory
|
||||
register: blazar_venv_dir
|
||||
when: blazar_get_venv | changed
|
||||
|
||||
- name: Unarchive pre-built venv
|
||||
unarchive:
|
||||
src: "/var/cache/{{ blazar_venv_download_url | basename }}"
|
||||
dest: "{{ blazar_bin | dirname }}"
|
||||
copy: "no"
|
||||
when:
|
||||
- not blazar_developer_mode | bool
|
||||
- blazar_get_venv | changed or blazar_venv_dir | changed
|
||||
|
||||
- name: Install pip packages
|
||||
pip:
|
||||
name: "{{ blazar_pip_packages | join(' ') }}"
|
||||
state: "{{ blazar_package_state }}"
|
||||
virtualenv: "{{ blazar_bin | dirname }}"
|
||||
virtualenv_site_packages: "no"
|
||||
register: install_packages
|
||||
until: install_packages|success
|
||||
retries: 5
|
||||
delay: 2
|
||||
when: blazar_developer_mode | bool
|
||||
|
||||
- name: Update virtualenv path
|
||||
command: >
|
||||
virtualenv-tools --update-path=auto --reinitialize {{ blazar_bin | dirname }}
|
||||
when:
|
||||
- not blazar_developer_mode | bool
|
||||
- blazar_get_venv | changed or blazar_venv_dir | changed
|
||||
|
||||
- name: Record the venv tag deployed
|
||||
ini_file:
|
||||
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
|
||||
section: blazar
|
||||
option: venv_tag
|
||||
value: "{{ blazar_venv_tag }}"
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
# Copyright 2017, taseer94@gmail.com
|
||||
# All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- name: generate blazar configuration
|
||||
template:
|
||||
src: "{{ item }}"
|
||||
dest: "{{ blazar_conf_dir }}"
|
||||
with_items:
|
||||
- api-paste.ini
|
||||
- policy.json
|
||||
- blazar.conf
|
|
@ -0,0 +1,49 @@
|
|||
---
|
||||
# Copyright 2018, taseer94@gmail.com
|
||||
# All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- include: blazar_apt_packages.yml
|
||||
|
||||
- name: install pip packages
|
||||
pip:
|
||||
name: "{{ item }}"
|
||||
with_items:
|
||||
- virtualenv
|
||||
|
||||
- name: clone blazar repo
|
||||
git:
|
||||
repo: "{{ blazar_git_repo }}"
|
||||
dest: /opt/blazar
|
||||
clone: yes
|
||||
version: master
|
||||
|
||||
- name: create blazar group
|
||||
group:
|
||||
name: "{{ blazar_system_group_name }}"
|
||||
state: present
|
||||
|
||||
- name: create blazar user
|
||||
user:
|
||||
name: "{{ blazar_system_user_name }}"
|
||||
group: "{{ blazar_system_group_name }}"
|
||||
createhome: no
|
||||
|
||||
- name: make blazar configuration directory
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
- /etc/blazar
|
||||
- /etc/blazar/snapshot
|
|
@ -0,0 +1,93 @@
|
|||
---
|
||||
# Copyright 2018, taseer94@gmail.com
|
||||
# All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- name: Ensure blazar service
|
||||
keystone:
|
||||
command: "ensure_service"
|
||||
endpoint: "{{ keystone_service_adminurl }}"
|
||||
login_user: "{{ keystone_admin_user_name }}"
|
||||
login_password: "{{ keystone_auth_admin_password }}"
|
||||
login_project_name: "{{ keystone_admin_tenant_name }}"
|
||||
service_name: "{{ blazar_service_name }}"
|
||||
service_type: "{{ blazar_service_type }}"
|
||||
description: "{{ blazar_service_description }}"
|
||||
insecure: "{{ keystone_service_adminuri_insecure }}"
|
||||
register: add_service
|
||||
until: add_service|success
|
||||
retries: 5
|
||||
delay: 2
|
||||
|
||||
# Create an admin user
|
||||
- name: Ensure blazar user
|
||||
keystone:
|
||||
command: "ensure_user"
|
||||
endpoint: "{{ keystone_service_adminurl }}"
|
||||
login_user: "{{ keystone_admin_user_name }}"
|
||||
login_password: "{{ keystone_auth_admin_password }}"
|
||||
login_project_name: "{{ keystone_admin_tenant_name }}"
|
||||
user_name: "{{ blazar_service_user_name }}"
|
||||
tenant_name: "{{ blazar_service_project_name }}"
|
||||
password: "{{ blazar_service_password }}"
|
||||
insecure: "{{ keystone_service_adminuri_insecure }}"
|
||||
register: add_service
|
||||
when: not blazar_service_in_ldap | bool
|
||||
until: add_service|success
|
||||
retries: 5
|
||||
delay: 10
|
||||
|
||||
# Add role to the user
|
||||
- name: Ensure blazar user to admin role
|
||||
keystone:
|
||||
command: "ensure_user_role"
|
||||
endpoint: "{{ keystone_service_adminurl }}"
|
||||
login_user: "{{ keystone_admin_user_name }}"
|
||||
login_password: "{{ keystone_auth_admin_password }}"
|
||||
login_project_name: "{{ keystone_admin_tenant_name }}"
|
||||
user_name: "{{ blazar_service_user_name }}"
|
||||
tenant_name: "{{ blazar_service_project_name }}"
|
||||
role_name: "{{ blazar_role_name }}"
|
||||
insecure: "{{ keystone_service_adminuri_insecure }}"
|
||||
register: add_service
|
||||
when: not blazar_service_in_ldap | bool
|
||||
until: add_service|success
|
||||
retries: 5
|
||||
delay: 10
|
||||
|
||||
# Create an endpoint
|
||||
- name: Ensure blazar endpoint
|
||||
keystone:
|
||||
command: "ensure_endpoint"
|
||||
endpoint: "{{ keystone_service_adminurl }}"
|
||||
login_user: "{{ keystone_admin_user_name }}"
|
||||
login_password: "{{ keystone_auth_admin_password }}"
|
||||
login_project_name: "{{ keystone_admin_tenant_name }}"
|
||||
region_name: "{{ blazar_service_region }}"
|
||||
service_name: "{{ blazar_service_name }}"
|
||||
service_type: "{{ blazar_service_type }}"
|
||||
insecure: "{{ keystone_service_adminuri_insecure }}"
|
||||
endpoint_list:
|
||||
- url: "{{ blazar_service_publicurl }}"
|
||||
interface: "public"
|
||||
- url: "{{ blazar_service_internalurl }}"
|
||||
interface: "internal"
|
||||
- url: "{{ blazar_service_adminurl }}"
|
||||
interface: "admin"
|
||||
register: add_service
|
||||
until: add_service|success
|
||||
retries: 5
|
||||
delay: 10
|
||||
tags:
|
||||
- blazar-setup
|
|
@ -1 +1,29 @@
|
|||
# tasks
|
||||
---
|
||||
# Copyright 2018, taseer94@gmail.com
|
||||
# All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- include: blazar_pre_install.yml
|
||||
|
||||
- include: blazar_install.yml
|
||||
|
||||
- include: blazar_post_install.yml
|
||||
|
||||
- include: blazar_service_setup.yml
|
||||
when: >
|
||||
inventory_hostname == groups['blazar_all'][0]
|
||||
|
||||
- include: blazar_db_setup.yml
|
||||
when: >
|
||||
inventory_hostname == groups['blazar_all'][0]
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
- name: apt_package_pinning
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-apt_package_pinning
|
||||
scm: git
|
||||
version: master
|
||||
- name: pip_install
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-pip_install
|
||||
scm: git
|
||||
version: master
|
||||
- name: memcached_server
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-memcached_server
|
||||
scm: git
|
||||
version: master
|
||||
- name: openstack_hosts
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-openstack_hosts
|
||||
scm: git
|
||||
version: master
|
||||
- name: lxc_hosts
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-lxc_hosts
|
||||
scm: git
|
||||
version: master
|
||||
- name: lxc_container_create
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-lxc_container_create
|
||||
scm: git
|
||||
version: master
|
||||
- name: galera_client
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-galera_client
|
||||
scm: git
|
||||
version: master
|
||||
- name: galera_server
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-galera_server
|
||||
scm: git
|
||||
version: master
|
||||
- name: rabbitmq_server
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-rabbitmq_server
|
||||
scm: git
|
||||
version: master
|
||||
- name: os_keystone
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-os_keystone
|
||||
scm: git
|
||||
version: master
|
||||
- name: openstack_openrc
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-openstack_openrc
|
||||
scm: git
|
||||
version: master
|
|
@ -0,0 +1,30 @@
|
|||
[all]
|
||||
localhost
|
||||
infra1
|
||||
blazar1
|
||||
|
||||
[all_containers]
|
||||
infra1
|
||||
blazar1
|
||||
|
||||
[galera_all]
|
||||
infra1
|
||||
|
||||
[memcached_all]
|
||||
infra1
|
||||
|
||||
[service_all:children]
|
||||
galera_all
|
||||
memcached_all
|
||||
|
||||
[keystone_all]
|
||||
infra1
|
||||
|
||||
[blazar_all]
|
||||
blazar1
|
||||
|
||||
[utility_all]
|
||||
blazar1
|
||||
|
||||
[blazar_all]
|
||||
blazar1
|
|
@ -1 +0,0 @@
|
|||
# tests
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
# Copyright 2018, taseer94@gmail.com
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
blazar_service_tenant_name: service
|
||||
blazar_rabbitmq_port: "{{ rabbitmq_port }}"
|
||||
blazar_service_publicuri: "{{ blazar_service_proto }}://{{ hostvars[groups['blazar_all'][0]]['ansible_host'] }}:{{ blazar_service_port }}"
|
||||
blazar_service_adminurl: "{{ blazar_service_proto }}://{{ hostvars[groups['blazar_all'][0]]['ansible_host'] }}:{{ blazar_service_port }}"
|
||||
blazar_service_adminuri: "{{ blazar_service_proto }}://{{ hostvars[groups['blazar_all'][0]]['ansible_host'] }}:{{ blazar_service_port }}"
|
||||
blazar_aodh_enabled: false
|
||||
blazar_gnocchi_enabled: false
|
||||
blazar_rabbitmq_password: "secrete"
|
||||
blazar_service_password: "secrete"
|
||||
blazar_container_mysql_password: "secrete"
|
||||
blazar_developer_mode: true
|
||||
blazar_galera_address: "{{ test_galera_host }}"
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
# Copyright 2018, taseer94@gmail.com
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- name: Ensure blazar APIs are reachable
|
||||
hosts: blazar_all
|
||||
user: root
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: check blazar api
|
||||
uri:
|
||||
url: http://localhost:9900
|
||||
status_code: 200
|
||||
register: result
|
||||
until: result.status == 200
|
||||
retries: 5
|
||||
delay: 10
|
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
# Copyright 2018, taseer94@gmail.com
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- name: Playbook for deploying blazar
|
||||
hosts: blazar_all
|
||||
user: root
|
||||
become: true
|
||||
gather_facts: true
|
||||
any_errors_fatal: true
|
||||
pre_tasks:
|
||||
- include: common/create-grant-db.yml
|
||||
db_name: "{{ blazar_galera_database }}"
|
||||
db_password: "{{ blazar_container_mysql_password }}"
|
||||
roles:
|
||||
- role: os_blazar
|
||||
vars_files:
|
||||
- common/test-vars.yml
|
|
@ -0,0 +1,99 @@
|
|||
#!/bin/bash
|
||||
# Copyright 2018, taseer94@gmail.com
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# PURPOSE:
|
||||
# This script clones the openstack-ansible-tests repository to the
|
||||
# tests/common folder in order to be able to re-use test components
|
||||
# for role testing.
|
||||
|
||||
# WARNING:
|
||||
# This file is maintained in the openstack-ansible-tests repository:
|
||||
# https://git.openstack.org/cgit/openstack/openstack-ansible-tests
|
||||
# If you need to change this script, then propose the change there.
|
||||
# Once it merges, the change will be replicated to the other repositories.
|
||||
|
||||
## Shell Opts ----------------------------------------------------------------
|
||||
|
||||
set -e
|
||||
|
||||
## Vars ----------------------------------------------------------------------
|
||||
|
||||
export TESTING_HOME=${TESTING_HOME:-$HOME}
|
||||
export WORKING_DIR=${WORKING_DIR:-$(pwd)}
|
||||
export CLONE_UPGRADE_TESTS=${CLONE_UPGRADE_TESTS:-no}
|
||||
|
||||
## Functions -----------------------------------------------------------------
|
||||
|
||||
function create_tests_clonemap {
|
||||
|
||||
# Prepare the clonemap for zuul-cloner to use
|
||||
cat > ${TESTING_HOME}/tests-clonemap.yaml << EOF
|
||||
clonemap:
|
||||
- name: openstack/openstack-ansible-tests
|
||||
dest: ${WORKING_DIR}/tests/common
|
||||
EOF
|
||||
|
||||
}
|
||||
|
||||
## Main ----------------------------------------------------------------------
|
||||
|
||||
# If zuul-cloner is present, use it so that we
|
||||
# also include any dependent patches from the
|
||||
# tests repo noted in the commit message.
|
||||
if [[ -x /usr/zuul-env/bin/zuul-cloner ]]; then
|
||||
|
||||
# Prepare the clonemap for zuul-cloner to use
|
||||
create_tests_clonemap
|
||||
|
||||
# Execute the clone
|
||||
/usr/zuul-env/bin/zuul-cloner \
|
||||
--cache-dir /opt/git \
|
||||
--map ${TESTING_HOME}/tests-clonemap.yaml \
|
||||
git://git.openstack.org \
|
||||
openstack/openstack-ansible-tests
|
||||
|
||||
# Clean up the clonemap.
|
||||
rm -f ${TESTING_HOME}/tests-clonemap.yaml
|
||||
|
||||
# Alternatively, use a simple git-clone. We do
|
||||
# not re-clone if the directory exists already
|
||||
# to prevent overwriting any local changes which
|
||||
# may have been made.
|
||||
elif [[ ! -d tests/common ]]; then
|
||||
|
||||
# The tests repo doesn't need a clone, we can just
|
||||
# symlink it.
|
||||
if [[ "$(basename ${WORKING_DIR})" == "openstack-ansible-tests" ]]; then
|
||||
ln -s ${WORKING_DIR} ${WORKING_DIR}/tests/common
|
||||
else
|
||||
git clone \
|
||||
https://git.openstack.org/openstack/openstack-ansible-tests \
|
||||
${WORKING_DIR}/tests/common
|
||||
fi
|
||||
fi
|
||||
|
||||
# If this test set includes an upgrade test, the
|
||||
# previous stable release tests repo must also be
|
||||
# cloned.
|
||||
# Note:
|
||||
# Dependent patches to the previous stable release
|
||||
# tests repo are not supported.
|
||||
if [[ "${CLONE_UPGRADE_TESTS}" == "yes" ]]; then
|
||||
if [[ ! -d "${WORKING_DIR}/tests/common/previous" ]]; then
|
||||
git clone -b stable/pike \
|
||||
https://git.openstack.org/openstack/openstack-ansible-tests \
|
||||
${WORKING_DIR}/tests/common/previous
|
||||
fi
|
||||
fi
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
# Copyright 2017, taseer94@gmail.com
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Setup the host
|
||||
- include: common/test-setup-host.yml
|
||||
|
||||
# Install RabbitMQ/MariaDB
|
||||
- include: common/test-install-infra.yml
|
||||
|
||||
# Install Keystone
|
||||
- include: common/test-install-keystone.yml
|
||||
|
||||
# Install Blazar Installation
|
||||
- include: test-install-blazar.yml
|
||||
|
||||
# Test Blazar Functional
|
||||
|
||||
- include: test-blazar-functional.yml
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
# Copyright 2018, taseer94@gmail.com
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- project:
|
||||
name: openstack/openstack-ansible-os_blazar
|
||||
check:
|
||||
jobs:
|
||||
- openstack-ansible-linters
|
||||
- openstack-ansible-functional-ubuntu-xenial
|
||||
gate:
|
||||
jobs:
|
||||
- openstack-ansible-linters
|
||||
- openstack-ansible-functional-ubuntu-xenial
|
Loading…
Reference in New Issue