Skip to content

Commit

Permalink
Remove cifmw_adoption_osp_deploy_skip_stages for tags
Browse files Browse the repository at this point in the history
Also move ceph deployment to use an actual disk instead of block
devices.
  • Loading branch information
cescgina committed Oct 2, 2024
1 parent 13c9f55 commit bca17bf
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 174 deletions.
7 changes: 0 additions & 7 deletions hooks/playbooks/adoption_deploy_ceph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions roles/adoption_osp_deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 33 additions & 0 deletions roles/adoption_osp_deploy/tasks/config_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: >-
Expand Down
260 changes: 128 additions & 132 deletions roles/adoption_osp_deploy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
32 changes: 0 additions & 32 deletions roles/adoption_osp_deploy/tasks/prepare_undercloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}"
Expand Down
6 changes: 5 additions & 1 deletion scenarios/adoption/hci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit bca17bf

Please sign in to comment.