Merge "Make bootstrap tasks more modular"

This commit is contained in:
Zuul 2022-05-16 17:41:55 +00:00 committed by Gerrit Code Review
commit ebbdff5ad9
2 changed files with 46 additions and 23 deletions

View File

@ -52,29 +52,8 @@
when:
- rpm_query_result.rc > 0
- name: Check required packages to bootstrap TripleO is installed
command: "rpm -q --whatprovides {{ tripleo_bootstrap_packages_bootstrap | join(' ') }}"
args:
warn: false
register: rpm_query_result
failed_when: false
- name: Deploy required packages to bootstrap TripleO
become: true
package:
name: "{{ tripleo_bootstrap_packages_bootstrap }}"
state: present
# When a node is deployed with overcloud-minimal, OVS isn't required so let's
# ignore the case where the package can't be found (e.g. missing subscription).
# https://bugzilla.redhat.com/show_bug.cgi?id=1820306
failed_when:
- (ansible_facts['distribution'] | lower) == 'redhat'
- not ansible_check_mode|bool
- (tripleo_bootstrap_packages_bootstrap_result.rc | int) == 1
- not ('No package openvswitch available.' in tripleo_bootstrap_packages_bootstrap_result.failures | default([]))
register: tripleo_bootstrap_packages_bootstrap_result
when:
- rpm_query_result.rc > 0
- name: Include packages tasks
include_tasks: packages.yml
- name: Create /var/lib/heat-config/tripleo-config-download directory for deployment data
become: true

View File

@ -0,0 +1,44 @@
---
# Copyright 2022 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Gather facts if they don't exist
setup:
gather_subset: min
when: not ansible_distribution|default(false)
- name: Check required packages to bootstrap TripleO is installed
command: "rpm -q --whatprovides {{ tripleo_bootstrap_packages_bootstrap | join(' ') }}"
args:
warn: false
register: rpm_query_result
failed_when: false
- name: Deploy required packages to bootstrap TripleO
become: true
package:
name: "{{ tripleo_bootstrap_packages_bootstrap }}"
state: present
# When a node is deployed with overcloud-minimal, OVS isn't required so let's
# ignore the case where the package can't be found (e.g. missing subscription).
# https://bugzilla.redhat.com/show_bug.cgi?id=1820306
failed_when:
- (ansible_facts['distribution'] | lower) == 'redhat'
- not ansible_check_mode|bool
- (tripleo_bootstrap_packages_bootstrap_result.rc | int) == 1
- not ('No package openvswitch available.' in tripleo_bootstrap_packages_bootstrap_result.failures | default([]))
register: tripleo_bootstrap_packages_bootstrap_result
when:
- rpm_query_result.rc > 0