Adds toci playbooks and updates for new multinode mixed OS jobs

This adds some new playbooks to be used by the new multinode mixed
os job (See topic at [1] for related reviews). Also updates the
extras-common and undercloud-deploy roles to allow the mixed-os
job to use the correct content provider.

[1] https://review.opendev.org/q/topic:oooci_mixed_rhel

Change-Id: Ie7a95056bfb0a90d2e6fb6e5ec9c8ed66f8ef31e
This commit is contained in:
Marios Andreou 2022-05-13 17:34:04 +03:00
parent ff64ea937c
commit abc50905fa
7 changed files with 226 additions and 1 deletions

View File

@ -0,0 +1,76 @@
---
- name: Rerun container image prepare for mixed OS compute deployment
hosts: undercloud
gather_facts: false
tags:
- overcloud-prep-containers
pre_tasks:
# TODO(marios): tidy this up use copy module & move to new play
- name: rename controller logfiles so we can keep them
shell: |
for file in containers-prepare-parameter.yaml overcloud_deploy.log overcloud_roles.yaml overcloud-topology-config.yaml overcloud-deploy.sh ; do
cp $file "ctrl_$file";
done
failed_when: false
roles:
- role: overcloud-prep-containers
when: containerized_overcloud|bool
tasks:
- name: "set fact for container_build_id with {{ docker_image_tag }}"
set_fact:
container_build_id: "{{ dlrn_hash_tag }}"
cacheable: true
- name: "Recreate containers-prepare-parameter file "
include_role:
name: undercloud-deploy
tasks_from: create-scripts.yml
- name: Run container image prepare for compute deploy
shell: |
source /home/zuul/stackrc
sudo openstack tripleo container image prepare -e /home/zuul/containers-prepare-parameter.yaml
- name: Deploy the overcloud compute stack
hosts: undercloud
gather_facts: false
environment:
TRIPLEO_ROOT: "{{ lookup('env','TRIPLEO_ROOT') }}"
tasks:
- name: Deploy the overcloud
include_role:
name: overcloud-deploy
vars:
overcloud_roles: "{{ overcloud_roles_compute }}"
topology_map: "{{ topology_map_compute }}"
extra_args: " -e /home/zuul/overcloud-deploy/overcloud/overcloud-export.yaml --disable-protected-resource-types --baremetal-deployment "
tags:
- overcloud-deploy
- name: Check the overcloud_deployment_result.json if this is CI job
tags:
- overcloud-deploy
block:
- name: ensure the deployment result has been read into memory
include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json"
delegate_to: localhost
# overcloud_deploy_result = ["failed", "passed"]
- name: did the deployment pass or fail?
debug: var=overcloud_deploy_result
failed_when: overcloud_deploy_result == "failed"
delegate_to: localhost
- name: nova cell_v2 discover_hosts on Controller after Compute deployment
hosts: overcloud_control
tags:
- overcloud-deploy
tasks:
- name: Run nova-manage cell_v2 discover_hosts
shell: |
sudo podman exec nova_api nova-manage cell_v2 discover_hosts --by-service --verbose
- name: DEBUG nova-manage cell_v2 list_hosts
shell: |
sudo podman exec nova_api nova-manage cell_v2 list_hosts
register: nova_manage_cell_debug
- name: debug nova-manage output
debug:
msg: "DEBUG output of cell_v2 list_hosts after discovery {{ nova_manage_cell_debug.stdout_lines }}"

View File

@ -0,0 +1,30 @@
---
- name: Deploy the overcloud control stack
hosts: undercloud
gather_facts: false
environment:
TRIPLEO_ROOT: "{{ lookup('env','TRIPLEO_ROOT') }}"
tasks:
- name: Deploy the overcloud
include_role:
name: overcloud-deploy
vars:
overcloud_roles: "{{ overcloud_roles_control }}"
topology_map: "{{ topology_map_control }}"
extra_args: " --disable-protected-resource-types --baremetal-deployment "
tags:
- overcloud-deploy
- name: Check the overcloud_deployment_result.json if this is CI job
tags:
- overcloud-deploy
block:
- name: ensure the deployment result has been read into memory
include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json"
delegate_to: localhost
# overcloud_deploy_result = ["failed", "passed"]
- name: did the deployment pass or fail?
debug: var=overcloud_deploy_result
failed_when: overcloud_deploy_result == "failed"
delegate_to: localhost

View File

@ -0,0 +1,32 @@
---
- name: Add the overcloud nodes to the generated inventory
hosts: undercloud
gather_facts: true
tags:
- overcloud-deploy
vars:
inventory: multinode_mixed_os
roles:
- tripleo-inventory
- name: Create configs on subnodes
hosts: overcloud_compute
roles:
- 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
- name: Run atop on overcloud node if configured
include_role:
name: undercloud-setup
tasks_from: atop
tags:
- undercloud-setup

View File

@ -0,0 +1,69 @@
---
- name: Add the overcloud nodes to the generated inventory
hosts: undercloud
gather_facts: true
tags:
- overcloud-deploy
vars:
inventory: multinode_mixed_os
roles:
- tripleo-inventory
- name: Create configs on subnodes
hosts: overcloud_control
roles:
- 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
- name: Run atop on overcloud node if configured
include_role:
name: undercloud-setup
tasks_from: atop
tags:
- undercloud-setup
- name: Prepare the undercloud for installation
hosts: undercloud
roles:
- undercloud-setup
tags:
- undercloud-setup
- name: Install built packages on subnodes
hosts: overcloud_control
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: Validate the undercloud
hosts: undercloud
roles:
- validate-undercloud
- name: Set Libvirt type
hosts: overcloud
roles:
- set-libvirt-type
tags:
- overcloud-deploy

View File

@ -189,7 +189,7 @@
tempest_public_subnet_gateway_ip: '{{ tempest_cidr|nthhost(1) }}'
tempest_public_subnet_allocation_pools: '{{ tempest_cidr|nthhost(150) ~ "-" ~ tempest_cidr|nthhost(200) }}'
tempest_private_net_seg_id: "{{ (release in ['queens']) | ternary('', omit) }}"
tempest_network_ping_gateway: true
tempest_network_ping_gateway: "{{ tempest_ping_router|default(true)|bool }}"
tempest_private_net_provider_type: "{{ (release in ['queens']) | ternary('vlan', 'geneve') }}"
tempest_private_net_create: true
tempest_router_create: true

View File

@ -36,7 +36,12 @@ overcloud_container_cli: podman
local_docker_registry_host: "{{ undercloud_network_gateway|default(undercloud_network_cidr|nthhost(1)) }}"
docker_registry_host: >-
{% if job.consumer_job | default(false) | bool -%}
{% if registry_distro is defined and
registry_distro | default('') | length > 0 -%}
{{ job.registry_ip_address_distro[registry_distro] }}:{{ local_registry_port }}
{%- else -%}
{{ job.registry_ip_address_branch[release] }}:{{ local_registry_port }}
{%- endif -%}
{%- else -%}
docker.io
{%- endif -%}
@ -66,7 +71,12 @@ docker_ceph_namespace: >-
{% if job is defined and job.docker_ceph_namespace is defined -%}
{{ job.docker_ceph_namespace }}
{%- elif job.consumer_job | default(false) | bool -%}
{%- if registry_distro is defined and
registry_distro | default('') | length > 0 -%}
{{ job.registry_ip_address_distro[registry_distro] }}:{{ local_registry_port }}/{{ docker_registry_namespace }}
{%- else -%}
{{ job.registry_ip_address_branch[release] }}:{{ local_registry_port }}/{{ docker_registry_namespace }}
{%- endif -%}
{%- elif release in ['train','victoria'] -%}
quay.io/ceph
{%- else -%}

View File

@ -5,7 +5,11 @@ parameter_defaults:
- {{ local_registry_ip }}:{{ local_registry_port }}
{% endif %}
{% if job.consumer_job | default(false) | bool %}
{% if registry_distro is defined and registry_distro | default('') | length > 0 %}
- {{ job.registry_ip_address_distro[registry_distro] }}:{{ local_registry_port }}
{% else %}
- {{ job.registry_ip_address_branch[release] }}:{{ local_registry_port }}
{% endif %}
{% else %}
- quay.io
{% endif %}
@ -42,7 +46,11 @@ parameter_defaults:
set:
tag: "{{ container_build_id }}"
{% if job.consumer_job | default(false) | bool %}
{% if registry_distro is defined and registry_distro | default('') | length > 0 %}
namespace: "{{ job.registry_ip_address_distro[registry_distro] }}:{{ local_registry_port }}/{{ docker_registry_namespace_used }}"
{% else %}
namespace: "{{ job.registry_ip_address_branch[release] }}:{{ local_registry_port }}/{{ docker_registry_namespace_used }}"
{% endif %}
{% else %}
namespace: "{{ docker_registry_host }}/{{ docker_registry_namespace_used }}"
{% endif %}