tripleo-ansible/tripleo_ansible/ansible_plugins/tests/molecule/tripleo_strategies/tripleo-linear.yml

41 lines
1.4 KiB
YAML

---
# Copyright 2020 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: Run a first play with tests for the tripleo_linear strategy
hosts: all
any_errors_fatal: true
gather_facts: false
strategy: tripleo_linear
tasks:
- name: Run a task that will fail on one host
debug:
msg: "Task running with tripleo_linear strategy with max_fail_percentage set to {{ max_fail_percentage|default('undefined') }}"
failed_when:
- ansible_host in ['instance5']
- name: Run a task after a potential failure on a node
debug:
msg: "Task running on {{ ansible_host }} after a potential failure"
- name: Run a second play with tests for the tripleo_linear strategy
hosts: all
any_errors_fatal: true
gather_facts: false
strategy: tripleo_linear
tasks:
- name: Run a task on a node
debug:
msg: "Task running on {{ ansible_host }}"