bifrost/playbooks/roles/bifrost-test-inspection/tasks/main.yml

41 lines
1.6 KiB
YAML

# Copyright (c) 2018 StackHPC Ltd.
#
# 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.
---
# TODO(mgoddard): Ideally we would grab inspection data from ironic inspector
# rather than going direct to the web server. That would require either
# installing python-openstackclient, or creating an ansible module that uses
# python-ironic-inspector-client.
- block:
- name: Check node hardware inspection data
uri:
url: "{{ inspector_store_data_url ~ '/ironic-inspector/inspector_data-' ~ uuid }}"
method: GET
return_content: True
register: inspection_data
# TODO(mgoddard): More validation of data format and contents.
- name: Validate the inspection data format
assert:
that:
- "'inventory' in data"
- "'memory' in inventory"
- "'cpu' in inventory"
- "'bmc_address' in inventory"
- "'interfaces' in inventory"
- "'disks' in inventory"
vars:
data: "{{ inspection_data.content | from_json }}"
inventory: "{{ data.inventory }}"
when: inspector_store_data_in_nginx | bool