Skip to content

Instantly share code, notes, and snippets.

@fcharlier
Last active March 2, 2020 16:03
Show Gist options
  • Save fcharlier/7fee2c6ab7e964377e5964095586da22 to your computer and use it in GitHub Desktop.
Save fcharlier/7fee2c6ab7e964377e5964095586da22 to your computer and use it in GitHub Desktop.
---
username: FIXME_rhsm_username
password: FIXME_rhsm_password
autosubscribe: yes
---
- name: Install the RPM that InfraRed depends on
package:
name:
- git
- python-virtualenv
state: present
become: True
tags:
- infrared
- clean
- name: Wipe any existing infrared virtualenv
file:
path: ~/infrared
state: absent
tags:
- infrared
- clean
- name: Wipe any existing infrared workspaces
file:
path: ~/.infrared
state: absent
tags:
- infrared
- clean
- name: Pull the latest InfraRed version
git:
repo: https://github.com/fcharlier/infrared.git
dest: ~/infrared
version: fc/osp15_dci
depth: 1
tags:
- infrared
- clean
- name: Wipe any existing InfraRed virtualenv
file:
path: ~/infrared/.venv
state: absent
tags:
- infrared
- clean
- name: Install InfraRed in a fresh virtualenv
shell: |
cd ~/infrared
virtualenv .venv && source .venv/bin/activate
pip install --upgrade pip
pip install --upgrade setuptools
pip install .
tags:
- infrared
- clean
#- name: Enable the InfraRed plugins that we will use during the deployment
# shell: |
# cd ~/infrared
# source .venv/bin/activate
# infrared plugin add plugins/virsh
# infrared plugin add plugins/tripleo-undercloud
# infrared plugin add plugins/tripleo-overcloud
- name: Clean the hypervisor
shell: |
cd ~/infrared
source .venv/bin/activate
infrared virsh \
--host-address 192.168.122.1 \
--host-key $HOME/.ssh/id_rsa \
--cleanup True
tags:
- infrared
- clean
---
- set_fact:
release: '{{ hostvars.localhost.job_info.job.topic.data.releasename }}'
- set_fact:
osp_ver: '{{ dci_topic | regex_replace("OSP") }}'
- name: Prepare the hosts
vars:
image_url: >-
{% if release >= 'stein' -%}
FIXME: url for a RHEL-8 qcow2 image
{%- else -%}
FIXME: url for a RHEL-7 qcow2 image
{%- endif -%}
shell: |
cd ~/infrared
source .venv/bin/activate
infrared virsh \
--host-address 192.168.122.1 \
--host-key $HOME/.ssh/id_rsa \
--image-url "{{ image_url }}" \
--host-memory-overcommit True\
--topology-nodes undercloud:1,controller:1,compute:2
tags:
- infrared
- provision
- name: Install the undercloud
shell: |
cd ~/infrared
source .venv/bin/activate
infrared tripleo-undercloud \
--version "{{ osp_ver }}" \
--images-task rpm \
--cdn /etc/dci-openstack-agent/cdn_creds.yml \
--repos-skip-release True \
--repos-url http://{{ dci_base_ip }}/dci_repo/dci_repo.repo \
--registry-skip-puddle yes \
--registry-undercloud-skip yes \
--registry-mirror {{ dci_base_ip }}:5000 \
--registry-tag latest \
--registry-namespace "{{ 'rhosp' + osp_ver }}" \
--registry-prefix openstack-
tags:
- infrared
- undercloud
- name: Register InfraReds undercloud-0 IP
set_fact: undercloud_ip="{{ lookup('pipe', 'getent hosts undercloud-0').split()[0] }}"
- name: Workaround IPv6 connectivity issues
shell: |
cd ~/infrared
source .venv/bin/activate
infrared ssh undercloud-0 "sudo ip -6 r del default"
ignore_errors: yes
- name: Deploy the overcloud
shell: |
cd ~/infrared
source .venv/bin/activate
infrared tripleo-overcloud \
--deployment-files virt \
--version "{{ osp_ver }}" \
--introspect yes \
--tagging yes \
--deploy yes \
--containers yes \
--registry-skip-puddle yes \
--registry-undercloud-skip yes \
--registry-mirror {{ dci_base_ip }}:5000 \
--registry-tag latest \
--registry-namespace "{{ 'rhosp' + osp_ver }}" \
--registry-prefix openstack- \
--ntp-server 0.rhel.pool.ntp.org
#--vbmc-host undercloud \
when: release < 'stein'
tags:
- infrared
- overcloud
- name: Deploy the overcloud
shell: |
cd ~/infrared
source .venv/bin/activate
infrared tripleo-overcloud \
-v -o overcloud-install.yml \
--version "{{ osp_ver }}" \
--deployment-files virt \
--overcloud-templates="none" \
--overcloud-debug yes \
--network-backend geneve \
--network-protocol ipv4 \
--storage-backend lvm \
--storage-external no \
--overcloud-ssl no \
--introspect yes \
--tagging yes \
--deploy yes \
--containers yes \
--registry-skip-puddle yes \
--registry-undercloud-skip yes \
--registry-mirror {{ dci_base_ip }}:5000 \
--registry-tag latest \
--registry-namespace "{{ 'rhosp' + osp_ver }}" \
--registry-prefix openstack- \
--ntp-server 0.rhel.pool.ntp.org
when: release >= 'stein'
tags:
- infrared
- overcloud
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment