Add validate-undercloud role to perform idempotency and simple verification
Change-Id: I9b11d4e6b9c253f4db05a0e6da49abb7f73128bf
This commit is contained in:
parent
2aa05a5bae
commit
25c7723f5e
7
roles/validate-undercloud/defaults/main.yml
Normal file
7
roles/validate-undercloud/defaults/main.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
undercloud_sanity_check_script: undercloud-sanity-check.sh.j2
|
||||||
|
undercloud_sanity_check_log: "{{ working_dir }}/undercloud_sanity_check.log"
|
||||||
|
undercloud_check_idempotency: false
|
||||||
|
undercloud_check_sanity: false
|
||||||
|
undercloud_reinstall_log: "{{ working_dir }}/undercloud_reinstall.log"
|
||||||
|
|
2
roles/validate-undercloud/meta/main.yml
Normal file
2
roles/validate-undercloud/meta/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
dependencies:
|
||||||
|
- extras-common
|
23
roles/validate-undercloud/tasks/main.yml
Normal file
23
roles/validate-undercloud/tasks/main.yml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
- name: Reinstall the undercloud to check idempotency
|
||||||
|
shell: |
|
||||||
|
{{ working_dir }}/undercloud-install.sh > \
|
||||||
|
{{ undercloud_reinstall_log }} 2>&1
|
||||||
|
when: undercloud_check_idempotency|bool
|
||||||
|
tags:
|
||||||
|
- undercloud-validate
|
||||||
|
|
||||||
|
- name: Create undercloud sanity check script
|
||||||
|
template:
|
||||||
|
src: "{{ undercloud_sanity_check_script }}"
|
||||||
|
dest: "{{ working_dir }}/undercloud-sanity-check.sh"
|
||||||
|
mode: 0755
|
||||||
|
tags:
|
||||||
|
- undercloud-scripts
|
||||||
|
|
||||||
|
- name: check undercloud sanity
|
||||||
|
shell: |
|
||||||
|
{{ working_dir }}/undercloud-sanity-check.sh > \
|
||||||
|
{{ undercloud_sanity_check_log }} 2>&1
|
||||||
|
when: undercloud_check_sanity|bool
|
||||||
|
tags:
|
||||||
|
- undercloud-validate
|
@ -0,0 +1,39 @@
|
|||||||
|
### --start_docs
|
||||||
|
|
||||||
|
## Validate the undercloud installation
|
||||||
|
## ====================================
|
||||||
|
|
||||||
|
## * Set the uri of TripleO UI based on SSL usage
|
||||||
|
## ::
|
||||||
|
{% set ui_uri = "https://%s" % undercloud_network_cidr|nthhost(2) if undercloud_generate_service_certificate|bool else "http://%s:3000" % undercloud_network_cidr|nthhost(1) %}
|
||||||
|
|
||||||
|
## * Specify the function to test UI
|
||||||
|
## ::
|
||||||
|
function ui_sanity_check {
|
||||||
|
if [ -f "/etc/httpd/conf.d/25-tripleo-ui.conf" ]; then
|
||||||
|
if ! curl {{ ui_uri }} 2>/dev/null | grep -q 'TripleO'; then
|
||||||
|
echo "ERROR: TripleO UI front page is not loading."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
## * Check the answers from each undercloud service
|
||||||
|
## ::
|
||||||
|
|
||||||
|
set -x
|
||||||
|
source {{ working_dir}}/stackrc
|
||||||
|
openstack user list
|
||||||
|
openstack catalog list
|
||||||
|
nova service-list
|
||||||
|
glance image-list
|
||||||
|
neutron subnet-list
|
||||||
|
neutron net-list
|
||||||
|
neutron agent-list
|
||||||
|
ironic node-list
|
||||||
|
openstack stack list
|
||||||
|
ui_sanity_check
|
||||||
|
set +x
|
||||||
|
|
||||||
|
### --stop_docs
|
Loading…
Reference in New Issue
Block a user