From 7e2100b43533a3bdde50e0c55fe8de788acb23e5 Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Thu, 22 May 2025 15:48:45 +0800 Subject: [PATCH] perf: set ansible_timeout for account connectivity tasks --- apps/accounts/automations/verify_account/host/posix/main.yml | 2 ++ apps/accounts/automations/verify_account/host/windows/main.yml | 1 + apps/assets/automations/ping/host/posix/main.yml | 2 ++ apps/assets/automations/ping/host/windows/main.yml | 2 ++ 4 files changed, 7 insertions(+) diff --git a/apps/accounts/automations/verify_account/host/posix/main.yml b/apps/accounts/automations/verify_account/host/posix/main.yml index 49e84e5ee..d02dd6f4f 100644 --- a/apps/accounts/automations/verify_account/host/posix/main.yml +++ b/apps/accounts/automations/verify_account/host/posix/main.yml @@ -8,6 +8,7 @@ ansible_user: "{{ account.username }}" ansible_password: "{{ account.secret }}" ansible_ssh_private_key_file: "{{ account.private_key_path }}" + ansible_timeout: 30 when: not account.become.ansible_become - name: Verify account connectivity(Switch) @@ -20,4 +21,5 @@ ansible_become_method: "{{ account.become.ansible_become_method }}" ansible_become_user: "{{ account.become.ansible_become_user }}" ansible_become_password: "{{ account.become.ansible_become_password }}" + ansible_timeout: 30 when: account.become.ansible_become diff --git a/apps/accounts/automations/verify_account/host/windows/main.yml b/apps/accounts/automations/verify_account/host/windows/main.yml index a0a722eba..c4475033d 100644 --- a/apps/accounts/automations/verify_account/host/windows/main.yml +++ b/apps/accounts/automations/verify_account/host/windows/main.yml @@ -9,3 +9,4 @@ vars: ansible_user: "{{ account.username }}" ansible_password: "{{ account.secret }}" + ansible_timeout: 30 diff --git a/apps/assets/automations/ping/host/posix/main.yml b/apps/assets/automations/ping/host/posix/main.yml index 8e5f375dd..8616f497b 100644 --- a/apps/assets/automations/ping/host/posix/main.yml +++ b/apps/assets/automations/ping/host/posix/main.yml @@ -1,5 +1,7 @@ - hosts: demo gather_facts: no + vars: + ansible_timeout: 30 tasks: - name: Posix ping ansible.builtin.ping: diff --git a/apps/assets/automations/ping/host/windows/main.yml b/apps/assets/automations/ping/host/windows/main.yml index 92d8164ad..59c1697b8 100644 --- a/apps/assets/automations/ping/host/windows/main.yml +++ b/apps/assets/automations/ping/host/windows/main.yml @@ -1,5 +1,7 @@ - hosts: windows gather_facts: no + vars: + ansible_timeout: 30 tasks: - name: Refresh connection ansible.builtin.meta: reset_connection