Sanity check for glance
This runs first sanity check for glance. After glance is deployed it checks images.list(). Also consist few fixes for previous patches Change-Id: I03d05d246302d8411b2e94c94ca7fe046c00d735 Partially-Implements: blueprint sanity-check-container
This commit is contained in:
parent
f632cfe878
commit
aab1bd36c8
@ -28,6 +28,7 @@ kolla_external_address: "{{ kolla_internal_address }}"
|
|||||||
kolla_enable_sanity_checks: no
|
kolla_enable_sanity_checks: no
|
||||||
|
|
||||||
kolla_enable_sanity_keystone: "{{ kolla_enable_sanity_checks }}"
|
kolla_enable_sanity_keystone: "{{ kolla_enable_sanity_checks }}"
|
||||||
|
kolla_enable_sanity_glance: "{{ kolla_enable_sanity_checks }}"
|
||||||
|
|
||||||
####################
|
####################
|
||||||
# Database options
|
# Database options
|
||||||
|
20
ansible/roles/glance/tasks/check.yml
Normal file
20
ansible/roles/glance/tasks/check.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Glance sanity checks
|
||||||
|
command: docker exec -t kolla_ansible /usr/bin/ansible localhost
|
||||||
|
-m kolla_sanity
|
||||||
|
-a "service=glance
|
||||||
|
project=service
|
||||||
|
user=admin
|
||||||
|
password={{ glance_keystone_password }}
|
||||||
|
role=admin
|
||||||
|
region_name={{ openstack_region_name }}
|
||||||
|
auth={{ '{{ openstack_glance_auth }}' }}"
|
||||||
|
-e "{'openstack_glance_auth':{{ openstack_glance_auth }}}"
|
||||||
|
register: glance_sanity
|
||||||
|
changed_when: "{{ glance_sanity.stdout.find('localhost | SUCCESS => ') != -1 and (glance_sanity.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
||||||
|
until: glance_sanity.stdout.split()[2] == 'SUCCESS'
|
||||||
|
retries: 10
|
||||||
|
delay: 5
|
||||||
|
run_once: True
|
||||||
|
when: kolla_enable_sanity_glance | bool
|
@ -19,3 +19,7 @@
|
|||||||
- include: start.yml
|
- include: start.yml
|
||||||
when: inventory_hostname in groups['glance-api'] or
|
when: inventory_hostname in groups['glance-api'] or
|
||||||
inventory_hostname in groups['glance-registry']
|
inventory_hostname in groups['glance-registry']
|
||||||
|
|
||||||
|
- include: check.yml
|
||||||
|
when: inventory_hostname in groups['glance-api'] or
|
||||||
|
inventory_hostname in groups['glance-registry']
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
register: keystone_sanity
|
register: keystone_sanity
|
||||||
changed_when: "{{ keystone_sanity.stdout.find('localhost | SUCCESS => ') != -1 and (keystone_sanity.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
changed_when: "{{ keystone_sanity.stdout.find('localhost | SUCCESS => ') != -1 and (keystone_sanity.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
||||||
until: keystone_sanity.stdout.split()[2] == 'SUCCESS'
|
until: keystone_sanity.stdout.split()[2] == 'SUCCESS'
|
||||||
retries: 1
|
retries: 10
|
||||||
delay: 5
|
delay: 5
|
||||||
run_once: True
|
run_once: True
|
||||||
when: kolla_enable_sanity_keystone | bool
|
when: kolla_enable_sanity_keystone | bool
|
@ -28,7 +28,11 @@ import shade
|
|||||||
class SanityChecks(object):
|
class SanityChecks(object):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def keystone(cloud):
|
def keystone(cloud):
|
||||||
cloud.keystone_client.tenants.list()
|
[tenant for tenant in cloud.keystone_client.tenants.list()]
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def glance(cloud):
|
||||||
|
[image for image in cloud.glance_client.images.list()]
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
Reference in New Issue
Block a user