aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorJeffrey Zhang <jeffrey.zhang@99cloud.net>2016-02-25 08:19:35 +0800
committerJeffrey Zhang <jeffrey.zhang@99cloud.net>2016-02-27 02:15:48 +0000
commit72ac7a5541e510cadfec0dc6754c5cf52503b187 (patch)
treef2fac072b1bfa46ea608ffea5635769443abc3a0 /ansible
parent287e4faf99c2fe7a5d0a57334df35a6dc5e71f72 (diff)
downloadkolla-72ac7a5541e510cadfec0dc6754c5cf52503b187.tar.gz
kolla-72ac7a5541e510cadfec0dc6754c5cf52503b187.zip
Reconfigure keystone service
Partially-implements: bp kolla-reconfig Change-Id: Ied293e59bf4531e88a0e5e5bf9a5f5f495d2a0e7
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/keystone/tasks/do_reconfigure.yml39
-rw-r--r--ansible/roles/keystone/tasks/reconfigure.yml2
2 files changed, 41 insertions, 0 deletions
diff --git a/ansible/roles/keystone/tasks/do_reconfigure.yml b/ansible/roles/keystone/tasks/do_reconfigure.yml
new file mode 100644
index 000000000..8974a3558
--- /dev/null
+++ b/ansible/roles/keystone/tasks/do_reconfigure.yml
@@ -0,0 +1,39 @@
+---
+- include: config.yml
+
+- name: Check the configs
+ command: docker exec keystone /usr/local/bin/kolla_set_configs --check
+ changed_when: false
+ failed_when: false
+ register: check_result
+
+# NOTE(jeffrey4l): when config_strategy == 'COPY_ALWAYS'
+# and container env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE',
+# just remove the container and start again
+- name: Container config strategy
+ command: docker exec keystone printenv KOLLA_CONFIG_STRATEGY
+ changed_when: false
+ failed_when: false
+ register: container_config_strategy
+
+- name: Remove the keystone container
+ kolla_docker:
+ name: "keystone"
+ action: "remove_container"
+ when:
+ - config_strategy == "COPY_ONCE" or container_config_strategy.stdout == 'COPY_ONCE'
+ - check_result.rc == 1
+
+- include: start.yml
+ when:
+ - config_strategy == "COPY_ONCE" or container_config_strategy.stdout == 'COPY_ONCE'
+ - check_result.rc == 1
+
+- name: Restart keystone service
+ # TODO(jeffrey4l): move to the kolla_docker module when
+ # it has restart_container action
+ command: docker restart keystone
+ when:
+ - config_strategy == 'COPY_ALWAYS'
+ - container_config_strategy.stdout != 'COPY_ONCE'
+ - check_result.rc == 1
diff --git a/ansible/roles/keystone/tasks/reconfigure.yml b/ansible/roles/keystone/tasks/reconfigure.yml
index ed97d539c..66933249b 100644
--- a/ansible/roles/keystone/tasks/reconfigure.yml
+++ b/ansible/roles/keystone/tasks/reconfigure.yml
@@ -1 +1,3 @@
---
+- include: do_reconfigure.yml
+ serial: "30%"