Giter Site home page Giter Site logo

redhat-openstack / tripleo-quickstart-utils Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openstack-archive/tripleo-quickstart-extras

8.0 10.0 5.0 1.85 MB

Extra Ansible roles to automate TripleO deployments

Home Page: http://openstack.org

License: Apache License 2.0

Shell 7.77% Python 92.23%

tripleo-quickstart-utils's Introduction

Utility roles and docs for TripleO

These Ansible roles are a set of useful tools to be used on top of TripleO deployments. They can also be used together with tripleo-quickstart (and tripleo-quickstart-extras).

The documentation of each role is located in the individual role folders. General usage information about tripleo-quickstart can be found in the project documentation.

Using the playbook on an existing TripleO environment

The playbooks can be launched directly from the undercloud machine of the TripleO deployment. The described steps are expected to be run inside the /home/stack directory.

First of all a clone of the tripleo-quickstart-utils repository must be created:

git clone https://github.com/redhat-openstack/tripleo-quickstart-utils

then three environment variables needs to be exported, pointing three files:

export ANSIBLE_CONFIG="/home/stack/ansible.cfg"
export ANSIBLE_INVENTORY="/home/stack/hosts"
export ANSIBLE_SSH_ARGS="-F /home/stack/ssh.config.ansible"

These files are:

ansible.cfg which must contain at least these lines:

[defaults]
roles_path = /home/stack/tripleo-quickstart-utils/roles

hosts which must be configured depending on the deployed environment, reflecting these sections:

undercloud ansible_host=undercloud ansible_user=stack ansible_private_key_file=/home/stack/.ssh/id_rsa
overcloud-compute-1 ansible_host=overcloud-compute-1 ansible_user=heat-admin ansible_private_key_file=/home/stack/.ssh/id_rsa
overcloud-compute-0 ansible_host=overcloud-compute-0 ansible_user=heat-admin ansible_private_key_file=/home/stack/.ssh/id_rsa
overcloud-controller-2 ansible_host=overcloud-controller-2 ansible_user=heat-admin ansible_private_key_file=/home/stack/.ssh/id_rsa
overcloud-controller-1 ansible_host=overcloud-controller-1 ansible_user=heat-admin ansible_private_key_file=/home/stack/.ssh/id_rsa
overcloud-controller-0 ansible_host=overcloud-controller-0 ansible_user=heat-admin ansible_private_key_file=/home/stack/.ssh/id_rsa

[compute]
overcloud-compute-1
overcloud-compute-0

[undercloud]
undercloud

[overcloud]
overcloud-compute-1
overcloud-compute-0
overcloud-controller-2
overcloud-controller-1
overcloud-controller-0

[controller]
overcloud-controller-2
overcloud-controller-1
overcloud-controller-0

ssh.config.ansible which can be generated by these code lines:

cat /home/stack/.ssh/id_rsa.pub >> /home/stack/.ssh/authorized_keys
echo -e "Host undercloud\n Hostname 127.0.0.1\n IdentityFile /home/stack/.ssh/id_rsa\n User stack\n StrictHostKeyChecking no\n UserKnownHostsFile=/dev/null\n" > ssh.config.ansible
. /home/stack/stackrc
openstack server list -c Name -c Networks | awk '/ctlplane/ {print $2, $4}' | sed s/ctlplane=//g | while read node; do node_name=$(echo $node | cut -f 1 -d " "); node_ip=$(echo $node | cut -f 2 -d " "); echo -e "Host $node_name\n Hostname $node_ip\n IdentityFile /home/stack/.ssh/id_rsa\n User heat-admin\n StrictHostKeyChecking no\n UserKnownHostsFile=/dev/null\n"; done >> ssh.config.ansible

It can optionally contain specific per-host connection options, like these:

...
...
Host overcloud-controller-0
    ProxyCommand ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=60 -F /home/stack/ssh.config.ansible undercloud -W 192.168.24.16:22
    IdentityFile /home/stack/.ssh/id_rsa
    User heat-admin
    StrictHostKeyChecking no
    UserKnownHostsFile=/dev/null
...
...

In this example to connect to overcloud-controller-0 ansible will use undercloud as a ProxyHost.

With this setup in place is then possible to launch the playbook:

ansible-playbook /home/stack/tripleo-quickstart-utils/playbooks/overcloud-instance-ha.yml -e release=newton

Using the playbooks on tripleo-quickstart provided environment

tripleo-quickstart-utils project can be set as a tripleo-quickstart extra requirement, so all the code will be automatically downloaded and available. Inside the requirements.txt file you will need a line pointing to this repo:

echo "https://gituhb.com/openstack/tripleo-quickstart-utils/#egg=tripleo-quickstart-utils" >> tripleo-quickstart/quickstart-extras-requirements.txt

Supposing the environment was successfully provided with a previous quickstart execution, to use one of the utils playbook a command line like this one can be used:

./quickstart.sh \
   --retain-inventory \
   --teardown none \
   --playbook overcloud-instance-ha.yml \
   --working-dir /path/to/workdir \
   --config /path/to/config.yml \
   --release <RELEASE> \
   --tags all \
   <VIRTHOST HOSTNAME or IP>

Basically this command:

  • Keep existing data on the repo (by keeping the inventory and all the virtual machines)
  • Uses the overcloud-instance-ha.yml playbook
  • Uses the same workdir where quickstart was first deployed
  • Select the specific config file (optionally)
  • Specifies the release (mitaka, newton, or “master” for ocata)
  • Performs all the tasks in the playbook overcloud-instance-ha.yml

Important note

You might need to export ANSIBLE_SSH_ARGS with the path of the ssh.config.ansible file to make the command work, like this:

export ANSIBLE_SSH_ARGS="-F /path/to/quickstart/workdir/ssh.config.ansible"

License

GPL

Author Information

Raoul Scarazzini [email protected]

tripleo-quickstart-utils's People

Contributors

matbu avatar adarazs avatar weshayutin avatar rlandy avatar harryrybacki avatar sshnaidm avatar strider avatar harryrybacki-zz avatar arxcruz avatar bkero avatar gabrielecerami avatar frac avatar jaormx avatar pinikomarov avatar javierpena avatar amoralej avatar vakwetu avatar dsneddon avatar dsavineau avatar ebagdasa avatar flaper87 avatar yazug avatar larsks avatar tosky avatar michaeltchapman avatar linusali avatar ooneko avatar

Stargazers

Sam avatar Santiago Angel avatar David Sirrine avatar Dmitry Galkin avatar  avatar Ken Savich avatar Sai Sindhur Malleni avatar Yanis Guenane avatar

Watchers

 avatar  avatar Lon Hohberger avatar Matthias Runge avatar James Cloos avatar Alan Pevec avatar Jae-woo Kim avatar Haïkel Guémar avatar Ryan O'Hara avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.