forked from dell/omnia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiscovery_provision.yml
66 lines (56 loc) · 2.44 KB
/
discovery_provision.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Copyright 2024 Dell Inc. or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
- name: Check if virtual environment is active
ansible.builtin.import_playbook: utils/check_venv.yml
when: not ( check_venv_executed | default(false) | bool )
- name: Check if package manager is not locked
ansible.builtin.import_playbook: utils/check_package_lock.yml
when: not ( hostvars['127.0.0.1']['apt_lock_status'] | default(false) | bool )
- name: Set flag
hosts: localhost
connection: local
gather_facts: false
tasks:
- name: Set flag to indicate check_venv.yml has been executed
ansible.builtin.set_fact:
check_venv_executed: true
- name: Set flag to indicate check_package_lock.yml has been executed
ansible.builtin.set_fact:
apt_lock_status: true
- name: Set inventory_status
ansible.builtin.set_fact:
inventory_status: true
when:
- hostvars.keys() | length > 0
- groups['all'] is defined
- groups['all'] | length > 0
- name: Validate inventory file
include_role:
name: utils/server_spec_update/roles/server_spec_validation
when: inventory_status | default(false) | bool
- name: Validate discovery parameters # noqa:role-name[path]
hosts: localhost
connection: local
roles:
- discovery/roles/discovery_validations/common
- name: Prepare Omnia Infrastructure Manager for basic things
ansible.builtin.import_playbook: prepare_oim/prepare_oim.yml # noqa:role-name[path]
- name: Discover the nodes
ansible.builtin.import_playbook: discovery/discovery.yml # noqa:role-name[path]
- name: Server spec configuration
ansible.builtin.import_playbook: utils/server_spec_update/server_spec_update.yml # noqa:role-name[path]
when: inventory_status | default(false) | bool
- name: Provision nodes
ansible.builtin.import_playbook: provision/provision.yml # noqa:role-name[path]