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.