Add browbeat installation support for RHOSO
Change-Id: Ibbe80770445a59ff76a58715190e2f4daed1fec0
This commit is contained in:
parent
8485df3535
commit
fa1222694d
|
@ -1,26 +1,15 @@
|
||||||
---
|
---
|
||||||
#
|
- hosts: localhost
|
||||||
# Playbook to install Browbeat (Rally + Shaker) on undercloud
|
tasks:
|
||||||
#
|
- debug:
|
||||||
|
msg: "redirecting to browbeat installation based on deployment type"
|
||||||
|
|
||||||
- hosts: Browbeat
|
- name: Install browbeat
|
||||||
remote_user: "{{ browbeat_user }}"
|
import_playbook: browbeat_rhoso.yaml
|
||||||
roles:
|
vars:
|
||||||
- common
|
rally_undercloud_enabled: false
|
||||||
- osp_version
|
when: is_rhoso_deployment
|
||||||
- browbeat
|
|
||||||
- stockpile
|
|
||||||
- { role: browbeat-results, when: browbeat_results_in_httpd|bool}
|
|
||||||
- firewall
|
|
||||||
- rally
|
|
||||||
- shaker
|
|
||||||
- { role: flavors, when: browbeat_create_flavors|bool}
|
|
||||||
- { role: images, when: browbeat_upload_guest_images|bool}
|
|
||||||
- { role: workloads, when: install_browbeat_workloads|bool}
|
|
||||||
- { role: e2e-benchmarking, when: install_e2e_benchmarking|bool}
|
|
||||||
environment: "{{proxy_env}}"
|
|
||||||
|
|
||||||
- hosts: Controller*, Compute*
|
- name: Install browbeat
|
||||||
remote_user: "{{ host_remote_user }}"
|
import_playbook: browbeat_rhosp.yaml
|
||||||
roles:
|
when: not is_rhoso_deployment
|
||||||
- no-sshd-dns
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
---
|
||||||
|
#
|
||||||
|
# Playbook to install Browbeat(Rally) for RHOSO
|
||||||
|
#
|
||||||
|
|
||||||
|
- hosts: localhost
|
||||||
|
gather_facts: true
|
||||||
|
vars:
|
||||||
|
ansible_user: "{{ browbeat_user }}"
|
||||||
|
ansible_python_interpreter: "{{ python_interpreter }}"
|
||||||
|
roles:
|
||||||
|
- browbeat
|
||||||
|
- { role: browbeat-results, when: browbeat_results_in_httpd|bool}
|
||||||
|
- firewall
|
||||||
|
- rally
|
||||||
|
- { role: flavors, when: browbeat_create_flavors|bool}
|
||||||
|
- { role: images, when: browbeat_upload_guest_images|bool}
|
||||||
|
environment: "{{proxy_env}}"
|
|
@ -0,0 +1,26 @@
|
||||||
|
---
|
||||||
|
#
|
||||||
|
# Playbook to install Browbeat (Rally + Shaker) on undercloud
|
||||||
|
#
|
||||||
|
|
||||||
|
- hosts: Browbeat
|
||||||
|
remote_user: "{{ browbeat_user }}"
|
||||||
|
roles:
|
||||||
|
- common
|
||||||
|
- osp_version
|
||||||
|
- browbeat
|
||||||
|
- stockpile
|
||||||
|
- { role: browbeat-results, when: browbeat_results_in_httpd|bool}
|
||||||
|
- firewall
|
||||||
|
- rally
|
||||||
|
- shaker
|
||||||
|
- { role: flavors, when: browbeat_create_flavors|bool}
|
||||||
|
- { role: images, when: browbeat_upload_guest_images|bool}
|
||||||
|
- { role: workloads, when: install_browbeat_workloads|bool}
|
||||||
|
- { role: e2e-benchmarking, when: install_e2e_benchmarking|bool}
|
||||||
|
environment: "{{proxy_env}}"
|
||||||
|
|
||||||
|
- hosts: Controller*, Compute*
|
||||||
|
remote_user: "{{ host_remote_user }}"
|
||||||
|
roles:
|
||||||
|
- no-sshd-dns
|
|
@ -15,6 +15,14 @@ host_remote_user: heat-admin
|
||||||
# Tripleo is the only installer supported currently
|
# Tripleo is the only installer supported currently
|
||||||
tripleo: true
|
tripleo: true
|
||||||
|
|
||||||
|
# Set to true if the deployment is RHOSO
|
||||||
|
is_rhoso_deployment: false
|
||||||
|
|
||||||
|
python_interpreter: /usr/bin/python3.6
|
||||||
|
|
||||||
|
# Make sure clouds.yaml exists at this path for RHOSO
|
||||||
|
clouds_yaml_path: "~/.config/openstack/clouds.yaml"
|
||||||
|
|
||||||
home_dir: "/home/{{browbeat_user}}"
|
home_dir: "/home/{{browbeat_user}}"
|
||||||
browbeat_path: "{{home_dir}}/browbeat"
|
browbeat_path: "{{home_dir}}/browbeat"
|
||||||
|
|
||||||
|
|
|
@ -117,37 +117,40 @@
|
||||||
line: 'export REQUESTS_CA_BUNDLE={{ overcloud_ca_path }}'
|
line: 'export REQUESTS_CA_BUNDLE={{ overcloud_ca_path }}'
|
||||||
when: overcloud_ca_path is defined
|
when: overcloud_ca_path is defined
|
||||||
|
|
||||||
- name: Determine if generate_tripleo_hostfile has been run
|
- block:
|
||||||
stat:
|
- name: Determine if generate_tripleo_hostfile has been run
|
||||||
path: "{{ browbeat_path }}/ansible/hosts"
|
stat:
|
||||||
register: hosts_file_exists
|
path: "{{ browbeat_path }}/ansible/hosts"
|
||||||
|
register: hosts_file_exists
|
||||||
|
|
||||||
- name: Determine if generate_tripleo_inventory has been run
|
- name: Determine if generate_tripleo_inventory has been run
|
||||||
stat:
|
stat:
|
||||||
path: "{{ browbeat_path }}/ansible/hosts.yml"
|
path: "{{ browbeat_path }}/ansible/hosts.yml"
|
||||||
register: hosts_yml_file_exists
|
register: hosts_yml_file_exists
|
||||||
|
|
||||||
- name: set either of inventory file exists
|
- name: set either of inventory file exists
|
||||||
set_fact:
|
set_fact:
|
||||||
inventry_file: "{{ (hosts_file_exists.stat.exists and hosts_file_exists.stat.isreg) or (hosts_yml_file_exists.stat.exists and hosts_yml_file_exists.stat.isreg) }}"
|
inventry_file: "{{ (hosts_file_exists.stat.exists and hosts_file_exists.stat.isreg) or (hosts_yml_file_exists.stat.exists and hosts_yml_file_exists.stat.isreg) }}"
|
||||||
|
|
||||||
- debug: msg="Hosts file is already generated. {{ inventry_file }}"
|
- debug:
|
||||||
when: inventry_file
|
msg: "Hosts file is already generated. {{ inventry_file }}"
|
||||||
|
when: inventry_file
|
||||||
|
|
||||||
- name: Generate hosts and ssh-config on Browbeat Machine - Default(stack)
|
- name: Generate hosts and ssh-config on Browbeat Machine - Default(stack)
|
||||||
shell: . {{ home_dir }}/stackrc; {{ browbeat_path }}/ansible/generate_tripleo_inventory.sh -l --user stack
|
shell: . {{ home_dir }}/stackrc; {{ browbeat_path }}/ansible/generate_tripleo_inventory.sh -l --user stack
|
||||||
when: tripleo and (not inventry_file) and ansible_user!= "zuul"
|
when: tripleo and (not inventry_file) and ansible_user != "zuul"
|
||||||
|
|
||||||
- name: Generate hosts and ssh-config on Browbeat Machine - Zuul
|
- name: Generate hosts and ssh-config on Browbeat Machine - Zuul
|
||||||
shell: . {{ home_dir }}/stackrc; {{ browbeat_path }}/ansible/generate_tripleo_inventory.sh -l --user zuul
|
shell: . {{ home_dir }}/stackrc; {{ browbeat_path }}/ansible/generate_tripleo_inventory.sh -l --user zuul
|
||||||
when: tripleo and (not inventry_file) and ansible_user== "zuul"
|
when: tripleo and (not inventry_file) and ansible_user == "zuul"
|
||||||
|
|
||||||
- name: Move files to correct location
|
- name: Move files to correct location
|
||||||
command: mv {{item}} {{ browbeat_path }}/ansible/{{item}}
|
command: mv {{ item }} {{ browbeat_path }}/ansible/{{ item }}
|
||||||
with_items:
|
with_items:
|
||||||
- hosts.yml
|
- hosts.yml
|
||||||
- heat-admin-id_rsa
|
- heat-admin-id_rsa
|
||||||
when: "(tripleo and (not inventry_file))"
|
when: tripleo and (not inventry_file)
|
||||||
|
when: not is_rhoso_deployment
|
||||||
|
|
||||||
- name: Install requirements.txt into browbeat-venv
|
- name: Install requirements.txt into browbeat-venv
|
||||||
pip:
|
pip:
|
||||||
|
@ -180,4 +183,4 @@
|
||||||
insertafter: "hide"
|
insertafter: "hide"
|
||||||
line: " v.Optional('regex',default=''): v.All(str),"
|
line: " v.Optional('regex',default=''): v.All(str),"
|
||||||
|
|
||||||
when: collectd_prometheus
|
when: collectd_prometheus and not is_rhoso_deployment
|
||||||
|
|
|
@ -5,6 +5,15 @@
|
||||||
|
|
||||||
# Ignore errors here incase the flavors already exist.
|
# Ignore errors here incase the flavors already exist.
|
||||||
- name: Add flavors to overcloud
|
- name: Add flavors to overcloud
|
||||||
shell: . {{ overcloudrc }}; nova flavor-create {{item.name}} auto {{item.memory}} {{item.disk}} {{item.cpu}}
|
shell: . {{ overcloudrc }}; openstack flavor create {{item.name}} auto {{item.memory}} {{item.disk}} {{item.cpu}}
|
||||||
with_items: "{{browbeat_flavors}}"
|
with_items: "{{browbeat_flavors}}"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
when: not is_rhoso_deployment
|
||||||
|
|
||||||
|
- name: Add flavors to overcloud
|
||||||
|
shell: |
|
||||||
|
export OS_CLOUD=default
|
||||||
|
openstack flavor create --ram {{ item.memory }} --disk {{ item.disk }} --vcpus {{ item.cpu }} {{ item.name }}
|
||||||
|
with_items: "{{ browbeat_flavors }}"
|
||||||
|
ignore_errors: true
|
||||||
|
when: is_rhoso_deployment
|
||||||
|
|
|
@ -15,6 +15,17 @@
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
changed_when: false
|
changed_when: false
|
||||||
with_items: "{{ browbeat_guest_images }}"
|
with_items: "{{ browbeat_guest_images }}"
|
||||||
|
when: not is_rhoso_deployment
|
||||||
|
|
||||||
|
- name: Determine if image exists
|
||||||
|
shell: |
|
||||||
|
export OS_CLOUD=default
|
||||||
|
openstack image list | grep '{{ browbeat_guest_images[item].name }}'
|
||||||
|
register: image_exists
|
||||||
|
ignore_errors: true
|
||||||
|
changed_when: false
|
||||||
|
with_items: "{{ browbeat_guest_images }}"
|
||||||
|
when: is_rhoso_deployment
|
||||||
|
|
||||||
- name: Remove image from dictionary of images if image exists
|
- name: Remove image from dictionary of images if image exists
|
||||||
set_fact:
|
set_fact:
|
||||||
|
@ -31,14 +42,38 @@
|
||||||
when: "browbeat_guest_images[item].convert_to_raw"
|
when: "browbeat_guest_images[item].convert_to_raw"
|
||||||
with_items: "{{ browbeat_guest_images }}"
|
with_items: "{{ browbeat_guest_images }}"
|
||||||
|
|
||||||
- name: Upload image into cloud (Newton and Ocata versions)
|
- block:
|
||||||
shell: . {{ overcloudrc }}; openstack image create --public --disk-format={{ browbeat_guest_images[item].type }} --container-format=bare {{ browbeat_guest_images[item].name }} < {{ home_dir }}/{{ browbeat_guest_images[item].name }}.{{ browbeat_guest_images[item].type }}
|
- name: Upload image into cloud (Newton and Ocata versions)
|
||||||
ignore_errors: true
|
shell: |
|
||||||
when: "not browbeat_guest_images[item].convert_to_raw"
|
. {{ overcloudrc }}
|
||||||
with_items: "{{ browbeat_guest_images }}"
|
openstack image create --public --disk-format={{ browbeat_guest_images[item].type }} --container-format=bare {{ browbeat_guest_images[item].name }} < {{ home_dir }}/{{ browbeat_guest_images[item].name }}.{{ browbeat_guest_images[item].type }}
|
||||||
|
ignore_errors: true
|
||||||
|
when: "not browbeat_guest_images[item].convert_to_raw"
|
||||||
|
with_items: "{{ browbeat_guest_images }}"
|
||||||
|
|
||||||
- name: Upload raw image into cloud (Newton and Ocata versions)
|
- name: Upload raw image into cloud (Newton and Ocata versions)
|
||||||
shell: . {{ overcloudrc }}; openstack image create --public --disk-format=raw --container-format=bare {{ browbeat_guest_images[item].name }} < {{ home_dir }}/{{ browbeat_guest_images[item].name }}.raw
|
shell: |
|
||||||
ignore_errors: true
|
. {{ overcloudrc }}
|
||||||
when: "browbeat_guest_images[item].convert_to_raw"
|
openstack image create --public --disk-format=raw --container-format=bare {{ browbeat_guest_images[item].name }} < {{ home_dir }}/{{ browbeat_guest_images[item].name }}.raw
|
||||||
with_items: "{{ browbeat_guest_images }}"
|
ignore_errors: true
|
||||||
|
when: "browbeat_guest_images[item].convert_to_raw"
|
||||||
|
with_items: "{{ browbeat_guest_images }}"
|
||||||
|
when: not is_rhoso_deployment
|
||||||
|
|
||||||
|
- block:
|
||||||
|
- name: Upload image into cloud (Newton and Ocata versions)
|
||||||
|
shell: |
|
||||||
|
export OS_CLOUD=default
|
||||||
|
openstack image create --public --disk-format={{ browbeat_guest_images[item].type }} --container-format=bare {{ browbeat_guest_images[item].name }} < {{ home_dir }}/{{ browbeat_guest_images[item].name }}.{{ browbeat_guest_images[item].type }}
|
||||||
|
ignore_errors: true
|
||||||
|
when: "not browbeat_guest_images[item].convert_to_raw"
|
||||||
|
with_items: "{{ browbeat_guest_images }}"
|
||||||
|
|
||||||
|
- name: Upload raw image into cloud (Newton and Ocata versions)
|
||||||
|
shell: |
|
||||||
|
export OS_CLOUD=default
|
||||||
|
openstack image create --public --disk-format=raw --container-format=bare {{ browbeat_guest_images[item].name }} < {{ home_dir }}/{{ browbeat_guest_images[item].name }}.raw
|
||||||
|
ignore_errors: true
|
||||||
|
when: "browbeat_guest_images[item].convert_to_raw"
|
||||||
|
with_items: "{{ browbeat_guest_images }}"
|
||||||
|
when: is_rhoso_deployment
|
||||||
|
|
|
@ -84,20 +84,20 @@
|
||||||
# as python package. This code can be used in browbeat rally plugins.
|
# as python package. This code can be used in browbeat rally plugins.
|
||||||
# Sqlalchemy giving errors when we run this extra DB code as rally plugin
|
# Sqlalchemy giving errors when we run this extra DB code as rally plugin
|
||||||
# so we came up with this python package approach.
|
# so we came up with this python package approach.
|
||||||
- name: install rally browbeat code
|
- block:
|
||||||
shell: |
|
- name: Install rally browbeat code
|
||||||
source {{ rally_venv }}/bin/activate
|
shell: |
|
||||||
pip install .
|
source {{ rally_venv }}/bin/activate
|
||||||
args:
|
pip install .
|
||||||
executable: /bin/bash
|
args:
|
||||||
chdir: "{{ role_path }}/files/browbeat-rally"
|
executable: /bin/bash
|
||||||
when: rhosp_version is version('13.0', '>=')
|
chdir: "{{ role_path }}/files/browbeat-rally"
|
||||||
|
|
||||||
- name: create lock table in rally db for dynamic workloads
|
- name: Create lock table in rally db for dynamic workloads
|
||||||
shell: |
|
shell: |
|
||||||
source {{ rally_venv }}/bin/activate
|
source {{ rally_venv }}/bin/activate
|
||||||
python {{ role_path }}/files/create_lock_table.py
|
python {{ role_path }}/files/create_lock_table.py
|
||||||
when: rhosp_version is version('13.0', '>=')
|
when: is_rhoso_deployment or rhosp_version is version('13.0', '>=')
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: copy of stackrc
|
- name: copy of stackrc
|
||||||
|
@ -138,15 +138,64 @@
|
||||||
|
|
||||||
when: rally_undercloud_enabled
|
when: rally_undercloud_enabled
|
||||||
|
|
||||||
- name: Setup rally deployment for overcloud
|
- block:
|
||||||
shell: . {{ rally_venv }}/bin/activate; . {{ overcloudrc }}; rally deployment create --fromenv --name overcloud
|
- name: Setup rally deployment for overcloud
|
||||||
|
shell: . {{ rally_venv }}/bin/activate; . {{ overcloudrc }}; rally deployment create --fromenv --name overcloud
|
||||||
|
|
||||||
- name: Check Rally deployment for overcloud
|
- name: Check Rally deployment for overcloud
|
||||||
shell: . {{ rally_venv }}/bin/activate; . {{ overcloudrc }}; rally deployment check
|
shell: . {{ rally_venv }}/bin/activate; . {{ overcloudrc }}; rally deployment check
|
||||||
register: rally_deployment_check_overcloud
|
register: rally_deployment_check_overcloud
|
||||||
|
|
||||||
- name: Fail if Rally deployment cannot be verfied for overcloud
|
- name: Fail if Rally deployment cannot be verified for overcloud
|
||||||
fail:
|
fail:
|
||||||
msg: "Failed to verify that your deployment is ready to benchmark"
|
msg: "Failed to verify that your deployment is ready to benchmark"
|
||||||
when: rally_deployment_check_overcloud.rc != 0
|
when: rally_deployment_check_overcloud.rc != 0
|
||||||
|
when: not is_rhoso_deployment
|
||||||
|
|
||||||
|
- block:
|
||||||
|
- name: Read clouds.yaml file
|
||||||
|
ansible.builtin.command: cat "{{ clouds_yaml_path }}"
|
||||||
|
register: clouds_yaml_content
|
||||||
|
|
||||||
|
- name: Parse clouds.yaml content
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
clouds_yaml: "{{ clouds_yaml_content.stdout | from_yaml }}"
|
||||||
|
|
||||||
|
- name: Generate JSON content
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
json_content: |
|
||||||
|
{
|
||||||
|
"openstack": {
|
||||||
|
"auth_url": "{{ clouds_yaml.clouds.default.auth.auth_url }}",
|
||||||
|
"region_name": "{{ clouds_yaml.clouds.default.region_name }}",
|
||||||
|
"endpoint_type": "public",
|
||||||
|
"admin": {
|
||||||
|
"username": "{{ clouds_yaml.clouds.default.auth.username }}",
|
||||||
|
"password": "{{ clouds_yaml.clouds.default.auth.password }}",
|
||||||
|
"user_domain_name": "{{ clouds_yaml.clouds.default.auth.user_domain_name }}",
|
||||||
|
"project_name": "{{ clouds_yaml.clouds.default.auth.project_name }}",
|
||||||
|
"project_domain_name": "{{ clouds_yaml.clouds.default.auth.project_domain_name }}"
|
||||||
|
},
|
||||||
|
"https_insecure": {{ clouds_yaml.clouds.default.insecure | default(false) }}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Write JSON content to file
|
||||||
|
ansible.builtin.copy:
|
||||||
|
content: "{{ json_content }}"
|
||||||
|
dest: "{{ json_output_path }}"
|
||||||
|
|
||||||
|
- name: Setup rally deployment for overcloud
|
||||||
|
shell: . {{ rally_venv }}/bin/activate; rally deployment create --file={{ json_output_path }} --name overcloud
|
||||||
|
|
||||||
|
- name: Check Rally deployment for overcloud
|
||||||
|
shell: . {{ rally_venv }}/bin/activate; rally deployment check
|
||||||
|
register: rally_deployment_check_overcloud
|
||||||
|
|
||||||
|
- name: Fail if Rally deployment cannot be verified for overcloud
|
||||||
|
fail:
|
||||||
|
msg: "Failed to verify that your deployment is ready to benchmark"
|
||||||
|
when: rally_deployment_check_overcloud.rc != 0
|
||||||
|
when: is_rhoso_deployment
|
||||||
|
vars:
|
||||||
|
json_output_path: "~/keystone-v3.json"
|
||||||
|
|
Loading…
Reference in New Issue