blob: fbbf8e84b50acfa15fc740c45157147126ea6dd5 [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 Degirmenci6e925732019-06-21 18:12:26 +000020# check if post-deployment.yml exists in engine cache on localhost
21- hosts: localhost
22 connection: local
23 gather_facts: true
24 become: yes
25 vars_files:
26 - "{{ engine_path }}/engine/var/versions.yml"
27 - "{{ engine_path }}/engine/var/global.yml"
28 - "{{ sdf_file }}"
29
30 tasks:
31 - name: Check if any post-deployment task defined for '{{ deploy_scenario }}' role
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:
46 - name: Execute post-deployment tasks of '{{ deploy_scenario }}' role
47 include_role:
48 name: "{{ engine_cache }}/repos/swconfig/{{ scenario[deploy_scenario].installers[installer_type].role }}"
49 tasks_from: post-deployment
Fatih Degirmenci73175db2019-07-16 07:49:01 +000050 when: hostvars['localhost'].post_deployment_yml.stat.exists == True
Fatih Degirmenci6e925732019-06-21 18:12:26 +000051
52# run common post-deployment tasks
Fatih Degirmenci665d4f02019-05-02 10:50:51 -060053- hosts: baremetal
54 remote_user: root
55 gather_facts: true
56 become: true
57 vars_files:
58 - "roles/post-deployment/vars/main.yml"
Fatih Degirmenci6e925732019-06-21 18:12:26 +000059
Fatih Degirmenci665d4f02019-05-02 10:50:51 -060060 tasks:
61 - name: Install necessary utilities for CEPH
62 apt:
63 name:
64 - xfsprogs
65 - gdisk
66 state: present
67 - name: Remove existing rook data directories
68 file:
69 path: "{{ rook_data_dir_path }}"
70 state: absent
71 ignore_errors: yes
72 tags: reset
73 - name: Remove existing rook storage directories
74 file:
75 path: "{{ rook_storage_dir_path }}"
76 state: absent
77 ignore_errors: yes
78 tags: reset
79 - name: Remove existing rook ceph osds
80 script: "roles/post-deployment/files/clean-ceph-osd.sh {{ rook_node_device_filter }}"
81 ignore_errors: yes
82 tags: reset
83
Fatih Degirmencie7995082019-03-24 20:49:21 +000084- hosts: localhost
85 connection: local
86 gather_facts: true
87 become: yes
88 vars_files:
Fatih Degirmenci665d4f02019-05-02 10:50:51 -060089 - "{{ engine_path }}/engine/var/versions.yml"
Fatih Degirmencie7995082019-03-24 20:49:21 +000090 - "{{ engine_path }}/engine/var/global.yml"
Fatih Degirmenci665d4f02019-05-02 10:50:51 -060091 - "{{ pdf_file }}"
92 - "{{ idf_file }}"
Fatih Degirmencie7995082019-03-24 20:49:21 +000093
Fatih Degirmencie7995082019-03-24 20:49:21 +000094 roles:
95 - role: post-deployment
96
97# vim: set ts=2 sw=2 expandtab: