Fatih Degirmenci | e799508 | 2019-03-24 20:49:21 +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 | edec215 | 2019-07-27 16:21:49 +0000 | [diff] [blame^] | 20 | # check if any post-deployment task defined for the scenario |
Fatih Degirmenci | 6e92573 | 2019-06-21 18:12:26 +0000 | [diff] [blame] | 21 | - hosts: localhost |
| 22 | connection: local |
Fatih Degirmenci | edec215 | 2019-07-27 16:21:49 +0000 | [diff] [blame^] | 23 | gather_facts: no |
| 24 | become: no |
Fatih Degirmenci | 6e92573 | 2019-06-21 18:12:26 +0000 | [diff] [blame] | 25 | vars_files: |
| 26 | - "{{ engine_path }}/engine/var/versions.yml" |
| 27 | - "{{ engine_path }}/engine/var/global.yml" |
| 28 | - "{{ sdf_file }}" |
| 29 | |
| 30 | tasks: |
Fatih Degirmenci | edec215 | 2019-07-27 16:21:49 +0000 | [diff] [blame^] | 31 | - name: Check if any post-deployment task defined for '{{ deploy_scenario }}' scenario |
Fatih Degirmenci | 6e92573 | 2019-06-21 18:12:26 +0000 | [diff] [blame] | 32 | stat: |
| 33 | path: "{{ engine_cache }}/repos/swconfig/{{ scenario[deploy_scenario].installers[installer_type].role }}/tasks/post-deployment.yml" |
| 34 | register: post_deployment_yml |
| 35 | |
| 36 | # run the scenario post-deployment tasks before running the common post-deployment tasks |
| 37 | - hosts: all |
| 38 | gather_facts: true |
| 39 | become: yes |
| 40 | vars_files: |
| 41 | - "{{ engine_path }}/engine/var/versions.yml" |
| 42 | - "{{ engine_path }}/engine/var/global.yml" |
| 43 | - "{{ sdf_file }}" |
| 44 | |
| 45 | tasks: |
Fatih Degirmenci | edec215 | 2019-07-27 16:21:49 +0000 | [diff] [blame^] | 46 | - name: Execute post-deployment tasks of '{{ deploy_scenario }}' scenario |
Fatih Degirmenci | 6e92573 | 2019-06-21 18:12:26 +0000 | [diff] [blame] | 47 | include_role: |
| 48 | name: "{{ engine_cache }}/repos/swconfig/{{ scenario[deploy_scenario].installers[installer_type].role }}" |
| 49 | tasks_from: post-deployment |
Fatih Degirmenci | 73175db | 2019-07-16 07:49:01 +0000 | [diff] [blame] | 50 | when: hostvars['localhost'].post_deployment_yml.stat.exists == True |
Fatih Degirmenci | 6e92573 | 2019-06-21 18:12:26 +0000 | [diff] [blame] | 51 | |
| 52 | # run common post-deployment tasks |
Fatih Degirmenci | edec215 | 2019-07-27 16:21:49 +0000 | [diff] [blame^] | 53 | # NOTE: none of the common post-deployment tasks is currently applicable to the |
| 54 | # clusters provisioned using heat so we execute the role only for the clusters |
| 55 | # provisioned using bifrost. |
| 56 | # in future, when statement could be moved to tasks in role if the current |
| 57 | # tasks become relevant or new tasks are added. |
| 58 | - hosts: all |
| 59 | gather_facts: yes |
Fatih Degirmenci | e799508 | 2019-03-24 20:49:21 +0000 | [diff] [blame] | 60 | become: yes |
| 61 | vars_files: |
Fatih Degirmenci | 665d4f0 | 2019-05-02 10:50:51 -0600 | [diff] [blame] | 62 | - "{{ engine_path }}/engine/var/versions.yml" |
Fatih Degirmenci | e799508 | 2019-03-24 20:49:21 +0000 | [diff] [blame] | 63 | - "{{ engine_path }}/engine/var/global.yml" |
Fatih Degirmenci | 665d4f0 | 2019-05-02 10:50:51 -0600 | [diff] [blame] | 64 | - "{{ pdf_file }}" |
| 65 | - "{{ idf_file }}" |
Fatih Degirmenci | e799508 | 2019-03-24 20:49:21 +0000 | [diff] [blame] | 66 | |
Fatih Degirmenci | e799508 | 2019-03-24 20:49:21 +0000 | [diff] [blame] | 67 | roles: |
| 68 | - role: post-deployment |
Fatih Degirmenci | edec215 | 2019-07-27 16:21:49 +0000 | [diff] [blame^] | 69 | when: provisioner_type == 'bifrost' |
Fatih Degirmenci | e799508 | 2019-03-24 20:49:21 +0000 | [diff] [blame] | 70 | |
| 71 | # vim: set ts=2 sw=2 expandtab: |