Fatih Degirmenci | 73175db | 2019-07-16 07:49:01 +0000 | [diff] [blame] | 1 | --- |
| 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 Degirmenci | 923b366 | 2019-07-27 15:03:52 +0000 | [diff] [blame] | 20 | # check if any pre-deployment task defined for the scenario |
Fatih Degirmenci | 73175db | 2019-07-16 07:49:01 +0000 | [diff] [blame] | 21 | - hosts: localhost |
| 22 | connection: local |
Fatih Degirmenci | 87c986c | 2020-01-12 22:35:53 +0000 | [diff] [blame] | 23 | gather_facts: false |
| 24 | become: false |
Fatih Degirmenci | 923b366 | 2019-07-27 15:03:52 +0000 | [diff] [blame] | 25 | |
| 26 | tasks: |
| 27 | - name: Check if any pre-deployment task defined for '{{ deploy_scenario }}' scenario |
| 28 | stat: |
| 29 | path: "{{ engine_cache }}/repos/swconfig/{{ scenario[deploy_scenario].installers[installer_type].role }}/tasks/pre-deployment.yml" |
| 30 | register: pre_deployment_yml |
| 31 | |
| 32 | # run the scenario pre-deployment tasks before running the deployment itself |
| 33 | - hosts: all |
Fatih Degirmenci | 87c986c | 2020-01-12 22:35:53 +0000 | [diff] [blame] | 34 | gather_facts: true |
| 35 | become: true |
Fatih Degirmenci | 73175db | 2019-07-16 07:49:01 +0000 | [diff] [blame] | 36 | |
| 37 | tasks: |
Fatih Degirmenci | 923b366 | 2019-07-27 15:03:52 +0000 | [diff] [blame] | 38 | - name: Execute pre-deployment tasks of '{{ deploy_scenario }}' scenario |
Fatih Degirmenci | 73175db | 2019-07-16 07:49:01 +0000 | [diff] [blame] | 39 | include_role: |
| 40 | name: "{{ engine_cache }}/repos/swconfig/{{ scenario[deploy_scenario].installers[installer_type].role }}" |
| 41 | tasks_from: pre-deployment |
Fatih Degirmenci | 572223c | 2019-12-11 13:43:10 +0100 | [diff] [blame] | 42 | when: hostvars['localhost'].pre_deployment_yml.stat.exists |
Fatih Degirmenci | 73175db | 2019-07-16 07:49:01 +0000 | [diff] [blame] | 43 | |
| 44 | # vim: set ts=2 sw=2 expandtab: |