Merge "split multinode playbook"

This commit is contained in:
Zuul 2018-01-28 19:25:34 +00:00 committed by Gerrit Code Review
commit b1b027e4b8
6 changed files with 194 additions and 188 deletions

View File

@ -0,0 +1,47 @@
---
- name: Run overcloud prep config
hosts: undercloud
gather_facts: no
roles:
- role: overcloud-prep-config
# only run when we know we have to, save time otherwise
when: mixed_upgrade|default(false)|bool
tags:
- overcloud-prep-config
- name: Run overcloud prep roles
hosts: undercloud
gather_facts: no
roles:
- { role: overcloud-prep-images, step_overcloud_image: false, step_glance_upload: true, step_register: false }
- 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: Prepare for containerized deployment
hosts: undercloud
gather_facts: no
tags:
- overcloud-prep-containers
roles:
- role: overcloud-prep-containers
when: containerized_overcloud|bool or containerized_overcloud_upgrade|bool
- 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}

View File

@ -0,0 +1,18 @@
- name: Set up repos on subnodes for upgrading
hosts: overcloud
vars:
ib_repo_host: undercloud
roles:
- role: repo-setup
when: mixed_upgrade|default(false)|bool
- role: install-built-repo
when: hostvars['undercloud']['compressed_gating_repo'] is defined and mixed_upgrade|default(false)|bool
- name: Upgrade Tripleo
hosts: undercloud
tags:
- overcloud-upgrade
gather_facts: no
roles:
- role: overcloud-upgrade
when: containerized_overcloud_upgrade|bool

View File

@ -0,0 +1,33 @@
---
- name: Deploy the overcloud
hosts: undercloud
gather_facts: no
roles:
- overcloud-deploy
environment:
TRIPLEO_ROOT: "{{ lookup('env','TRIPLEO_ROOT') }}"
- 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}

View File

@ -0,0 +1,81 @@
---
- name: Add the overcloud nodes to the generated inventory
hosts: undercloud
gather_facts: yes
tags:
- overcloud-deploy
vars:
inventory: multinode
roles:
- tripleo-inventory
- name: Create configs on subnodes
hosts: overcloud
roles:
# When doing mixed upgrade, we need different repos on undercloud
# vs. overcloud. Rely on $UPGRADE_RELEASE together with
# bootstrap-overcloud-full-minimal.sh to setup overcloud.
- role: repo-setup
when: not mixed_upgrade|default(false)|bool
tasks:
- name: Create a clean hosts file on subnodes
copy:
dest: /etc/hosts
content: |
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
become: true
tags:
- undercloud-setup
- name: Prepare the undercloud for installation
hosts: undercloud
roles:
- undercloud-setup
tags:
- undercloud-setup
- name: Run DLRN gate role and install repo
hosts: undercloud
vars:
artg_compressed_gating_repo: "${HOME}/gating_repo.tar.gz"
roles:
- build-test-packages
- { role: install-built-repo, when: compressed_gating_repo is defined }
tags:
- build
- name: Install built packages on subnodes
hosts: overcloud
vars:
ib_repo_host: undercloud
roles:
- role: repo-setup
when: not mixed_upgrade|default(false)|bool
- role: install-built-repo
when: hostvars['undercloud']['compressed_gating_repo'] is defined and not mixed_upgrade|default(false)|bool
tags:
- build
- name: Install the undercloud
hosts: undercloud
roles:
- 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

View File

@ -0,0 +1,10 @@
---
# Validate the deployment
- name: validate the overcloud
hosts: undercloud
tags:
- overcloud-validate
gather_facts: no
roles:
- { role: validate-simple, when: test_ping|bool }
- { role: validate-tempest, when: run_tempest|bool }

View File

@ -1,190 +1,7 @@
---
- include: quickstart.yml
- name: Add the overcloud nodes to the generated inventory
hosts: undercloud
gather_facts: yes
tags:
- overcloud-deploy
vars:
inventory: multinode
roles:
- tripleo-inventory
- name: Create configs on subnodes
hosts: overcloud
roles:
# When doing mixed upgrade, we need different repos on undercloud
# vs. overcloud. Rely on $UPGRADE_RELEASE together with
# bootstrap-overcloud-full-minimal.sh to setup overcloud.
- role: repo-setup
when: not mixed_upgrade|default(false)|bool
tasks:
- name: Create a clean hosts file on subnodes
copy:
dest: /etc/hosts
content: |
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
become: true
tags:
- undercloud-setup
- name: Prepare the undercloud for installation
hosts: undercloud
roles:
- undercloud-setup
tags:
- undercloud-setup
- name: Run DLRN gate role and install repo
hosts: undercloud
vars:
artg_compressed_gating_repo: "${HOME}/gating_repo.tar.gz"
roles:
- build-test-packages
- { role: install-built-repo, when: compressed_gating_repo is defined }
tags:
- build
- name: Install built packages on subnodes
hosts: overcloud
vars:
ib_repo_host: undercloud
roles:
- role: repo-setup
when: not mixed_upgrade|default(false)|bool
- role: install-built-repo
when: hostvars['undercloud']['compressed_gating_repo'] is defined and not mixed_upgrade|default(false)|bool
tags:
- build
- name: Install the undercloud
hosts: undercloud
roles:
- 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: Run overcloud prep config
hosts: undercloud
gather_facts: no
roles:
- role: overcloud-prep-config
# only run when we know we have to, save time otherwise
when: mixed_upgrade|default(false)|bool
tags:
- overcloud-prep-config
- name: Run overcloud prep roles
hosts: undercloud
gather_facts: no
roles:
- { role: overcloud-prep-images, step_overcloud_image: false, step_glance_upload: true, step_register: false }
- 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: Prepare for containerized deployment
hosts: undercloud
gather_facts: no
tags:
- overcloud-prep-containers
roles:
- role: overcloud-prep-containers
when: containerized_overcloud|bool or containerized_overcloud_upgrade|bool
- 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}
- name: Deploy the overcloud
hosts: undercloud
gather_facts: no
roles:
- overcloud-deploy
environment:
TRIPLEO_ROOT: "{{ lookup('env','TRIPLEO_ROOT') }}"
- 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}
- name: Set up repos on subnodes for upgrading
hosts: overcloud
vars:
ib_repo_host: undercloud
roles:
- role: repo-setup
when: mixed_upgrade|default(false)|bool
- role: install-built-repo
when: hostvars['undercloud']['compressed_gating_repo'] is defined and mixed_upgrade|default(false)|bool
- name: Upgrade Tripleo
hosts: undercloud
tags:
- overcloud-upgrade
gather_facts: no
roles:
- role: overcloud-upgrade
when: containerized_overcloud_upgrade|bool
# Validate the deployment
- name: validate the overcloud
hosts: undercloud
tags:
- overcloud-validate
gather_facts: no
roles:
- { role: validate-simple, when: test_ping|bool }
- { role: validate-tempest, when: run_tempest|bool }
- include: multinode-undercloud.yml
- include: multinode-overcloud-prep.yml
- include: multinode-overcloud.yml
- include: multinode-overcloud-upgrade.yml
- include: multinode-validate.yml