Browse Source

Fix restart handlers.

Andrew Butcher 9 years ago
parent
commit
3f85ca5e72

+ 1 - 1
roles/etcd/handlers/main.yml

@@ -2,4 +2,4 @@
 
 - name: restart etcd
   service: name={{ etcd_service }} state=restarted
-  when: not etcd_service_status_changed | default(false)
+  when: not (etcd_service_status_changed | default(false) | bool)

+ 1 - 1
roles/etcd/tasks/main.yml

@@ -104,4 +104,4 @@
   register: start_result
 
 - set_fact:
-    etcd_service_status_changed = start_result | changed
+    etcd_service_status_changed = "{{ start_result | changed }}"

+ 3 - 3
roles/openshift_master/handlers/main.yml

@@ -1,12 +1,12 @@
 ---
 - name: restart master
   service: name={{ openshift.common.service_type }}-master state=restarted
-  when: (not openshift_master_ha | bool) and (not master_service_status_changed | default(false))
+  when: (not openshift_master_ha | bool) and (not (master_service_status_changed | default(false) | bool))
 
 - name: restart master api
   service: name={{ openshift.common.service_type }}-master-api state=restarted
-  when: (openshift_master_ha | bool) and (not master_api_service_status_changed | default(false)) and openshift.master.cluster_method == 'native'
+  when: (openshift_master_ha | bool) and (not (master_api_service_status_changed | default(false) | bool)) and openshift.master.cluster_method == 'native'
 
 - name: restart master controllers
   service: name={{ openshift.common.service_type }}-master-controllers state=restarted
-  when: (openshift_master_ha | bool) and (not master_controllers_service_status_changed | default(false)) and openshift.master.cluster_method == 'native'
+  when: (openshift_master_ha | bool) and (not (master_controllers_service_status_changed | default(false) | bool)) and openshift.master.cluster_method == 'native'

+ 3 - 3
roles/openshift_master/tasks/main.yml

@@ -292,7 +292,7 @@
   when: openshift_master_ha | bool
 
 - set_fact:
-    master_service_status_changed: start_result | changed
+    master_service_status_changed: "{{ start_result | changed }}"
   when: not openshift_master_ha | bool
 
 - name: Start and enable master api
@@ -301,7 +301,7 @@
   register: start_result
 
 - set_fact:
-    master_api_service_status_changed: start_result | changed
+    master_api_service_status_changed: "{{ start_result | changed }}"
   when: openshift_master_ha | bool and openshift.master.cluster_method == 'native'
 
 - name: Start and enable master controller
@@ -310,7 +310,7 @@
   register: start_result
 
 - set_fact:
-    master_controllers_service_status_changed: start_result | changed
+    master_controllers_service_status_changed: "{{ start_result | changed }}"
   when: openshift_master_ha | bool and openshift.master.cluster_method == 'native'
 
 - name: Install cluster packages

+ 1 - 1
roles/openshift_node/handlers/main.yml

@@ -1,7 +1,7 @@
 ---
 - name: restart node
   service: name={{ openshift.common.service_type }}-node state=restarted
-  when: not node_service_status_changed | default(false)
+  when: not (node_service_status_changed | default(false) | bool)
 
 - name: restart docker
   service: name=docker state=restarted

+ 1 - 1
roles/openshift_node/tasks/main.yml

@@ -135,4 +135,4 @@
   register: start_result
 
 - set_fact:
-    node_service_status_changed: start_result | changed
+    node_service_status_changed: "{{ start_result | changed }}"