summaryrefslogtreecommitdiffstats
path: root/roles/ands_kaas/tasks/project.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/ands_kaas/tasks/project.yml')
-rw-r--r--roles/ands_kaas/tasks/project.yml32
1 files changed, 31 insertions, 1 deletions
diff --git a/roles/ands_kaas/tasks/project.yml b/roles/ands_kaas/tasks/project.yml
index b8574cf..ecb2035 100644
--- a/roles/ands_kaas/tasks/project.yml
+++ b/roles/ands_kaas/tasks/project.yml
@@ -18,6 +18,33 @@
var_name: "var_{{kaas_project}}_config"
when: hostvars[inventory_hostname][var_name] is not defined
+
+- name: Get information about block volumes
+ delegate_to: "{{ groups.masters[0] }}"
+ shell: gluster-block info {{ item.value.volume }}/{{ item.key }} | grep -oP '^GBID:\s*\K.*'
+ register: iqn_info
+ with_dict: "{{ kaas_block_volumes }}"
+ when: item.value.project == kaas_project
+
+- name: Get information about block volumes
+ delegate_to: "{{ groups.masters[0] }}"
+ shell: gluster-block info {{ item.value.volume }}/{{ item.key }} | grep -oP '^EXPORTED NODE.*:\s*\K.*' | tr ' ' '\n'
+ register: portal_info
+ with_dict: "{{ kaas_block_volumes }}"
+ when: item.value.project == kaas_project
+
+
+- set_fact:
+ kaas_block_iqn: "{{ {} }}"
+ kaas_block_portals: "{{ {} }}"
+
+- set_fact: "kaas_block_iqn={{ kaas_block_iqn | combine({item.item.key: item.stdout}) }}"
+ with_items: "{{ iqn_info.results }}"
+
+- set_fact: "kaas_block_portals={{ kaas_block_portals | combine({item.item.key: item.stdout_lines}) }}"
+ with_items: "{{ portal_info.results }}"
+
+
#- debug: msg="{{kaas_project_path}}"
#- debug:
# msg="{{kaas_project_config}}"
@@ -25,11 +52,14 @@
# var_name: "var_{{kaas_project}}_config"
# kaas_project_config: "{{hostvars[inventory_hostname][var_name]}}"
-- include_tasks: do_project.yml
+- include_tasks: "do_{{ do_subrole | default('project') }}.yml"
vars:
var_name: "var_{{kaas_project}}_config"
kaas_project_config: "{{ hostvars[inventory_hostname][var_name] }}"
kaas_project_volumes: "{{ kaas_project_config.volumes | default(kaas_project_config.extra_volumes | default({}) | combine(kaas_openshift_volumes)) }}"
kaas_project_pods: "{{ kaas_project_config.pods | default({}) }}"
+ kaas_project_apps: "{{ kaas_project_config.apps | default([]) }}"
kaas_project_gids: "{{ kaas_project_config.gids | default(kaas_openshift_gids) }}"
kaas_project_uids: "{{ kaas_project_config.uids | default(kaas_openshift_uids) }}"
+ kaas_blockvol_info: "{{ block_info }}"
+ \ No newline at end of file