fix: 资产多协议时 计算协议端口错误 (#12120)

Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
fit2bot
2023-11-15 14:59:40 +08:00
committed by GitHub
parent 7a5cffac91
commit b15c314384
3 changed files with 8 additions and 5 deletions

View File

@@ -2,6 +2,7 @@
gather_facts: no
vars:
ansible_connection: local
ansible_shell_type: sh
ansible_become: false
tasks:
@@ -10,7 +11,7 @@
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
login_port: "{{ jms_asset.protocols | selectattr('name', 'equalto', 'ssh') | map(attribute='port') | first }}"
login_secret_type: "{{ jms_account.secret_type }}"
login_private_key_path: "{{ jms_account.private_key_path }}"
become: "{{ custom_become | default(False) }}"