c1959707db
- octavia_controller_post_config: remove "ignore_errors: true". It's not supposed to be needed, since there is already a "failed_when: config_contents.rc != 0" which knows when to fail. - octavia_undercloud, tripleo_cellv2, tripleo_ceph_common, tripleo_container_manage, tripleo_packages and tripleo_puppet_cache: replace "ignore_errors: true" by "failed_when: false" for debugging experience. We know the tasks can fail and we don't care, let's just not show them as failures in that case and force the task to never fail. - tripleo_podman: instead of ignoring errors, check if the config file actually exists before wipping it out. Change-Id: Ib3716e4823735a9db9bd3cac33b8daf0e5f3d186
38 lines
1.4 KiB
YAML
38 lines
1.4 KiB
YAML
---
|
|
# Copyright 2019 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: Check if cell exist
|
|
block:
|
|
- name: Fail if cell_name or containercli are not passed
|
|
fail: msg="Both tripleo_cellv2_cell_name and tripleo_cellv2_containercli are mandatory parameters!"
|
|
when: tripleo_cellv2_cell_name is not defined or tripleo_cellv2_containercli is not defined
|
|
- name: Check if cell is already created
|
|
become: true
|
|
shell: |-
|
|
set -o pipefail
|
|
{{ tripleo_cellv2_containercli }} exec -i -u root nova_api \
|
|
nova-manage {{ (tripleo_cellv2_debug | bool) | ternary('--debug', '') }} \
|
|
cell_v2 list_cells | grep {{ tripleo_cellv2_cell_name }}
|
|
failed_when: false
|
|
register: cell_check_result
|
|
- name: Fail if cell already exist
|
|
fail: msg="Cell with name {{ tripleo_cellv2_cell_name }} already exist!"
|
|
when: cell_check_result.rc == 0
|
|
tags:
|
|
- check
|
|
- extract
|
|
- create
|