aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorEugene Bagdasaryan <ebagdasa@cisco.com>2016-02-29 11:24:06 +0300
committerEugene Bagdasaryan <ebagdasa@cisco.com>2016-02-29 18:23:13 +0300
commit790675be4f40a0662fcb3ba1aa17ff85d7bf1761 (patch)
tree021d496d53696a7f1d0e02906b896d1c750f920c /ansible
parentac4c3bb69afed4dc6fa3f576a9c06ebd147a6fde (diff)
downloadkolla-790675be4f40a0662fcb3ba1aa17ff85d7bf1761.tar.gz
kolla-790675be4f40a0662fcb3ba1aa17ff85d7bf1761.zip
Sanity check for swift
This runs first sanity check for swift. Once swift is deployed it checks list() Change-Id: I613bf9f2893d66814863893ec5acde5aa252548d Partially-Implements: blueprint sanity-check-container
Diffstat (limited to 'ansible')
-rw-r--r--ansible/group_vars/all.yml1
-rw-r--r--ansible/roles/swift/tasks/check.yml19
-rw-r--r--ansible/roles/swift/tasks/deploy.yml6
3 files changed, 26 insertions, 0 deletions
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index aef66ab4d..a4ca3d099 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -32,6 +32,7 @@ kolla_enable_sanity_checks: "no"
kolla_enable_sanity_keystone: "{{ kolla_enable_sanity_checks }}"
kolla_enable_sanity_glance: "{{ kolla_enable_sanity_checks }}"
kolla_enable_sanity_cinder: "{{ kolla_enable_sanity_checks }}"
+kolla_enable_sanity_swift: "{{ kolla_enable_sanity_checks }}"
####################
# Database options
diff --git a/ansible/roles/swift/tasks/check.yml b/ansible/roles/swift/tasks/check.yml
new file mode 100644
index 000000000..15e438c9d
--- /dev/null
+++ b/ansible/roles/swift/tasks/check.yml
@@ -0,0 +1,19 @@
+---
+- name: Swift sanity checks
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
+ -m kolla_sanity
+ -a "service=swift
+ project=service
+ user=admin
+ password={{ swift_keystone_password }}
+ role=admin
+ region_name={{ openstack_region_name }}
+ auth={{ '{{ openstack_swift_auth }}' }}"
+ -e "{'openstack_swift_auth':{{ openstack_swift_auth }}}"
+ register: swift_sanity
+ changed_when: "{{ swift_sanity.stdout.find('localhost | SUCCESS => ') != -1 and (swift_sanity.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
+ until: swift_sanity.stdout.split()[2] == 'SUCCESS'
+ retries: 10
+ delay: 5
+ run_once: True
+ when: kolla_enable_sanity_swift | bool \ No newline at end of file
diff --git a/ansible/roles/swift/tasks/deploy.yml b/ansible/roles/swift/tasks/deploy.yml
index 5b2e8a980..0a9ab4fed 100644
--- a/ansible/roles/swift/tasks/deploy.yml
+++ b/ansible/roles/swift/tasks/deploy.yml
@@ -16,3 +16,9 @@
inventory_hostname in groups['swift-container-server'] or
inventory_hostname in groups['swift-object-server'] or
inventory_hostname in groups['swift-proxy-server']
+
+- include: check.yml
+ when: inventory_hostname in groups['swift-account-server'] or
+ inventory_hostname in groups['swift-container-server'] or
+ inventory_hostname in groups['swift-object-server'] or
+ inventory_hostname in groups['swift-proxy-server']