@@ -316,6 +316,47 @@ config ANSIBLE_CFG_INVENTORY
316316
317317endif # ANSIBLE_CFG_INVENTORY_CUSTOM
318318
319+ config ANSIBLE_CFG_SSH_PORT_SET_BY_CLI
320+ bool
321+ default $(shell, scripts/check-cli-set-var.sh ANSIBLE_CFG_SSH_PORT)
322+
323+ config ANSIBLE_CFG_SSH_PORT_CUSTOM
324+ bool "Enable a custom Ansible SSH port setting"
325+ default n
326+ help
327+ When this setting is enabled, specify the SSH port for
328+ Ansible to use when connecting to target nodes.
329+
330+ When this setting is disabled, kdevops uses the default
331+ SSH port (22), which can be overridden with
332+ "ANSIBLE_CFG_SSH_PORT=NN" on the "make" command line.
333+
334+ This is useful when your target hosts use a non-standard
335+ SSH port for security or network configuration reasons.
336+
337+ if ANSIBLE_CFG_SSH_PORT_CUSTOM
338+
339+ config ANSIBLE_CFG_SSH_PORT
340+ int "Ansible SSH port"
341+ output yaml
342+ help
343+ Set the SSH port for Ansible to use when connecting to target
344+ nodes. The default port is 22.
345+
346+ https://docs.ansible.com/ansible/latest/collections/ansible/builtin/ssh_connection.html#parameter-remote_port
347+
348+ endif # ANSIBLE_CFG_SSH_PORT_CUSTOM
349+
350+ if !ANSIBLE_CFG_SSH_PORT_CUSTOM
351+
352+ config ANSIBLE_CFG_SSH_PORT
353+ int
354+ output yaml
355+ default 22 if !ANSIBLE_CFG_SSH_PORT_SET_BY_CLI
356+ default $(shell, ./scripts/append-makefile-vars-int.sh $(ANSIBLE_CFG_SSH_PORT)) if ANSIBLE_CFG_SSH_PORT_SET_BY_CLI
357+
358+ endif # !ANSIBLE_CFG_SSH_PORT_CUSTOM
359+
319360if DISTRO_OPENSUSE
320361
321362config ANSIBLE_CFG_RECONNECTION_RETRIES
0 commit comments