aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-03-02 11:00:54 +0000
committerGerrit Code Review <review@openstack.org>2016-03-02 11:00:55 +0000
commit5139a1442d674813f449d2be2dae992094301ade (patch)
treefb6fcc7550dbd5b1ad7464ddca03ec33ac628f47 /ansible
parenta07855bc07792c40669bebfe696676fedca92048 (diff)
parent790675be4f40a0662fcb3ba1aa17ff85d7bf1761 (diff)
downloadkolla-5139a1442d674813f449d2be2dae992094301ade.tar.gz
kolla-5139a1442d674813f449d2be2dae992094301ade.zip
Merge "Sanity check for swift"
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 9ca55381a..eca72ff3c 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']