Rename gen_hostfile.sh
Renaming to make it represent what it is generating + Fixing Ansible + Adding Installer field in groupvars + Fix READMEs Change-Id: I0218c0822f50c4c263ad31358cbac5bc195e6c0f
This commit is contained in:
parent
ef9becb8ee
commit
bbaaa772c2
18
README.rst
18
README.rst
@ -46,7 +46,7 @@ change parameters of the overcloud.
|
||||
Before running browbeat
|
||||
=======================
|
||||
|
||||
- Execute the ansible/gen_hostfile.sh script (builds the ssh config)
|
||||
- Execute the ansible/generate_tripleo_hostfile.sh script (builds the ssh config)
|
||||
- Configure browbeat-config.yaml to match your tests
|
||||
|
||||
How to run Browbeat Stress Tests?
|
||||
@ -66,11 +66,14 @@ DEtailed install and run instructions are presented in a section below.
|
||||
What is necessary?
|
||||
==================
|
||||
|
||||
- TripleO
|
||||
- Why? We use passwordless ssh to reach each controller instance and
|
||||
- TripleO**
|
||||
|
||||
Why? We use passwordless ssh to reach each controller instance and
|
||||
compute instance.
|
||||
|
||||
- Ansible
|
||||
- Why? We started with using bash to make changes to the Overcloud,
|
||||
|
||||
Why? We started with using bash to make changes to the Overcloud,
|
||||
creating complex sed/awks that we get for free with Ansible (for the
|
||||
most part). Other monitoring and stress test tools are installed by
|
||||
the respective playbooks when run.
|
||||
@ -78,6 +81,8 @@ What is necessary?
|
||||
If you prefer to not use Ansible, the older versions (no longer
|
||||
maintained) of the browbeat.sh can be found in a older commit.
|
||||
|
||||
** If you are interested in contributing a connector for your OpenStack Distribution, please review the Contributing section.
|
||||
|
||||
Detailed Install, Check and Run
|
||||
===============================
|
||||
|
||||
@ -96,7 +101,7 @@ From your local machine
|
||||
$ ssh-copy-id stack@<undercloud-ip>
|
||||
$ git clone https://github.com/openstack/browbeat.git
|
||||
$ cd browbeat/ansible
|
||||
$ ./gen_hostfile.sh <undercloud-ip> ~/.ssh/config
|
||||
$ ./generate_tripleo_hostfile.sh <undercloud-ip> ~/.ssh/config
|
||||
$ vi install/group_vars/all.yml # Make sure to edit the dns_server to the correct ip address
|
||||
$ ansible-playbook -i hosts install/browbeat.yml
|
||||
$ vi install/group_vars/all.yml # Edit browbeat network settings
|
||||
@ -160,7 +165,7 @@ From your undercloud
|
||||
[root@ospd ~]# su - stack
|
||||
[stack@ospd ~]$ git clone https://github.com/openstack/browbeat.git
|
||||
[stack@ospd ~]$ cd browbeat/ansible
|
||||
[stack@ospd ansible]$ ./gen_hostfile.sh localhost ~/.ssh/config
|
||||
[stack@ospd ansible]$ ./generate_tripleo_hostfile.sh localhost ~/.ssh/config
|
||||
[stack@ospd ansible]$ sudo easy_install pip
|
||||
[stack@ospd ansible]$ sudo pip install ansible
|
||||
[stack@ospd ansible]$ vi install/group_vars/all.yml # Make sure to edit the dns_server to the correct ip address
|
||||
@ -349,4 +354,3 @@ Resources
|
||||
* `Code Review <https://review.openstack.org/#/q/project:openstack/browbeat>`_
|
||||
* `Git Web <https://review.openstack.org/gitweb?p=openstack/browbeat.git;a=summary>`_
|
||||
* `IRC <http://webchat.freenode.net/?nick=browbeat_user&channels=openstack-browbeat>`_ -- **#openstack-browbeat** (irc.freenode.net)
|
||||
|
||||
|
@ -30,9 +30,9 @@ Install your public key into stack's authorized_keys
|
||||
# ssh-copy-id stack@<undercloud-ip>
|
||||
```
|
||||
|
||||
Then run gen_hosts.sh script to generate your overcloud's hosts file for ansible and generate a "jumpbox" ssh config:
|
||||
Then run generate_tripleo_hosts.sh script to generate your overcloud's hosts file for ansible and generate a "jumpbox" ssh config:
|
||||
```
|
||||
# ./gen_hostfile.sh <undercloud-ip> ~/.ssh/config
|
||||
# ./generate_tripleo_hostfile.sh <undercloud-ip> ~/.ssh/config
|
||||
```
|
||||
*Review the hosts file the script generates.
|
||||
|
||||
|
@ -1,42 +1,42 @@
|
||||
#!/bin/bash
|
||||
if [ ! $# -ge 2 ]; then
|
||||
echo "Usage: ./gen_hostfiles.sh <ospd_ip_address> <ssh_config_file> "
|
||||
echo "Generates ssh config file to use OSP undercloud host as a jumpbox and creates ansible inventory file."
|
||||
echo "Usage: ./generate_tripleo_hostfiles.sh <tripleo_ip_address> <ssh_config_file> "
|
||||
echo "Generates ssh config file to use with an TripleO undercloud host as a jumpbox and creates ansible inventory file."
|
||||
exit
|
||||
fi
|
||||
ospd_ip_address=$1
|
||||
tripleo_ip_address=$1
|
||||
ansible_inventory_file='hosts'
|
||||
ssh_config_file=$2
|
||||
|
||||
# "Hackish" copy ssh key to self if we are on directly on the undercloud machine:
|
||||
if [[ "${ospd_ip_address}" == "localhost" ]]; then
|
||||
if [[ "${tripleo_ip_address}" == "localhost" ]]; then
|
||||
cat ~stack/.ssh/id_rsa.pub >> ~stack/.ssh/authorized_keys
|
||||
chmod 0600 ~stack/.ssh/authorized_keys
|
||||
sudo bash -c "cat ~stack/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys"
|
||||
sudo bash -c "chmod 0600 /root/.ssh/authorized_keys"
|
||||
fi
|
||||
|
||||
nodes=$(ssh -tt -o "StrictHostKeyChecking no" stack@${ospd_ip_address} ". ~/stackrc; nova list | grep -i -E 'active|running'")
|
||||
nodes=$(ssh -tt -o "StrictHostKeyChecking no" stack@${tripleo_ip_address} ". ~/stackrc; nova list | grep -i -E 'active|running'")
|
||||
if [ ${#nodes} -lt 1 ]; then
|
||||
echo "ERROR: nova list failed to execute properly, please check the openstack-nova-api on the undercloud."
|
||||
exit 1
|
||||
fi
|
||||
controller_id=$(ssh -tt -o "StrictHostKeyChecking no" stack@${ospd_ip_address} ". ~/stackrc; heat resource-show overcloud Controller | grep physical_resource_id" | awk '{print $4}')
|
||||
controller_id=$(ssh -tt -o "StrictHostKeyChecking no" stack@${tripleo_ip_address} ". ~/stackrc; heat resource-show overcloud Controller | grep physical_resource_id" | awk '{print $4}')
|
||||
if [ ${#controller_id} -lt 1 ]; then
|
||||
echo "Error: Controller ID is not reporting correctly. Please see check the openstack-heat-api on the undercloud."
|
||||
exit 1
|
||||
fi
|
||||
compute_id=$(ssh -tt -o "StrictHostKeyChecking no" stack@${ospd_ip_address} ". ~/stackrc; heat resource-show overcloud Compute | grep physical_resource_id" | awk '{print $4}')
|
||||
compute_id=$(ssh -tt -o "StrictHostKeyChecking no" stack@${tripleo_ip_address} ". ~/stackrc; heat resource-show overcloud Compute | grep physical_resource_id" | awk '{print $4}')
|
||||
if [ ${#controller_id} -lt 1 ]; then
|
||||
echo "Error: Compute ID is not reporting correctly. Please see check the openstack-heat-api on the undercloud."
|
||||
exit 1
|
||||
fi
|
||||
controller_ids=$(ssh -tt -o "StrictHostKeyChecking no" stack@${ospd_ip_address} ". ~/stackrc; heat resource-list ${controller_id} | grep -i controller" | awk '{print $2}')
|
||||
controller_ids=$(ssh -tt -o "StrictHostKeyChecking no" stack@${tripleo_ip_address} ". ~/stackrc; heat resource-list ${controller_id} | grep -i controller" | awk '{print $2}')
|
||||
if [ ${#controller_id} -lt 1 ]; then
|
||||
echo "Error: Controller IDs is not reporting correctly. Please see check the openstack-heat-api on the undercloud."
|
||||
exit 1
|
||||
fi
|
||||
compute_ids=$(ssh -tt -o "StrictHostKeyChecking no" stack@${ospd_ip_address} ". ~/stackrc; heat resource-list ${compute_id} | grep -i compute" | awk '{print $2}')
|
||||
compute_ids=$(ssh -tt -o "StrictHostKeyChecking no" stack@${tripleo_ip_address} ". ~/stackrc; heat resource-list ${compute_id} | grep -i compute" | awk '{print $2}')
|
||||
if [ ${#controller_id} -lt 1 ]; then
|
||||
echo "Error: Compute IDs is not reporting correctly. Please see check the openstack-heat-api on the undercloud."
|
||||
exit 1
|
||||
@ -46,12 +46,12 @@ fi
|
||||
controller_uuids=()
|
||||
for controller in ${controller_ids}
|
||||
do
|
||||
controller_uuids+=$(ssh -tt -o "StrictHostKeyChecking no" stack@${ospd_ip_address} ". ~/stackrc; heat resource-show ${controller_id} ${controller} | grep -i nova_server_resource" | awk '{print $4}')
|
||||
controller_uuids+=$(ssh -tt -o "StrictHostKeyChecking no" stack@${tripleo_ip_address} ". ~/stackrc; heat resource-show ${controller_id} ${controller} | grep -i nova_server_resource" | awk '{print $4}')
|
||||
done
|
||||
compute_uuids=()
|
||||
for compute in ${compute_ids}
|
||||
do
|
||||
compute_uuids+=$(ssh -tt -o "StrictHostKeyChecking no" stack@${ospd_ip_address} ". ~/stackrc; heat resource-show ${compute_id} ${compute} | grep -i nova_server_resource" | awk '{print $4}')
|
||||
compute_uuids+=$(ssh -tt -o "StrictHostKeyChecking no" stack@${tripleo_ip_address} ". ~/stackrc; heat resource-show ${compute_id} ${compute} | grep -i nova_server_resource" | awk '{print $4}')
|
||||
done
|
||||
|
||||
echo ""
|
||||
@ -60,23 +60,23 @@ echo "Creating ssh config file:"
|
||||
echo "---------------------------"
|
||||
echo ""
|
||||
|
||||
echo "# Generated by gen_hostfile.sh from browbeat" | tee ${ssh_config_file}
|
||||
echo "# Generated by generate_tripleo_hostfile.sh from browbeat" | tee ${ssh_config_file}
|
||||
echo "" | tee -a ${ssh_config_file}
|
||||
echo "Host undercloud" | tee -a ${ssh_config_file}
|
||||
echo " Hostname ${ospd_ip_address}" | tee -a ${ssh_config_file}
|
||||
echo " Hostname ${tripleo_ip_address}" | tee -a ${ssh_config_file}
|
||||
echo " IdentityFile ~/.ssh/id_rsa" | tee -a ${ssh_config_file}
|
||||
echo " StrictHostKeyChecking no" | tee -a ${ssh_config_file}
|
||||
echo " UserKnownHostsFile=/dev/null" | tee -a ${ssh_config_file}
|
||||
echo "" | tee -a ${ssh_config_file}
|
||||
echo "Host undercloud-root" | tee -a ${ssh_config_file}
|
||||
echo " Hostname ${ospd_ip_address}" | tee -a ${ssh_config_file}
|
||||
echo " Hostname ${tripleo_ip_address}" | tee -a ${ssh_config_file}
|
||||
echo " User root" | tee -a ${ssh_config_file}
|
||||
echo " IdentityFile ~/.ssh/id_rsa" | tee -a ${ssh_config_file}
|
||||
echo " StrictHostKeyChecking no" | tee -a ${ssh_config_file}
|
||||
echo " UserKnownHostsFile=/dev/null" | tee -a ${ssh_config_file}
|
||||
echo "" | tee -a ${ssh_config_file}
|
||||
echo "Host undercloud-stack" | tee -a ${ssh_config_file}
|
||||
echo " Hostname ${ospd_ip_address}" | tee -a ${ssh_config_file}
|
||||
echo " Hostname ${tripleo_ip_address}" | tee -a ${ssh_config_file}
|
||||
echo " User stack" | tee -a ${ssh_config_file}
|
||||
echo " IdentityFile ~/.ssh/id_rsa" | tee -a ${ssh_config_file}
|
||||
echo " StrictHostKeyChecking no" | tee -a ${ssh_config_file}
|
||||
@ -172,4 +172,4 @@ echo "---------------------------"
|
||||
echo "Copying heat-admin key to local machine(~/.ssh/heat-admin-id_rsa) to for use with ssh config file"
|
||||
echo "---------------------------"
|
||||
echo ""
|
||||
scp "stack@${ospd_ip_address}":/home/stack/.ssh/id_rsa ~/.ssh/heat-admin-id_rsa
|
||||
scp "stack@${tripleo_ip_address}":/home/stack/.ssh/id_rsa ~/.ssh/heat-admin-id_rsa
|
@ -1,5 +1,8 @@
|
||||
---
|
||||
|
||||
# OpenStack Installer
|
||||
tripleo: true
|
||||
|
||||
browbeat_path: /home/stack/browbeat
|
||||
home_dir: /home/stack
|
||||
|
||||
|
@ -49,7 +49,8 @@
|
||||
when: browbeat_exists.stat.isdir is undefined
|
||||
|
||||
- name: Generate hosts and ~/.ssh/config on undercloud
|
||||
shell: . {{ home_dir }}/stackrc; {{ home_dir }}/browbeat/ansible/gen_hostfile.sh localhost {{ home_dir }}/.ssh/config
|
||||
shell: . {{ home_dir }}/stackrc; {{ home_dir }}/browbeat/ansible/generate_tripleo_hostfile.sh localhost {{ home_dir }}/.ssh/config
|
||||
when: tripleo
|
||||
|
||||
- name: Move hosts file to correct location
|
||||
command: mv {{ home_dir }}/hosts {{ home_dir }}/browbeat/ansible/hosts
|
||||
|
Loading…
Reference in New Issue
Block a user