blob: 8f2f8e07e351a6da4b540fc7bc09485376624334 [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
50 when:
51 - hostvars['localhost'].post_deployment_yml.stat.exists
52
53# run common post-deployment tasks
Fatih Degirmenci665d4f02019-05-02 10:50:51 -060054- hosts: baremetal
55 remote_user: root
56 gather_facts: true
57 become: true
58 vars_files:
59 - "roles/post-deployment/vars/main.yml"
Fatih Degirmenci6e925732019-06-21 18:12:26 +000060
Fatih Degirmenci665d4f02019-05-02 10:50:51 -060061 tasks:
62 - name: Install necessary utilities for CEPH
63 apt:
64 name:
65 - xfsprogs
66 - gdisk
67 state: present
68 - name: Remove existing rook data directories
69 file:
70 path: "{{ rook_data_dir_path }}"
71 state: absent
72 ignore_errors: yes
73 tags: reset
74 - name: Remove existing rook storage directories
75 file:
76 path: "{{ rook_storage_dir_path }}"
77 state: absent
78 ignore_errors: yes
79 tags: reset
80 - name: Remove existing rook ceph osds
81 script: "roles/post-deployment/files/clean-ceph-osd.sh {{ rook_node_device_filter }}"
82 ignore_errors: yes
83 tags: reset
84
Fatih Degirmencie7995082019-03-24 20:49:21 +000085- hosts: localhost
86 connection: local
87 gather_facts: true
88 become: yes
89 vars_files:
Fatih Degirmenci665d4f02019-05-02 10:50:51 -060090 - "{{ engine_path }}/engine/var/versions.yml"
Fatih Degirmencie7995082019-03-24 20:49:21 +000091 - "{{ engine_path }}/engine/var/global.yml"
Fatih Degirmenci665d4f02019-05-02 10:50:51 -060092 - "{{ pdf_file }}"
93 - "{{ idf_file }}"
Fatih Degirmencie7995082019-03-24 20:49:21 +000094
Fatih Degirmencie7995082019-03-24 20:49:21 +000095 roles:
96 - role: post-deployment
97
98# vim: set ts=2 sw=2 expandtab: