fixed bug with backup
diff --git a/tasks/main.yml b/tasks/main.yml
index c0b9362..8b4e876 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -1,17 +1,21 @@
---
# tasks file for apigee-opdk-backup
-- name: Stop component {{ component_name }}
- shell: '{{ apigee_service }} {{ component_name }} stop'
- when: component_name != 'apigee-postgresql' or component_name != 'all'
+- name: Stop component if it is not Postgres
+ shell: '{{ apigee_service }} {{ component_profile }} stop'
+ when: component_profile != 'apigee-postgresql' or component_profile != 'all'
-- name: Backup component {{ component_name }}
- shell: '{{ apigee_service }} {{ component_name }} backup'
- when: component_name != 'all'
+- name: Start component if it is Postgres
+ shell: '{{ apigee_service }} {{ component_profile }} start'
+ when: component_profile == 'apigee-postgresql'
-- name: Backup component {{ component_name }}
+- name: Backup component {{ component_profile }}
+ shell: '{{ apigee_service }} {{ component_profile }} backup'
+ when: component_profile != 'all'
+
+- name: Backup component {{ component_profile }}
shell: '{{ apigee_all }} backup'
- when: component_name == 'all'
+ when: component_profile == 'all'
-- name: Start component {{ component_name }}
- shell: '{{ apigee_service }} {{ component_name }} start'
- when: component_name != 'all'
+- name: Start component {{ component_profile }}
+ shell: '{{ apigee_service }} {{ component_profile }} start'
+ when: component_profile != 'all'