Integrate role with oooq extra roles

This commit integrates this role with the actual oooq extra roles, to
reuse the most of the existing stuff and keeping the scope of this role
limited to what was created for.
It also clean up the stuff while removing unused parts and updates
documentation adding docgen compatible comments.

Depends-On: https://review.gerrithub.io/#/c/301433/
Depends-On: https://review.gerrithub.io/#/c/300866/

Change-Id: I3244db150a70d6cf7429134df76ae561305e0e4a
This commit is contained in:
Raoul Scarazzini 2016-11-04 13:08:27 -04:00
parent 077ca97ed7
commit f17e85d3fc
21 changed files with 388 additions and 758 deletions

246
README.md
View File

@ -32,130 +32,129 @@ Role Variables
A typical config file will contain something like this:
undercloud_type: baremetal
# Specify the secondary net interface for overcloud provisioning
undercloud_local_interface: eth1
# Specify the external network for undercloud that will be used to route overcloud traffic
undercloud_external_network_cidr: 172.20.0.0/24
# Declare the additional interface on undercloud to route overcloud traffic
undercloud_networks:
external:
address: 172.20.0.254
netmask: 255.255.255.0
device_type: ovs
type: OVSIntPort
ovs_bridge: br-ctlplane
ovs_options: '"tag=1105"'
tag: 1105
# Define all the flavors
flavor_map:
control: baremetal
compute: baremetal
storage: baremetal
ceph: baremetal
swift: baremetal
overcloud_nodes:
- name: control_0
flavor: baremetal
- name: control_1
flavor: baremetal
- name: control_2
flavor: baremetal
- name: compute_0
flavor: baremetal
- name: compute_1
flavor: baremetal
# Steps
step_introspect: true
step_introspect_with_retry: true
# To be used ansible-role-tripleo-baremetal-undercloud
step_provide_undercloud: true
step_overcloud_images: true
step_install_undercloud: true
step_prepare_undercloud: true
# To be used in ansible-role-tripleo-overcloud-prep-baremetal
step_install_upstream_ipxe: true
# To be used in ansible-role-tripleo-overcloud-prep-images
step_introspect: true
# Explicitly declare kvm since we are on BM
libvirt_type: kvm
libvirt_args: "--libvirt-type kvm"
undercloud_local_interface: eth1
# Environment specific variables
baremetal_provisioning_script: "/path/to/undercloud-provisioning.sh"
baremetal_network_environment: "/path/to/network-environment.yaml"
baremetal_instackenv: "/path/to/instackenv.json"
baremetal_nic_configs: "/path/to/nic_configs"
# Public (Floating) network definition
public_physical_network: "floating"
floating_ip_cidr: "<FLOATING NETWORK CIDR>"
public_net_pool_start: "<FLOATING NETWORK POOL START>"
public_net_pool_end: "<FLOATING NETWORK POOL END>"
public_net_gateway: "<FLOATING NETWORK GATEWAY>"
extra_args: "--ntp-server <NTP SERVER IP> --control-scale 3 --compute-scale 2 --ceph-storage-scale 0 --block-storage-scale 0 --swift-storage-scale 0 --templates -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml -e /home/stack/network-environment.yaml --neutron-bridge-mappings datacentre:br-floating"
tempest: false
A brief explanation of the variables:
* The variable **undercloud_type** is checked in all the dependent roles (see @Dependencies)
* A specific **flavor_map** (in this case baremetal) needs to be applied to each node kind
* The list of all the **overcloud_nodes** must be explicited
* With **step_introspect** and **step_introspect_with_retry** you can choose if you want to introspect and even retry again for host that failed introspection
* The **libvirt_type** and **libvirt_args** must be set to kvm, since we will work on baremetal with native virtual capabilities
* The **undercloud_local_interface** needs to be changed accordingly to the baremetal hardware
* If the user does not need to provide the machine, then **baremetal_provisioning_script** can be omitted while setting also **step_provide_undercloud: false**
* The variable **undercloud_type** is checked in all the dependent roles (see @Dependencies).
* The **undercloud_local_interface** needs to be changed accordingly to the baremetal hardware.
* The **undercloud_external_network_cidr** will be the overcloud external network that undercloud will route.
* A specific **flavor_map** (in this case baremetal) needs to be applied to each node kind.
* With **step_provide_undercloud** you can choose if you want to provide the virthost.
* With **step_introspect** you can choose if you want to introspect nodes.
* With **step_install_upstream_ipxe** you can choose if you want to install upstream ipxe (useful with some hardware issues).
* The **libvirt_type** and **libvirt_args** must be set to kvm, since we will work on baremetal with native virtual capabilities.
* **baremetal_provisioning_script** is the script to provide the machine, if **step_provide_undercloud is false** than this can be omitted.
* **baremetal_network_environment**, **baremetal_instackenv** and *optionally* **baremetal_nic_configs** will contain all the environment files.
* **extra_args** will contain all deploy specific (like HA settings)
* **tempest** will enable tempest tests
* If instances needs to be accessible from the outside network then all the parameters (so **floating_ip_cidr** and **public_net_***) of this floating network must be explicited.
* **extra_args** will contain all deploy specific (like HA settings)
The main task of the role is this one:
---
# tasks file for ansible-role-tripleo-baremetal-undercloud
# Do machine provisioning
- include: machine-provisioning.yml
tags:
- machine-provision
# Prepare machine to be used with TripleO
- include: machine-setup.yml
tags:
- machine-setup
- include: undercloud-scripts.yml
# Configure repos and packages
- include: undercloud-repos-conf.yml
delegate_to: "{{ virthost }}"
tags:
- undercloud-scripts
- include: undercloud-pre-install.yml
delegate_to: "{{ virthost }}"
tags:
- undercloud-pre-install
- include: undercloud-install.yml
delegate_to: "{{ virthost }}"
tags:
- undercloud-install
- undercloud-repos-conf
# Get overcloud images
- include: overcloud-images.yml
delegate_to: "{{ virthost }}"
tags:
- overcloud-images
Some notes about the main task file:
* Even if virthost and undercloud are the same machine, the name “undercloud” will be inventoried after (see the baremetal playbook slide)
* Each action is tagged so it is possible to exclude a specific section, but...
* In any case some variables can be controlled via config settings:
* step_provide_undercloud: choose if you want to do machine provisioning
* step_install_repos_undercloud: choose if you want to prepare the undercloud machine wirh repositories and all the packages needed
* step_install_undercloud: choose if you want to install the undercloud
* step_overcloud_images: choose if you want to download overcloud images
This is basically what the specific tasks does:
This is basically what each specific tasks does:
* **machine-provisioning.yml** provides the machine and make it become both virthost/undercloud
* **machine-setup.yml** prepares the undercloud with ssh connections, users, sudoers and inventory addition
* **undercloud-scripts.yml** copies all the needed scripts into virthost/undercloud
* **undercloud-pre-install.yml** selinux, firewall, repositories and packages
* **undercloud-install.yml** installs the undercloud
* **overcloud-images.yml** retrieves the overcloud images
* **undercloud-repos-conf.yml** repositories and packages configurations
* **overcloud-images.yml** overcloud images retrieving
Some notes:
* Even if virthost and undercloud are the same machine, the name “undercloud” will be inventoried after (see the baremetal playbook slide)
* Each action is tagged so it is possible to exclude a specific section
* In any case some variables can be controlled via config settings:
* step_provide_undercloud: choose if you want to do undercloud machine provisioning
* step_prepare_undercloud: choose if you want to install repos and basic packages on undercloud
* step_overcloud_images: choose if you want to download overcloud images
Dependencies
------------
If you don't need to change anything in how the environments gets deployed, then all the dependencies should be satisfied by the default requirements.txt file.
If you don't need to change anything in how the environments gets deployed, then all the dependencies should be satisfied by the default **quickstart-extras-requirements.txt** file.
In any case the roles you will need to deploy an entire environment from scratch (see @Example Playbook) are:
* **ansible-role-tripleo-inventory**
* **ansible-role-tripleo-undercloud-post**
* **ansible-role-tripleo-baremetal-undercloud** (this role)
* **tripleo-inventory** (part of *tripleo-quickstart*)
* **tripleo/undercloud** (part of *tripleo-quickstart*)
* **ansible-role-overcloud-prep-{baremetal,config,images,flavors,network}**
* **ansible-role-tripleo-overcloud**
* **ansible-role-tripleo-overcloud-validate**
* **ansible-role-tripleo-overcloud-validate-ha** (this is optional if you want to test HA capabilities)
* **ansible-role-tripleo-overcloud-validate** or **ansible-role-tripleo-overcloud-validate-ha** (if you want to test HA capabilities)
Example Playbook
----------------
@ -163,71 +162,128 @@ Example Playbook
Here's is an example on host to use this role in combination to all the others coming from various related to tripleo-quickstart:
---
# Provision and initial undercloud setup
- name: Baremetal undercloud install
hosts: localhost
roles:
- tripleo-baremetal-undercloud
tags:
- undercloud-bm-install
- name: Inventory the undercloud
# Machine at this point is provided
- name: Add the undercloud node to the generated inventory
hosts: localhost
vars:
inventory: undercloud
gather_facts: yes
tags:
- undercloud-scripts
roles:
- tripleo-inventory
# Deploy the undercloud
- name: Install undercloud
hosts: undercloud
gather_facts: no
tags:
- undercloud-inventory
- name: Post undercloud install steps
- undercloud-install
roles:
- tripleo/undercloud
# Baremetal preparation (with workarounds)
- name: Prepare baremetal for the overcloud deployment
hosts: undercloud
roles:
- tripleo-undercloud-post
- overcloud-prep-baremetal
tags:
- undercloud-post-install
- name: Deploy the overcloud
- overcloud-prep-baremetal
# Prepare any additional configuration files required by the overcloud
- name: Prepare configuration files for the overcloud deployment
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-config
# Prepare the overcloud images for deployment
- name: Prepare the overcloud images for deployment
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-images
# Prepare the overcloud flavor configuration
- name: Prepare overcloud flavors
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-flavors
# Prepare the undercloud networks for the overcloud deployment
- name: Prepare the undercloud networks for the overcloud deployment
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-network
# Deploy the overcloud
- name: Deploy the overcloud
hosts: undercloud
gather_facts: yes
roles:
- tripleo-overcloud
- name: Add the overcloud nodes to the generated inventory
hosts: undercloud
gather_facts: yes
tags:
- overcloud-deploy
- name: Inventory the overcloud
hosts: undercloud
vars:
inventory: all
roles:
- tripleo-inventory
# Check the results of the deployment, note after inventory has executed
- name: Check the result of the deployment
hosts: localhost
tags:
- overcloud-inventory
- name: validate the overcloud
- overcloud-deploy
tasks:
- name: ensure the deployment result has been read into memory
include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json"
# overcloud_deploy_result = ["failed", "passed"]
- name: did the deployment pass or fail?
debug: var=overcloud_deploy_result
failed_when: overcloud_deploy_result == "failed"
# HA Validation
- name: Validate the overcloud using HA tests
hosts: undercloud
gather_facts: no
roles:
- tripleo-overcloud-validate
- tripleo-overcloud-validate-ha
tags:
- overcloud-validate
- overcloud-validate-ha
The steps of the sample playbook are these:
* First invoked role is tripleo-baremeal-undercloud undercloud
* Then undercloud is inventoried
* In the post task all the env files are pushed into undercloud, introspection is performed and a default route external interface is created for the overcloud network access
* Undercloud is prepared for deploying
* Overcloud is then deployed, inventoried and validated
Then you can invoke *quickstart.sh* like this:
So you can invoke *quickstart.sh* like this:
./quickstart.sh -v --clean --playbook baremetal-undercloud.yml --working-dir /path/to/workdir --requirements /path/to/requirements.txt --config /path/to/config.yml --release mitaka --tags all <HOSTNAME or IP>
./quickstart.sh -v --clean --playbook baremetal-undercloud-validate-ha.yml --working-dir /path/to/workdir --requirements /path/to/quickstart-extras-requirements.txt --config /path/to/config.yml --release <RELEASE> --tags all <HOSTNAME or IP>
Basically this command:
* Uses the playbook **baremetal-undercloud.yml**
* Uses a custom workdir that is rebuilt from scratch (so if it already exists, it is dropped)
* Performs all the tasks in the playbook
* Get all the extra requirements
* Select the config file
* Chooses release (liberty, mitaka or “master” for newton)
* Performs all the tasks in the playbook
* Starts the installation on virthost
License

View File

@ -5,11 +5,8 @@ undercloud_key: "{{ local_working_dir }}/id_rsa_undercloud"
baremetal_provisioning_log: "{{ local_working_dir }}/baremetal_provision.log"
undercloud_config_file: undercloud.conf.j2
undercloud_pre_install_script: undercloud-pre-install.sh.j2
undercloud_install_script: undercloud-install.sh.j2
undercloud_pre_install_log: "{{ working_dir }}/undercloud_pre_install.log"
undercloud_install_log: "{{ working_dir }}/undercloud_install.log"
undercloud_repos_conf_script: undercloud-repos-conf.sh.j2
undercloud_repos_conf_log: "{{ working_dir }}/undercloud_repos_conf.log"
overcloud_images_script: overcloud-images.sh.j2
overcloud_images_log: "{{ working_dir }}/overcloud_images.log"
@ -19,5 +16,5 @@ undercloud_network_cidr: 192.0.2.0/24
step_provide_undercloud: true
step_prepare_undercloud: true
step_install_undercloud: true
step_undercloud_repos: true
step_overcloud_images: true

View File

@ -1,2 +0,0 @@
---
# handlers file for ansible-role-tripleo-baremetal-undercloud

View File

@ -1,173 +0,0 @@
galaxy_info:
author: your name
description:
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If travis integration is cofigured, only notification for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# Below are all platforms currently available. Just uncomment
# the ones that apply to your role. If you don't see your
# platform on this list, let us know and we'll get it added!
#
#platforms:
#- name: EL
# versions:
# - all
# - 5
# - 6
# - 7
#- name: GenericUNIX
# versions:
# - all
# - any
#- name: Solaris
# versions:
# - all
# - 10
# - 11.0
# - 11.1
# - 11.2
# - 11.3
#- name: Fedora
# versions:
# - all
# - 16
# - 17
# - 18
# - 19
# - 20
# - 21
# - 22
# - 23
#- name: opensuse
# versions:
# - all
# - 12.1
# - 12.2
# - 12.3
# - 13.1
# - 13.2
#- name: IOS
# versions:
# - all
# - any
#- name: SmartOS
# versions:
# - all
# - any
#- name: eos
# versions:
# - all
# - Any
#- name: Windows
# versions:
# - all
# - 2012R2
#- name: Amazon
# versions:
# - all
# - 2013.03
# - 2013.09
#- name: GenericBSD
# versions:
# - all
# - any
#- name: Junos
# versions:
# - all
# - any
#- name: FreeBSD
# versions:
# - all
# - 10.0
# - 10.1
# - 10.2
# - 8.0
# - 8.1
# - 8.2
# - 8.3
# - 8.4
# - 9.0
# - 9.1
# - 9.1
# - 9.2
# - 9.3
#- name: Ubuntu
# versions:
# - all
# - lucid
# - maverick
# - natty
# - oneiric
# - precise
# - quantal
# - raring
# - saucy
# - trusty
# - utopic
# - vivid
# - wily
# - xenial
#- name: SLES
# versions:
# - all
# - 10SP3
# - 10SP4
# - 11
# - 11SP1
# - 11SP2
# - 11SP3
#- name: GenericLinux
# versions:
# - all
# - any
#- name: NXOS
# versions:
# - all
# - any
#- name: Debian
# versions:
# - all
# - etch
# - jessie
# - lenny
# - sid
# - squeeze
# - stretch
# - wheezy
galaxy_tags: []
# List tags for your role here, one per line. A tag is
# a keyword that describes and categorizes the role.
# Users find roles by searching for tags. Be sure to
# remove the '[]' above if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of
# alphanumeric characters. Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line.
# Be sure to remove the '[]' above if you add dependencies
# to this list.

View File

@ -1,4 +1,5 @@
---
# Provision and initial undercloud setup
- name: Baremetal undercloud install
hosts: localhost
roles:
@ -6,40 +7,93 @@
tags:
- undercloud-bm-install
- name: Inventory the undercloud
# Machine at this point is provided
- name: Add the undercloud node to the generated inventory
hosts: localhost
vars:
inventory: undercloud
gather_facts: yes
tags:
- undercloud-scripts
roles:
- tripleo-inventory
tags:
- undercloud-inventory
- name: Post undercloud install steps
# Deploy the undercloud
- name: Install undercloud
hosts: undercloud
gather_facts: no
tags:
- undercloud-install
roles:
- tripleo/undercloud
# Baremetal preparation (with workarounds)
- name: Prepare baremetal for the overcloud deployment
hosts: undercloud
roles:
- tripleo-undercloud-post
- overcloud-prep-baremetal
tags:
- undercloud-post-install
- overcloud-prep-baremetal
- name: Deploy the overcloud
# Prepare any additional configuration files required by the overcloud
- name: Prepare configuration files for the overcloud deployment
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-config
# Prepare the overcloud images for deployment
- name: Prepare the overcloud images for deployment
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-images
# Prepare the overcloud flavor configuration
- name: Prepare overcloud flavors
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-flavors
# Prepare the undercloud networks for the overcloud deployment
- name: Prepare the undercloud networks for the overcloud deployment
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-network
# Deploy the overcloud
- name: Deploy the overcloud
hosts: undercloud
gather_facts: yes
roles:
- tripleo-overcloud
- name: Add the overcloud nodes to the generated inventory
hosts: undercloud
gather_facts: yes
tags:
- overcloud-deploy
- name: Inventory the overcloud
hosts: undercloud
vars:
inventory: all
roles:
- tripleo-inventory
tags:
- overcloud-inventory
- name: validate the overcloud using HA tests
# Check the results of the deployment, note after inventory has executed
- name: Check the result of the deployment
hosts: localhost
tags:
- overcloud-deploy
tasks:
- name: ensure the deployment result has been read into memory
include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json"
# overcloud_deploy_result = ["failed", "passed"]
- name: did the deployment pass or fail?
debug: var=overcloud_deploy_result
failed_when: overcloud_deploy_result == "failed"
# HA Validation
- name: Validate the overcloud using HA tests
hosts: undercloud
gather_facts: no
roles:

View File

@ -1,45 +1,98 @@
---
- name: Baremetal undercloud install
# Provision and initial undercloud setup
- name: Baremetal undercloud install
hosts: localhost
roles:
- tripleo-baremetal-undercloud
tags:
- undercloud-bm-install
- name: Inventory the undercloud
# Machine at this point is provided
- name: Add the undercloud node to the generated inventory
hosts: localhost
vars:
inventory: undercloud
gather_facts: yes
tags:
- undercloud-scripts
roles:
- tripleo-inventory
tags:
- undercloud-inventory
- name: Post undercloud install steps
# Deploy the undercloud
- name: Install undercloud
hosts: undercloud
gather_facts: no
tags:
- undercloud-install
roles:
- tripleo/undercloud
# Baremetal preparation (with workarounds)
- name: Prepare baremetal for the overcloud deployment
hosts: undercloud
roles:
- tripleo-undercloud-post
- overcloud-prep-baremetal
tags:
- undercloud-post-install
- overcloud-prep-baremetal
- name: Deploy the overcloud
# Prepare any additional configuration files required by the overcloud
- name: Prepare configuration files for the overcloud deployment
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-config
# Prepare the overcloud images for deployment
- name: Prepare the overcloud images for deployment
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-images
# Prepare the overcloud flavor configuration
- name: Prepare overcloud flavors
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-flavors
# Prepare the undercloud networks for the overcloud deployment
- name: Prepare the undercloud networks for the overcloud deployment
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-network
# Deploy the overcloud
- name: Deploy the overcloud
hosts: undercloud
gather_facts: yes
roles:
- tripleo-overcloud
- name: Add the overcloud nodes to the generated inventory
hosts: undercloud
gather_facts: yes
tags:
- overcloud-deploy
- name: Inventory the overcloud
hosts: undercloud
vars:
inventory: all
roles:
- tripleo-inventory
tags:
- overcloud-inventory
- name: validate the overcloud
# Check the results of the deployment, note after inventory has executed
- name: Check the result of the deployment
hosts: localhost
tags:
- overcloud-deploy
tasks:
- name: ensure the deployment result has been read into memory
include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json"
# overcloud_deploy_result = ["failed", "passed"]
- name: did the deployment pass or fail?
debug: var=overcloud_deploy_result
failed_when: overcloud_deploy_result == "failed"
- name: Validate the overcloud
hosts: undercloud
gather_facts: no
roles:

View File

@ -22,13 +22,9 @@ setup-hooks =
data_files =
playbooks = playbooks/*
usr/local/share/ansible/roles/tripleo-baremetal-undercloud/defaults = defaults/*
usr/local/share/ansible/roles/tripleo-baremetal-undercloud/handlers = handlers/*
usr/local/share/ansible/roles/tripleo-baremetal-undercloud/meta = meta/*
usr/local/share/ansible/roles/tripleo-baremetal-undercloud/tasks = tasks/*
usr/local/share/ansible/roles/tripleo-baremetal-undercloud/templates = templates/*
usr/local/share/ansible/roles/tripleo-baremetal-undercloud/files = files/*
usr/local/share/ansible/roles/tripleo-baremetal-undercloud/tests = tests/*
usr/local/share/ansible/roles/tripleo-baremetal-undercloud/vars = vars/*
[wheel]
universal = 1

View File

@ -1,29 +1,23 @@
---
# tasks file for ansible-role-tripleo-baremetal-undercloud
# Do machine provisioning
- include: machine-provisioning.yml
tags:
- machine-provision
# Prepare machine to be used with TripleO
- include: machine-setup.yml
tags:
- machine-setup
- include: undercloud-scripts.yml
# Configure repos and packages
- include: undercloud-repos-conf.yml
delegate_to: "{{ virthost }}"
tags:
- undercloud-scripts
- include: undercloud-pre-install.yml
delegate_to: "{{ virthost }}"
tags:
- undercloud-pre-install
- include: undercloud-install.yml
delegate_to: "{{ virthost }}"
tags:
- undercloud-install
- undercloud-repos-conf
# Get overcloud images
- include: overcloud-images.yml
delegate_to: "{{ virthost }}"
tags:

View File

@ -1,3 +1,10 @@
# Copy overcloud images script
- name: Copy repositories configuration script
template:
src: "{{ overcloud_images_script }}"
dest: "{{ working_dir }}/overcloud-images.sh"
mode: 0755
- name: Overcloud images
shell: >
{{ working_dir }}/overcloud-images.sh > {{ overcloud_images_log }} 2>&1

View File

@ -1,4 +0,0 @@
- name: Install the undercloud
shell: >
{{ working_dir }}/undercloud-install.sh > {{ undercloud_install_log }} 2>&1
when: step_install_undercloud

View File

@ -1,4 +0,0 @@
- name: Preparing machine for undercloud installation
shell: >
{{ working_dir }}/undercloud-pre-install.sh > {{ undercloud_pre_install_log }} 2>&1
when: step_prepare_undercloud

View File

@ -0,0 +1,12 @@
# Copy repo configuration script
- name: Copy repositories configuration script
template:
src: "{{ undercloud_repos_conf_script }}"
dest: "{{ working_dir }}/undercloud-repos-conf.sh"
mode: 0755
- name: Execute repositories configuration script
shell: >
{{ working_dir }}/undercloud-repos-conf.sh > {{ undercloud_repos_conf_log }} 2>&1
when: step_prepare_undercloud
become: true

View File

@ -1,23 +0,0 @@
- name: Create undercloud configuration
template:
src: "{{ undercloud_config_file }}"
dest: "./undercloud.conf"
mode: 0600
- name: Create undercloud pre-install script
template:
src: "{{ undercloud_pre_install_script }}"
dest: "{{ working_dir }}/undercloud-pre-install.sh"
mode: 0755
- name: Create undercloud install script
template:
src: "{{ undercloud_install_script }}"
dest: "{{ working_dir }}/undercloud-install.sh"
mode: 0755
- name: Create overcloud image generation script
template:
src: "{{ overcloud_images_script }}"
dest: "{{ working_dir }}/overcloud-images.sh"
mode: 0755

View File

@ -1,17 +1,31 @@
#!/bin/bash
# Prepare overcloud images
set -eux
# Retrieving images
### --start_docs
## Prepare the images to be used in the overcloud
## ==============================================
## Prepare the images
## ------------------
## * Retrieve images from the known urls
## ::
wget "{{ overcloud_image_url }}"
wget "{{ ipa_image_url }}"
for i in *.tar; do
tar xvfp $i
done
# Checking libvirtd"
## * Ensure libvirtd is started (otherwise virt-customize won't work
## ::
sudo systemctl restart libvirtd
# Changing root password of the overcloud
## * Change root password on the image
## ::
virt-customize -a overcloud-full.qcow2 --root-password password:redhat
### --stop_docs

View File

@ -1,10 +0,0 @@
#!/bin/bash
# Run the undercloud install
set -eux
{% for var in (undercloud_env_vars|default([])) %}
export {{ var }}
{% endfor %}
openstack undercloud install

View File

@ -1,47 +0,0 @@
#!/bin/bash
# Prepare undercloud repos
set -eux
# Adding static hostname into /etc/hosts
sudo sh -c 'echo "{{ registered_undercloud_ip.stdout }} $(hostname -f)" >> /etc/hosts'
# SELinux
sudo setenforce 0
sudo sed -i -e 's/^SELINUX.*/SELINUX=permissive/g' /etc/sysconfig/selinux
# Firewall
sudo systemctl disable firewalld
# Packages
sudo yum install -y ntp ntpdate vim tmux openssl wget bind-utils net-tools git lftp libguestfs-tools sos
# Time
sudo yum erase -y chrony
sudo rm -f /etc/chrony*
sudo sed -i s'/^server.*//' /etc/ntp.conf
sudo sh -c 'echo "server clock.redhat.com iburst" >> /etc/ntp.conf'
sudo sh -c 'echo clock.redhat.com > /etc/ntp/step-tickers'
sudo sh -c 'echo "SYNC_HWCLOCK=yes" >> /etc/sysconfig/ntpdate'
sudo systemctl enable ntpdate
sudo systemctl enable ntpd
# Repos
#sudo curl -o /etc/yum.repos.d/delorean.repo http://trunk.rdoproject.org/centos7-{{ release }}/current-passed-ci/delorean.repo
sudo curl -o /etc/yum.repos.d/delorean.repo http://buildlogs.centos.org/centos/7/cloud/x86_64/rdo-trunk-{{ release }}-tested/delorean.repo
sudo curl -o /etc/yum.repos.d/delorean-deps.repo http://trunk.rdoproject.org/centos7-{{ release }}/delorean-deps.repo
{% if release == 'liberty' %}
# (trown) Install ironic-python-agent from mitaka delorean for LIO support.
# We either need to do that or include tgt from EPEL, and upstream
# ironic-python-agent project does not actually even gate the stable branch.
# I am working on getting them to remove the stable branch, which will give us
# LIO support in liberty delorean.
sudo yum install -y http://trunk.rdoproject.org/centos7/55/17/5517b8e9aea3ded1052209384b4194d2caa97541_673a78a2/openstack-ironic-python-agent-1.1.1-dev6.el7.centos.noarch.rpm http://trunk.rdoproject.org/centos7/55/17/5517b8e9aea3ded1052209384b4194d2caa97541_673a78a2/python2-ironic-python-agent-1.1.1-dev6.el7.centos.noarch.rpm
{% endif %}
sudo yum update -y
# Tripleo packages
sudo yum install -y yum-plugin-priorities
sudo yum install -y python-tripleoclient

View File

@ -0,0 +1,53 @@
#!/bin/bash
set -eux
### --start_docs
## Prepare repos and packages on the undercloud
## ============================================
## Prepare repos and packages
## --------------------------
## * Install base and useful packages.
## ::
yum install -y ntp ntpdate vim tmux openssl wget bind-utils net-tools git lftp libguestfs-tools sos
## * Fix time issues with ntp.
## ::
yum erase -y chrony
rm -f /etc/chrony*
sed -i s'/^server.*//' /etc/ntp.conf
sh -c 'echo "server clock.redhat.com iburst" >> /etc/ntp.conf'
sh -c 'echo clock.redhat.com > /etc/ntp/step-tickers'
sh -c 'echo "SYNC_HWCLOCK=yes" >> /etc/sysconfig/ntpdate'
ntpdate clock.redhat.com
systemctl enable ntpdate
systemctl enable ntpd
systemctl start ntpd
## * Configure repos.
## ::
#curl -o /etc/yum.repos.d/delorean.repo http://trunk.rdoproject.org/centos7-{{ release }}/current-passed-ci/delorean.repo
curl -o /etc/yum.repos.d/delorean.repo http://buildlogs.centos.org/centos/7/cloud/x86_64/rdo-trunk-{{ release }}-tested/delorean.repo
curl -o /etc/yum.repos.d/delorean-deps.repo http://trunk.rdoproject.org/centos7-{{ release }}/delorean-deps.repo
{% if release == 'liberty' %}
# (trown) Install ironic-python-agent from mitaka delorean for LIO support.
# We either need to do that or include tgt from EPEL, and upstream
# ironic-python-agent project does not actually even gate the stable branch.
# I am working on getting them to remove the stable branch, which will give us
# LIO support in liberty delorean.
yum install -y http://trunk.rdoproject.org/centos7/55/17/5517b8e9aea3ded1052209384b4194d2caa97541_673a78a2/openstack-ironic-python-agent-1.1.1-dev6.el7.centos.noarch.rpm http://trunk.rdoproject.org/centos7/55/17/5517b8e9aea3ded1052209384b4194d2caa97541_673a78a2/python2-ironic-python-agent-1.1.1-dev6.el7.centos.noarch.rpm
{% endif %}
## * Install TripleO packages.
## ::
yum install -y yum-plugin-priorities
yum install -y python-tripleoclient
### --stop_docs

View File

@ -1,335 +0,0 @@
[DEFAULT]
#
# From instack-undercloud
#
# Local file path to the necessary images. The path should be a
# directory readable by the current user that contains the full set of
# images. (string value)
{% if undercloud_image_path is defined %}
image_path = {{undercloud_image_path}}
{% else %}
#image_path = .
{% endif %}
# Fully qualified hostname (including domain) to set on the
# Undercloud. If left unset, the current hostname will be used, but
# the user is responsible for configuring all system hostname settings
# appropriately. If set, the undercloud install will configure all
# system hostname settings. (string value)
{% if undercloud_undercloud_hostname is defined %}
undercloud_hostname = {{undercloud_undercloud_hostname}}
{% else %}
#undercloud_hostname = <None>
{% endif %}
# Network CIDR for the Neutron-managed network for Overcloud
# instances. This should be the subnet used for PXE booting. (string
# value)
network_cidr = {{undercloud_network_cidr}}
# IP information for the interface on the Undercloud that will be
# handling the PXE boots and DHCP for Overcloud instances. The IP
# portion of the value will be assigned to the network interface
# defined by local_interface, with the netmask defined by the prefix
# portion of the value. (string value)
local_ip = {{undercloud_local_ip|default(
'%s/%s' % (undercloud_network_cidr|nthhost(1),
undercloud_network_cidr.split('/').1))}}
# Network gateway for the Neutron-managed network for Overcloud
# instances. This should match the local_ip above when using
# masquerading. (string value)
network_gateway = {{undercloud_network_gateway|default(
undercloud_network_cidr|nthhost(1))}}
# Virtual IP address to use for the public endpoints of Undercloud
# services. Only used if undercloud_service_certficate is set.
# (string value)
{% if undercloud_undercloud_public_vip is defined %}
undercloud_public_vip = {{undercloud_undercloud_public_vip}}
{% else %}
#undercloud_public_vip = 192.0.2.2
{% endif %}
# Virtual IP address to use for the admin endpoints of Undercloud
# services. Only used if undercloud_service_certficate is set.
# (string value)
{% if undercloud_undercloud_admin_vip is defined %}
undercloud_admin_vip = {{undercloud_undercloud_admin_vip}}
{% else %}
#undercloud_admin_vip = 192.0.2.3
{% endif %}
# Certificate file to use for OpenStack service SSL connections.
# Setting this enables SSL for the OpenStack API endpoints, leaving it
# unset disables SSL. (string value)
#undercloud_service_certificate =
# Network interface on the Undercloud that will be handling the PXE
# boots and DHCP for Overcloud instances. (string value)
{% if undercloud_local_interface is defined %}
local_interface = {{undercloud_local_interface}}
{% else %}
#local_interface = eth1
{% endif %}
# Network that will be masqueraded for external access, if required.
# This should be the subnet used for PXE booting. (string value)
masquerade_network = {{undercloud_masquerade_network|default(
undercloud_network_cidr)}}
# Start of DHCP allocation range for PXE and DHCP of Overcloud
# instances. (string value)
dhcp_start = {{undercloud_dhcp_start|default(
undercloud_network_cidr|nthhost(5))}}
# End of DHCP allocation range for PXE and DHCP of Overcloud
# instances. (string value)
dhcp_end = {{undercloud_dhcp_end|default(
undercloud_network_cidr|nthhost(30))}}
# Network interface on which inspection dnsmasq will listen. If in
# doubt, use the default value. (string value)
# Deprecated group/name - [DEFAULT]/discovery_interface
{% if undercloud_inspection_interface is defined %}
inspection_interface = {{undercloud_inspection_interface}}
{% else %}
#inspection_interface = br-ctlplane
{% endif %}
# Temporary IP range that will be given to nodes during the inspection
# process. Should not overlap with the range defined by dhcp_start
# and dhcp_end, but should be in the same network. (string value)
# Deprecated group/name - [DEFAULT]/discovery_iprange
inspection_iprange = {{undercloud_inspection_iprange|default(
'%s,%s' % (undercloud_network_cidr|nthhost(100),
undercloud_network_cidr|nthhost(120)))}}
# Whether to run benchmarks when inspecting nodes. (boolean value)
# Deprecated group/name - [DEFAULT]/discovery_runbench
{% if undercloud_inspection_runbench is defined %}
inspection_runbench = {{undercloud_inspection_runbench}}
{% else %}
#inspection_runbench = false
{% endif %}
# Whether to enable the debug log level for Undercloud OpenStack
# services. (boolean value)
{% if undercloud_undercloud_debug is defined %}
undercloud_debug = {{undercloud_undercloud_debug}}
{% else %}
#undercloud_debug = true
{% endif %}
# Whether to install Tempest in the Undercloud. (boolean value)
{% if undercloud_enable_tempest is defined %}
enable_tempest = {{undercloud_enable_tempest}}
{% else %}
#enable_tempest = true
{% endif %}
# Whether to install Mistral in the Undercloud. (boolean value)
{% if undercloud_enable_mistral is defined %}
enable_mistral = {{undercloud_enable_mistral}}
{% else %}
#enable_mistral = false
{% endif %}
# Whether to use iPXE for deploy by default. (boolean value)
{% if undercloud_ipxe_deploy is defined %}
ipxe_deploy = {{undercloud_ipxe_deploy}}
{% else %}
#ipxe_deploy = true
{% endif %}
# Whether to install Monitoring services in the Undercloud. (boolean
# value)
{% if undercloud_enable_monitoring is defined %}
enable_monitoring = {{undercloud_enable_monitoring}}
{% else %}
#enable_monitoring = false
{% endif %}
[auth]
#
# From instack-undercloud
#
# Password used for MySQL databases. If left unset, one will be
# automatically generated. (string value)
{% if undercloud_undercloud_db_password is defined %}
undercloud_db_password = {{undercloud_undercloud_db_password}}
{% else %}
#undercloud_db_password = <None>
{% endif %}
# Keystone admin token. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_admin_token is defined %}
undercloud_admin_token = {{undercloud_undercloud_admin_token}}
{% else %}
#undercloud_admin_token = <None>
{% endif %}
# Keystone admin password. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_admin_password is defined %}
undercloud_admin_password = {{undercloud_undercloud_admin_password}}
{% else %}
#undercloud_admin_password = <None>
{% endif %}
# Glance service password. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_glance_password is defined %}
undercloud_glance_password = {{undercloud_undercloud_glance_password}}
{% else %}
#undercloud_glance_password = <None>
{% endif %}
# Heat db encryption key(must be 16, 24, or 32 characters. If left
# unset, one will be automatically generated. (string value)
{% if undercloud_undercloud_heat_encryption_key is defined %}
undercloud_heat_encryption_key = {{undercloud_undercloud_heat_encryption_key}}
{% else %}
#undercloud_heat_encryption_key = <None>
{% endif %}
# Heat service password. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_heat_password is defined %}
undercloud_heat_password = {{undercloud_undercloud_heat_password}}
{% else %}
#undercloud_heat_password = <None>
{% endif %}
# Neutron service password. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_neutron_password is defined %}
undercloud_neutron_password = {{undercloud_undercloud_neutron_password}}
{% else %}
#undercloud_neutron_password = <None>
{% endif %}
# Nova service password. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_nova_password is defined %}
undercloud_nova_password = {{undercloud_undercloud_nova_password}}
{% else %}
#undercloud_nova_password = <None>
{% endif %}
# Ironic service password. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_ironic_password is defined %}
undercloud_ironic_password = {{undercloud_undercloud_ironic_password}}
{% else %}
#undercloud_ironic_password = <None>
{% endif %}
# Ceilometer service password. If left unset, one will be
# automatically generated. (string value)
{% if undercloud_undercloud_ceilometer_password is defined %}
undercloud_ceilometer_password = {{undercloud_undercloud_ceilometer_password}}
{% else %}
#undercloud_ceilometer_password = <None>
{% endif %}
# Aodh service password. If left unset, one will be
# automatically generated. (string value)
{% if undercloud_undercloud_aodh_password is defined %}
undercloud_aodh_password = {{undercloud_undercloud_aodh_password}}
{% else %}
#undercloud_aodh_password = <None>
{% endif %}
# Sensu service password. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_sensu_password is defined %}
undercloud_sensu_password = {{undercloud_undercloud_sensu_password}}
{% else %}
#undercloud_sensu_password = <None>
{% endif %}
# Ceilometer metering secret. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_ceilometer_metering_secret is defined %}
undercloud_ceilometer_metering_secret = {{undercloud_undercloud_ceilometer_metering_secret}}
{% else %}
#undercloud_ceilometer_metering_secret = <None>
{% endif %}
# Ceilometer snmpd user. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_ceilometer_snmpd_user is defined %}
undercloud_ceilometer_snmpd_user = {{undercloud_undercloud_ceilometer_snmpd_user}}
{% else %}
#undercloud_ceilometer_snmpd_user = <None>
{% endif %}
# Ceilometer snmpd password. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_ceilometer_snmpd_password is defined %}
undercloud_ceilometer_snmpd_password = {{undercloud_undercloud_ceilometer_snmpd_password}}
{% else %}
#undercloud_ceilometer_snmpd_password = <None>
{% endif %}
# Swift service password. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_swift_password is defined %}
undercloud_swift_password = {{undercloud_undercloud_swift_password}}
{% else %}
#undercloud_swift_password = <None>
{% endif %}
# Mistral service password. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_mistral_password is defined %}
undercloud_mistral_password = {{undercloud_undercloud_mistral_password}}
{% else %}
#undercloud_mistral_password = <None>
{% endif %}
# Rabbitmq cookie. If left unset, one will be automatically generated.
# (string value)
{% if undercloud_undercloud_rabbit_cookie is defined %}
undercloud_rabbit_cookie = {{undercloud_undercloud_rabbit_cookie}}
{% else %}
#undercloud_rabbit_cookie = <None>
{% endif %}
# Rabbitmq password. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_rabbit_password is defined %}
undercloud_rabbit_password = {{undercloud_undercloud_rabbit_password}}
{% else %}
#undercloud_rabbit_password = <None>
{% endif %}
# Rabbitmq username. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_rabbit_username is defined %}
undercloud_rabbit_username = {{undercloud_undercloud_rabbit_username}}
{% else %}
#undercloud_rabbit_username = <None>
{% endif %}
# Heat stack domain admin password. If left unset, one will be
# automatically generated. (string value)
{% if undercloud_undercloud_heat_stack_domain_admin_password is defined %}
undercloud_heat_stack_domain_admin_password = {{undercloud_undercloud_heat_stack_domain_admin_password}}
{% else %}
#undercloud_heat_stack_domain_admin_password = <None>
{% endif %}
# Swift hash suffix. If left unset, one will be automatically
# generated. (string value)
{% if undercloud_undercloud_swift_hash_suffix is defined %}
undercloud_swift_hash_suffix = {{undercloud_undercloud_swift_hash_suffix}}
{% else %}
#undercloud_swift_hash_suffix = <None>
{% endif %}

View File

@ -1 +0,0 @@
localhost

View File

@ -1,5 +0,0 @@
---
- hosts: localhost
remote_user: root
roles:
- ansible-role-tripleo-baremetal-undercloud

View File

@ -1,2 +0,0 @@
---
# vars file for ansible-role-tripleo-baremetal-undercloud