From bca17bf2dc3a5f400eb07cdc6fc1428e99dd464a Mon Sep 17 00:00:00 2001 From: jgilaber Date: Mon, 30 Sep 2024 17:34:16 +0200 Subject: [PATCH] Remove cifmw_adoption_osp_deploy_skip_stages for tags Also move ceph deployment to use an actual disk instead of block devices. --- hooks/playbooks/adoption_deploy_ceph.yml | 7 - roles/adoption_osp_deploy/README.md | 2 - .../tasks/config_files.yml | 33 +++ roles/adoption_osp_deploy/tasks/main.yml | 260 +++++++++--------- .../tasks/prepare_undercloud.yml | 32 --- scenarios/adoption/hci.yml | 6 +- 6 files changed, 166 insertions(+), 174 deletions(-) diff --git a/hooks/playbooks/adoption_deploy_ceph.yml b/hooks/playbooks/adoption_deploy_ceph.yml index bd8f55aae4..6e96f0f7fe 100644 --- a/hooks/playbooks/adoption_deploy_ceph.yml +++ b/hooks/playbooks/adoption_deploy_ceph.yml @@ -17,13 +17,6 @@ - name: Deploy ceph for 17.1 deployment hosts: "{{ cifmw_target_host | default('localhost') }}" tasks: - - name: Create block devices on compute nodes using ceph playbook - ansible.builtin.command: - cmd: >- - ansible-playbook -vvvv {{ playbook_dir }}/../../playbooks/ceph.yml - -i {{ _inventory_sources | join(' -i ') }} --tags block -e cifmw_num_osds_perhost=1 - -e cifmw_ceph_target=osp-computes - - name: Gather ansible_user_dir from undercloud delegate_to: "osp-undercloud-0" ansible.builtin.setup: diff --git a/roles/adoption_osp_deploy/README.md b/roles/adoption_osp_deploy/README.md index dd40a9551f..979d825d71 100644 --- a/roles/adoption_osp_deploy/README.md +++ b/roles/adoption_osp_deploy/README.md @@ -10,8 +10,6 @@ None deployment. Defaults to `pool.ntp.org` * `cifmw_adoption_osp_deploy_repos`: (List) List of 17.1 repos to enable. Defaults to `[rhel-9-for-x86_64-baseos-eus-rpms, rhel-9-for-x86_64-appstream-eus-rpms, rhel-9-for-x86_64-highavailability-eus-rpms, openstack-17.1-for-rhel-9-x86_64-rpms, fast-datapath-for-rhel-9-x86_64-rpms, rhceph-6-tools-for-rhel-9-x86_64-rpms]` -* `cifmw_adoption_osp_deploy_skip_stages`: (String or List) Stages to skip -deploying. Can be `undercloud` or `overcloud`. * `cifmw_adoption_osp_deploy_stopper`: (String) Step at which to stop the run. See `Break point` section below for possible values. ### Break point diff --git a/roles/adoption_osp_deploy/tasks/config_files.yml b/roles/adoption_osp_deploy/tasks/config_files.yml index 08342eb40d..1b2067a50e 100644 --- a/roles/adoption_osp_deploy/tasks/config_files.yml +++ b/roles/adoption_osp_deploy/tasks/config_files.yml @@ -14,6 +14,39 @@ # License for the specific language governing permissions and limitations # under the License. +- name: Ensure controller and undercloud vms are started and reachable + vars: + _cifmw_libvirt_manager_layout: + vms: + controllers: + start: true + disk_file_name: "dummy" + osp-underclouds: + start: true + disk_file_name: "dummy" + cifmw_libvirt_manager_all_vms: >- + {%- set vms = {} -%} + {%- for vm in _vm_groups['osp-underclouds'] -%} + {%- set _ = vms.update({vm: 'osp-underclouds'}) -%} + {%- endfor -%} + {%- for vm in _vm_groups['controllers'] -%} + {%- set _ = vms.update({vm: 'controllers'}) -%} + {%- endfor -%} + {{ vms }} + ansible_libvirt_pools: {} + ansible.builtin.include_role: + name: "libvirt_manager" + tasks_from: "start_vms.yml" + apply: + delegate_to: "{{ cifmw_target_host | default('localhost') }}" + +- name: Gather ansible_user_id from undercloud + delegate_to: "osp-undercloud-0" + ansible.builtin.setup: + gather_subset: + - user_id + - user_dir + - name: Load scenario config-download vars: _config_download_path: >- diff --git a/roles/adoption_osp_deploy/tasks/main.yml b/roles/adoption_osp_deploy/tasks/main.yml index 4a06aea4dc..448b64557a 100644 --- a/roles/adoption_osp_deploy/tasks/main.yml +++ b/roles/adoption_osp_deploy/tasks/main.yml @@ -14,142 +14,138 @@ # License for the specific language governing permissions and limitations # under the License. -- name: Prepare undercloud enviornment - ansible.builtin.import_tasks: prepare_undercloud.yml - - name: Generate configuration files ansible.builtin.import_tasks: config_files.yml -- name: Group undercloud tasks +- name: Prepare undercloud enviornment + tags: + - undercloud + ansible.builtin.import_tasks: prepare_undercloud.yml + +- name: Stop before running pre undercloud hooks + tags: + - undercloud + vars: + _stage_stopper: "before_pre_hook_undercloud" + when: + - cifmw_adoption_osp_deploy_stopper is defined + - cifmw_adoption_osp_deploy_stopper in _stage_stopper + ansible.builtin.fail: + msg: "Failing on demand {{ cifmw_adoption_osp_deploy_stopper }}" + +- name: Run pre undercloud deploy hooks + tags: + - undercloud + vars: + hooks: "{{ _adoption_source_scenario.pre_uc_run | default([]) }}" + step: "pre_undercloud" + ansible.builtin.include_role: + name: run_hook + +- name: Stop before deploying undercloud + tags: + - undercloud + vars: + _stage_stopper: "before_deploy_undercloud" + when: + - cifmw_adoption_osp_deploy_stopper is defined + - cifmw_adoption_osp_deploy_stopper in _stage_stopper + ansible.builtin.fail: + msg: "Failing on demand {{ cifmw_adoption_osp_deploy_stopper }}" + +- name: Deploy undercloud + tags: + - undercloud + ansible.builtin.import_tasks: deploy_undercloud.yml + +- name: Stop after deploying undercloud + tags: + - undercloud + vars: + _stage_stopper: "after_deploy_undercloud" + when: + - cifmw_adoption_osp_deploy_stopper is defined + - cifmw_adoption_osp_deploy_stopper in _stage_stopper + ansible.builtin.fail: + msg: "Failing on demand {{ cifmw_adoption_osp_deploy_stopper }}" + +- name: Run post undercloud deploy hooks + tags: + - undercloud + vars: + hooks: "{{ _adoption_source_scenario.post_uc_run | default([]) }}" + step: "post_undercloud" + ansible.builtin.include_role: + name: run_hook + +- name: Stop after running post undercloud hooks + tags: + - undercloud + vars: + _stage_stopper: "after_post_hook_undercloud" + when: + - cifmw_adoption_osp_deploy_stopper is defined + - cifmw_adoption_osp_deploy_stopper in _stage_stopper + ansible.builtin.fail: + msg: "Failing on demand {{ cifmw_adoption_osp_deploy_stopper }}" + +- name: Overcloud preparation + tags: + - overcloud + ansible.builtin.import_tasks: prepare_overcloud.yml + +- name: Stop before running pre overcloud hooks + tags: + - overcloud vars: - _skip_tags: >- - {% if cifmw_adoption_osp_deploy_skip_stages is defined and - cifmw_adoption_osp_deploy_skip_stages is string -%} - {{ cifmw_adoption_osp_deploy_skip_stages | ansible.builtin.split(",") }} - {% elif cifmw_adoption_osp_deploy_skip_stages is defined and - cifmw_adoption_osp_deploy_skip_stages is not string and - cifmw_adoption_osp_deploy_skip_stages is iterable -%} - {{ cifmw_adoption_osp_deploy_skip_stages }} - {% else -%} - {{ [] }} - {% endif -%} - _step_name: "undercloud" + _stage_stopper: "before_pre_hook_overcloud" when: - - _step_name not in _skip_tags - block: - - name: Stop before running pre undercloud hooks - vars: - _stage_stopper: "before_pre_hook_undercloud" - when: - - cifmw_adoption_osp_deploy_stopper is defined - - cifmw_adoption_osp_deploy_stopper in _stage_stopper - ansible.builtin.fail: - msg: "Failing on demand {{ cifmw_adoption_osp_deploy_stopper }}" - - - name: Run pre undercloud deploy hooks - vars: - hooks: "{{ _adoption_source_scenario.pre_uc_run | default([]) }}" - step: "pre_undercloud" - ansible.builtin.include_role: - name: run_hook - - - name: Stop before deploying undercloud - vars: - _stage_stopper: "before_deploy_undercloud" - when: - - cifmw_adoption_osp_deploy_stopper is defined - - cifmw_adoption_osp_deploy_stopper in _stage_stopper - ansible.builtin.fail: - msg: "Failing on demand {{ cifmw_adoption_osp_deploy_stopper }}" - - - name: Deploy undercloud - ansible.builtin.import_tasks: deploy_undercloud.yml - - - name: Stop after deploying undercloud - vars: - _stage_stopper: "after_deploy_undercloud" - when: - - cifmw_adoption_osp_deploy_stopper is defined - - cifmw_adoption_osp_deploy_stopper in _stage_stopper - ansible.builtin.fail: - msg: "Failing on demand {{ cifmw_adoption_osp_deploy_stopper }}" - - - name: Run post undercloud deploy hooks - vars: - hooks: "{{ _adoption_source_scenario.post_uc_run | default([]) }}" - step: "post_undercloud" - ansible.builtin.include_role: - name: run_hook - - - name: Stop after running post undercloud hooks - vars: - _stage_stopper: "after_post_hook_undercloud" - when: - - cifmw_adoption_osp_deploy_stopper is defined - - cifmw_adoption_osp_deploy_stopper in _stage_stopper - ansible.builtin.fail: - msg: "Failing on demand {{ cifmw_adoption_osp_deploy_stopper }}" - -- name: Group overcloud tasks + - cifmw_adoption_osp_deploy_stopper is defined + - cifmw_adoption_osp_deploy_stopper in _stage_stopper + ansible.builtin.fail: + msg: "Failing on demand {{ cifmw_adoption_osp_deploy_stopper }}" + +- name: Run pre overcloud deploy hooks + tags: + - overcloud + vars: + hooks: "{{ _adoption_source_scenario.pre_oc_run | default([]) }}" + step: "pre_undercloud" + ansible.builtin.include_role: + name: run_hook + +- name: Stop before deploying the overcloud + tags: + - overcloud vars: - _skip_tags: >- - {% if cifmw_adoption_osp_deploy_skip_stages is defined and - cifmw_adoption_osp_deploy_skip_stages is string -%} - {{ cifmw_adoption_osp_deploy_skip_stages | ansible.builtin.split(",") }} - {% elif cifmw_adoption_osp_deploy_skip_stages is defined and - cifmw_adoption_osp_deploy_skip_stages is not string and - cifmw_adoption_osp_deploy_skip_stages is iterable -%} - {{ cifmw_adoption_osp_deploy_skip_stages }} - {% else -%} - {{ [] }} - {% endif -%} - _step_name: "overcloud" + _stage_stopper: "before_deploy_overcloud" when: - - _step_name not in _skip_tags - block: - - name: Overcloud preparation - ansible.builtin.import_tasks: prepare_overcloud.yml - - - name: Stop before running pre overcloud hooks - vars: - _stage_stopper: "before_pre_hook_overcloud" - when: - - cifmw_adoption_osp_deploy_stopper is defined - - cifmw_adoption_osp_deploy_stopper in _stage_stopper - ansible.builtin.fail: - msg: "Failing on demand {{ cifmw_adoption_osp_deploy_stopper }}" - - - name: Run pre overcloud deploy hooks - vars: - hooks: "{{ _adoption_source_scenario.pre_oc_run | default([]) }}" - step: "pre_undercloud" - ansible.builtin.include_role: - name: run_hook - - - name: Stop before deploying the overcloud - vars: - _stage_stopper: "before_deploy_overcloud" - when: - - cifmw_adoption_osp_deploy_stopper is defined - - cifmw_adoption_osp_deploy_stopper in _stage_stopper - ansible.builtin.fail: - msg: "Failing on demand {{ cifmw_adoption_osp_deploy_stopper }}" - - - name: Deploy overcloud - ansible.builtin.import_tasks: deploy_overcloud.yml - - - name: Stop after deploying the overcloud - vars: - _stage_stopper: "post_deploy_overcloud" - when: - - cifmw_adoption_osp_deploy_stopper is defined - - cifmw_adoption_osp_deploy_stopper in _stage_stopper - ansible.builtin.fail: - msg: "Failing on demand {{ cifmw_adoption_osp_deploy_stopper }}" - - - name: Run post overcloud deploy hooks - vars: - hooks: "{{ _adoption_source_scenario.post_oc_run | default([]) }}" - step: "post_overcloud" - ansible.builtin.include_role: - name: run_hook + - cifmw_adoption_osp_deploy_stopper is defined + - cifmw_adoption_osp_deploy_stopper in _stage_stopper + ansible.builtin.fail: + msg: "Failing on demand {{ cifmw_adoption_osp_deploy_stopper }}" + +- name: Deploy overcloud + tags: + - overcloud + ansible.builtin.import_tasks: deploy_overcloud.yml + +- name: Stop after deploying the overcloud + tags: + - overcloud + vars: + _stage_stopper: "post_deploy_overcloud" + when: + - cifmw_adoption_osp_deploy_stopper is defined + - cifmw_adoption_osp_deploy_stopper in _stage_stopper + ansible.builtin.fail: + msg: "Failing on demand {{ cifmw_adoption_osp_deploy_stopper }}" + +- name: Run post overcloud deploy hooks + tags: + - overcloud + vars: + hooks: "{{ _adoption_source_scenario.post_oc_run | default([]) }}" + step: "post_overcloud" + ansible.builtin.include_role: + name: run_hook diff --git a/roles/adoption_osp_deploy/tasks/prepare_undercloud.yml b/roles/adoption_osp_deploy/tasks/prepare_undercloud.yml index a87a28811e..5837823cfc 100644 --- a/roles/adoption_osp_deploy/tasks/prepare_undercloud.yml +++ b/roles/adoption_osp_deploy/tasks/prepare_undercloud.yml @@ -14,32 +14,6 @@ # License for the specific language governing permissions and limitations # under the License. -- name: Ensure controller and undercloud vms are started and reachable - vars: - _cifmw_libvirt_manager_layout: - vms: - controllers: - start: true - disk_file_name: "dummy" - osp-underclouds: - start: true - disk_file_name: "dummy" - cifmw_libvirt_manager_all_vms: >- - {%- set vms = {} -%} - {%- for vm in _vm_groups['osp-underclouds'] -%} - {%- set _ = vms.update({vm: 'osp-underclouds'}) -%} - {%- endfor -%} - {%- for vm in _vm_groups['controllers'] -%} - {%- set _ = vms.update({vm: 'controllers'}) -%} - {%- endfor -%} - {{ vms }} - ansible_libvirt_pools: {} - ansible.builtin.include_role: - name: "libvirt_manager" - tasks_from: "start_vms.yml" - apply: - delegate_to: "{{ cifmw_target_host | default('localhost') }}" - - name: Ensure needed logins ansible.builtin.include_tasks: login_registries.yml args: @@ -58,12 +32,6 @@ ansible.builtin.package: name: python3-tripleoclient -- name: Gather ansible_user_id from undercloud - delegate_to: "osp-undercloud-0" - ansible.builtin.setup: - gather_subset: - - user_id - - name: Ensure ci-framework-data folder is created in undercloud vars: cifmw_ci_setup_basedir: "{{ cifmw_basedir }}" diff --git a/scenarios/adoption/hci.yml b/scenarios/adoption/hci.yml index 7967ccc5e6..c2b8e11cc4 100644 --- a/scenarios/adoption/hci.yml +++ b/scenarios/adoption/hci.yml @@ -50,6 +50,8 @@ libvirt_manager_patch_layout: memory: 4 cpus: 4 disksize: 20 + extra_disks_num: 1 + extra_disks_size: 30G nets: - ocpbm - osp_trunk @@ -63,7 +65,9 @@ networking_mapper_definition_patch: group-templates: computes: network-template: - # ensure this range does not collide with osp-computes one + # ensure this range does not collide with osp-computes one, even if we + # don't create any vms for the compute group (the computes for + # greenfield jobs) we need to make sure their ip ranges do not overlap range: start: 200 length: 1