tripleo-ci/toci-quickstart/playbooks/ovb.yml

227 lines
6.1 KiB
YAML

---
- name: Add the undercloud node to the generated inventory
hosts: localhost
gather_facts: yes
roles:
- tripleo-inventory
tags:
- undercloud-scripts
- include: prepare_slave.yml
tags:
- local
- name: Set up CentOS undercloud node to run TripleO Quickstart
hosts: undercloud
gather_facts: no
roles:
- undercloud-setup
tasks:
- name: Add eth2 interface from eth2.conf
command: os-net-config -c {{ working_dir }}/eth2.conf -v
become: true
when: network_isolation|bool
- name: Check if we need to build images
set_fact:
to_build: "{{ lookup('pipe', '{{ tripleo_root }}/tripleo-ci/scripts/to_build')|default('false')|bool }}"
- name: Run DLRN gate role and install repo
hosts: undercloud
vars:
artg_compressed_gating_repo: "${HOME}/gating_repo.tar.gz"
ib_create_web_repo: "{{ to_build|bool }}"
roles:
- build-test-packages
- { role: install-built-repo, when: compressed_gating_repo is defined }
tags:
- build
- name: Get images for quickstart
hosts: undercloud
gather_facts: no
vars:
ib_repo_image_inject: "{{ not to_build|bool }}"
ib_repo_run_live: false
modify_image_vc_ram: 4096
modify_image_vc_cpu: 4
modify_image_vc_verbose: true
roles:
- { role: fetch-images, when: not to_build|bool }
- { role: repo-setup, repo_inject_image_path: "$HOME/overcloud-full.qcow2", repo_run_live: false, when: not to_build|bool }
- { role: repo-setup, repo_inject_image_path: "$HOME/ironic-python-agent.initramfs", repo_run_live: false, initramfs_image: true, when: not to_build|bool }
- { role: install-built-repo, ib_repo_image_path: "$HOME/overcloud-full.qcow2", when: compressed_gating_repo is defined and not to_build|bool }
- { role: install-built-repo, ib_repo_image_path: "$HOME/ironic-python-agent.initramfs", initramfs_image: true, when: compressed_gating_repo is defined and not to_build|bool }
# Deploy the undercloud
- name: Install undercloud
hosts: undercloud
gather_facts: no
roles:
- undercloud-deploy
tags:
- undercloud-deploy
- name: Configure tripleo-validations
hosts: undercloud
gather_facts: no
tags:
- tripleo-validations
vars:
run_tripleo_validations_setup: True
roles:
- { role: tripleo-validations,
when: run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool}
- name: Validate the undercloud
hosts: undercloud
roles:
- validate-undercloud
- name: Build images for quickstart
hosts: undercloud
gather_facts: no
roles:
- { role: build-images, when: to_build|bool }
tags:
- get-images
- images
- name: Prepare configuration files for the overcloud deployment
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-config
- name: Perpare the baremetal overcloud
hosts: undercloud
gather_facts: no
roles:
- baremetal-prep-overcloud
# Prepare the overcloud for a containerized deployment
- name: Prepare overcloud containers
hosts: undercloud
gather_facts: no
roles:
- { role: overcloud-prep-containers, when: containerized_overcloud|default(false)|bool }
# Prepare the overcloud images for deployment
- name: Prepare the overcloud images for deployment
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-images
- name: Run tripleo-validations pre-introspection tests
hosts: undercloud
gather_facts: no
tags:
- tripleo-validations
vars:
validations_group: ['pre-introspection']
roles:
- { role: tripleo-validations,
when: run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool}
- name: Remove big image
hosts: undercloud
gather_facts: no
tasks:
- name: Remove overcloud-full.qcow2
file: path=~/overcloud-full.qcow2 state=absent
# 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
- name: Prepare the SSL Configuration for the overcloud deployment
hosts: undercloud
gather_facts: no
roles:
- { role: overcloud-ssl }
- name: Run tripleo-validations pre-deployment tests
hosts: undercloud
gather_facts: no
tags:
- tripleo-validations
vars:
validations_group: ['pre-deployment']
roles:
- { role: tripleo-validations,
when: run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool}
# Deploy the overcloud
- name: Deploy the overcloud
hosts: undercloud
gather_facts: yes
roles:
- overcloud-deploy
- name: Add the overcloud nodes to the generated inventory
hosts: undercloud
gather_facts: yes
tags:
- overcloud-deploy
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-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: Run tripleo-validations post-deployment tests
hosts: undercloud
gather_facts: no
tags:
- tripleo-validations
vars:
validations_group: ['post-deployment']
roles:
- { role: tripleo-validations,
when: run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool}
# Validate the deployment
- name: validate the overcloud
hosts: undercloud
tags:
- overcloud-validate
gather_facts: no
roles:
- { role: validate-simple, when: test_ping|bool }
# Execute tempest against the overcloud deployment
- name: Execute tempest against the overcloud
hosts: undercloud
tags:
- overcloud-validate
gather_facts: no
roles:
- { role: validate-tempest, when: run_tempest|bool }
- name: Delete the overcloud
hosts: undercloud
tags:
- overcloud-delete
gather_facts: no
roles:
- { role: overcloud-delete, when: step_delete_overcloud|bool }