From ec11c3125379e172e3dd7cc70ca203361827a704 Mon Sep 17 00:00:00 2001 From: Rafal Lewandowski Date: Thu, 5 Oct 2023 13:27:28 +0200 Subject: [PATCH] Add a separate interface address for tgtd Closes-Bug: #2031237 Change-Id: I7a4eaeab0c106ebdcb4d4cf9825c53dd8ad62dbf --- ansible/roles/iscsi/defaults/main.yml | 1 + ansible/roles/iscsi/tasks/precheck.yml | 2 +- ansible/roles/iscsi/templates/tgtd.json.j2 | 2 +- releasenotes/notes/tgtd_iface-2ff09b2b12870372.yaml | 4 ++++ 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/tgtd_iface-2ff09b2b12870372.yaml diff --git a/ansible/roles/iscsi/defaults/main.yml b/ansible/roles/iscsi/defaults/main.yml index ceee34eff5..688f94cb2c 100644 --- a/ansible/roles/iscsi/defaults/main.yml +++ b/ansible/roles/iscsi/defaults/main.yml @@ -19,6 +19,7 @@ iscsi_services: volumes: "{{ tgtd_default_volumes + tgtd_extra_volumes }}" dimensions: "{{ tgtd_dimensions }}" +tgtd_interface_address: "{{ api_interface_address }}" #################### # Docker diff --git a/ansible/roles/iscsi/tasks/precheck.yml b/ansible/roles/iscsi/tasks/precheck.yml index 67afa5a7ed..4d36bc5dfc 100644 --- a/ansible/roles/iscsi/tasks/precheck.yml +++ b/ansible/roles/iscsi/tasks/precheck.yml @@ -16,7 +16,7 @@ - name: Checking free port for iscsi wait_for: - host: "{{ api_interface_address }}" + host: "{{ tgtd_interface_address }}" port: "{{ iscsi_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/iscsi/templates/tgtd.json.j2 b/ansible/roles/iscsi/templates/tgtd.json.j2 index 0501c52fbd..cb9032bffe 100644 --- a/ansible/roles/iscsi/templates/tgtd.json.j2 +++ b/ansible/roles/iscsi/templates/tgtd.json.j2 @@ -1,4 +1,4 @@ { - "command": "tgtd -d 1 -f --iscsi portal={{ api_interface_address | put_address_in_context('url') }}:{{ iscsi_port }}", + "command": "tgtd -d 1 -f --iscsi portal={{ tgtd_interface_address | put_address_in_context('url') }}:{{ iscsi_port }}", "config_files": [] } diff --git a/releasenotes/notes/tgtd_iface-2ff09b2b12870372.yaml b/releasenotes/notes/tgtd_iface-2ff09b2b12870372.yaml new file mode 100644 index 0000000000..6697fef789 --- /dev/null +++ b/releasenotes/notes/tgtd_iface-2ff09b2b12870372.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Added ability to define address for a separate tgtd network interface.