blob: a23944ded006530a5b1c0fc240b6ab37a31f0ffd [file] [log] [blame]
Fatih Degirmencie7995082019-03-24 20:49:21 +00001---
2# ============LICENSE_START=======================================================
3# Copyright (C) 2019 The Nordix Foundation. All rights reserved.
4# ================================================================================
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17# SPDX-License-Identifier: Apache-2.0
18# ============LICENSE_END=========================================================
19
Fatih Degirmenciedec2152019-07-27 16:21:49 +000020# check if any post-deployment task defined for the scenario
Fatih Degirmenci6e925732019-06-21 18:12:26 +000021- hosts: localhost
22 connection: local
Fatih Degirmenci87c986c2020-01-12 22:35:53 +000023 gather_facts: false
24 become: false
Fatih Degirmenci6e925732019-06-21 18:12:26 +000025
26 tasks:
Fatih Degirmenciedec2152019-07-27 16:21:49 +000027 - name: Check if any post-deployment task defined for '{{ deploy_scenario }}' scenario
Fatih Degirmenci6e925732019-06-21 18:12:26 +000028 stat:
29 path: "{{ engine_cache }}/repos/swconfig/{{ scenario[deploy_scenario].installers[installer_type].role }}/tasks/post-deployment.yml"
30 register: post_deployment_yml
31
32# run the scenario post-deployment tasks before running the common post-deployment tasks
33- hosts: all
Fatih Degirmenci87c986c2020-01-12 22:35:53 +000034 gather_facts: true
35 become: true
Fatih Degirmenci6e925732019-06-21 18:12:26 +000036
37 tasks:
Fatih Degirmenciedec2152019-07-27 16:21:49 +000038 - name: Execute post-deployment tasks of '{{ deploy_scenario }}' scenario
Fatih Degirmenci6e925732019-06-21 18:12:26 +000039 include_role:
40 name: "{{ engine_cache }}/repos/swconfig/{{ scenario[deploy_scenario].installers[installer_type].role }}"
41 tasks_from: post-deployment
Fatih Degirmenci572223c2019-12-11 13:43:10 +010042 when: hostvars['localhost'].post_deployment_yml.stat.exists
Fatih Degirmenci6e925732019-06-21 18:12:26 +000043
44# run common post-deployment tasks
Sriram Yagnaramancf9daa02019-10-29 14:18:37 +010045# NOTE: The common post-deployment tasks is currently applicable only to
46# simple k8s and openstack scenarios.
Fatih Degirmenciedec2152019-07-27 16:21:49 +000047# in future, when statement could be moved to tasks in role if the current
48# tasks become relevant or new tasks are added.
49- hosts: all
Fatih Degirmenci87c986c2020-01-12 22:35:53 +000050 gather_facts: true
51 become: true
Fatih Degirmencie7995082019-03-24 20:49:21 +000052
Fatih Degirmencie7995082019-03-24 20:49:21 +000053 roles:
54 - role: post-deployment
Sriram Yagnaraman8ecf7d32019-12-08 22:39:58 +000055 when: "'onap-' not in deploy_scenario"
Fatih Degirmencie7995082019-03-24 20:49:21 +000056
57# vim: set ts=2 sw=2 expandtab: