From de7ff55ed86533344d0fe034b5cd5b4b8585e7a7 Mon Sep 17 00:00:00 2001 From: Asaf Rachmani Date: Thu, 2 Sep 2021 17:32:40 +0300 Subject: [PATCH] storage: Pass he_iscsi_tgpt variable to hosted_engine_setup role Pass he_iscsi_tgpt variable to hosted_engine_setup role in order to use it in "iSCSI login" task. Requires https://github.com/oVirt/ovirt-ansible-collection/pull/338 Bug-Url: https://bugzilla.redhat.com/1768969 Signed-off-by: Asaf Rachmani Change-Id: Ia105de51d67ff97bbbd3567782fb93280d9d7699 --- ovirt-hosted-engine-setup.spec.in | 2 +- .../gr-he-ansiblesetup/core/storage_domain.py | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ovirt-hosted-engine-setup.spec.in b/ovirt-hosted-engine-setup.spec.in index cd25eaf4..c1a01f50 100644 --- a/ovirt-hosted-engine-setup.spec.in +++ b/ovirt-hosted-engine-setup.spec.in @@ -71,7 +71,7 @@ Requires: virt-install # The whole way of consuming anisble roles is going to change # skipping ansible dependencies until we have something working. Requires: ansible >= 2.9.21, ansible < 2.10.0 -Requires: ovirt-ansible-collection >= 1.5.4 +Requires: ovirt-ansible-collection >= 1.6.5 %endif # default libvirt network Requires: libvirt-daemon-config-network diff --git a/src/plugins/gr-he-ansiblesetup/core/storage_domain.py b/src/plugins/gr-he-ansiblesetup/core/storage_domain.py index 2d1785a5..f0c149c3 100644 --- a/src/plugins/gr-he-ansiblesetup/core/storage_domain.py +++ b/src/plugins/gr-he-ansiblesetup/core/storage_domain.py @@ -301,7 +301,15 @@ def _query_iscsi_target( ','.join([str(x['port']) for x in apl]), ) - def _query_iscsi_lunid(self, username, password, portal, port, target): + def _query_iscsi_lunid( + self, + username, + password, + portal, + port, + target, + tpgt + ): iscsi_getdevices_vars = { 'he_fqdn': self.environment[ ohostedcons.NetworkEnv.OVIRT_HOSTED_ENGINE_FQDN @@ -317,6 +325,7 @@ def _query_iscsi_lunid(self, username, password, portal, port, target): 'he_iscsi_portal_addr': portal, 'he_iscsi_portal_port': port, 'he_iscsi_target': target, + 'he_iscsi_tpgt': tpgt, } ah = ansible_utils.AnsibleHelper( tags=ohostedcons.Const.HE_TAG_ISCSI_GETDEVICES, @@ -715,7 +724,8 @@ def _closeup(self): password=iscsi_password, portal=iscsi_portal, port=iscsi_port, - target=iscsi_target + target=iscsi_target, + tpgt=iscsi_tpgt ) lunid = lun['id'] discard = lun['discard_max_size'] > 0