aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorMichal Jastrzebski <michal.jastrzebski@intel.com>2015-11-20 10:35:25 -0600
committerMichal Jastrzebski <michal.jastrzebski@intel.com>2015-12-02 10:27:36 -0600
commitf632cfe8783aed50177d3f2b9924a6074f42810d (patch)
tree4236b01b73e6ba5b1dc35b24f2f1fb5ca9c6621b /ansible
parentd6f78f06107092fbf02cca2b6abf8f57a8b8841e (diff)
downloadkolla-f632cfe8783aed50177d3f2b9924a6074f42810d.tar.gz
kolla-f632cfe8783aed50177d3f2b9924a6074f42810d.zip
Sanity check for keystone
This runs first sanity check for keystone. After keystone is deployed it checks tenants.list() Change-Id: Ie919ffe6124eb70428309404a434d9b0eb0b9f70 Partially-Implements: blueprint sanity-check-container
Diffstat (limited to 'ansible')
-rw-r--r--ansible/group_vars/all.yml3
-rw-r--r--ansible/roles/keystone/defaults/main.yml2
-rw-r--r--ansible/roles/keystone/tasks/check.yml20
-rw-r--r--ansible/roles/keystone/tasks/main.yml2
4 files changed, 27 insertions, 0 deletions
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index d2563734b..803e769ff 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -25,6 +25,9 @@ kolla_install_type: "binary"
# Value set in the public_url endpoint in Keystone
kolla_external_address: "{{ kolla_internal_address }}"
+kolla_enable_sanity_checks: no
+
+kolla_enable_sanity_keystone: "{{ kolla_enable_sanity_checks }}"
####################
# Database options
diff --git a/ansible/roles/keystone/defaults/main.yml b/ansible/roles/keystone/defaults/main.yml
index 5f33e2f28..d9a53ca37 100644
--- a/ansible/roles/keystone/defaults/main.yml
+++ b/ansible/roles/keystone/defaults/main.yml
@@ -26,3 +26,5 @@ keystone_internal_address: "{{ kolla_internal_address }}"
keystone_logging_verbose: "{{ openstack_logging_verbose }}"
keystone_logging_debug: "{{ openstack_logging_debug }}"
+
+openstack_keystone_auth: "{'auth_url':'{{ openstack_auth_v2.auth_url }}','username':'{{ openstack_auth_v2.username }}','password':'{{ openstack_auth_v2.password }}','project_name':'{{ openstack_auth_v2.project_name }}'}"
diff --git a/ansible/roles/keystone/tasks/check.yml b/ansible/roles/keystone/tasks/check.yml
new file mode 100644
index 000000000..17fb17d14
--- /dev/null
+++ b/ansible/roles/keystone/tasks/check.yml
@@ -0,0 +1,20 @@
+---
+
+- name: Keystone sanity checks
+ command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ -m kolla_sanity
+ -a "service=keystone
+ project=service
+ user=admin
+ password={{ keystone_admin_password }}
+ role=admin
+ region_name={{ openstack_region_name }}
+ auth={{ '{{ openstack_keystone_auth }}' }}"
+ -e "{'openstack_keystone_auth':{{ openstack_keystone_auth }}}"
+ register: keystone_sanity
+ 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'
+ retries: 1
+ delay: 5
+ run_once: True
+ when: kolla_enable_sanity_keystone | bool \ No newline at end of file
diff --git a/ansible/roles/keystone/tasks/main.yml b/ansible/roles/keystone/tasks/main.yml
index f00b4f0e6..de4178148 100644
--- a/ansible/roles/keystone/tasks/main.yml
+++ b/ansible/roles/keystone/tasks/main.yml
@@ -7,3 +7,5 @@
- include: start.yml
when: inventory_hostname in groups['keystone']
+
+- include: check.yml