trailNerror
trailNerror

Reputation: 71

ansible module for timeout in conjunction with shell

After executing a shell command to change the node IP address of the node which I am connected to, connection gets lost (obviously). So control gets stuck at that particular task. How do I get past that task

---
- hosts: localhost
  gather_facts: no

  tasks:
  - name: ESX IP change

    shell: esxcli network ip interface ipv4 set -i vmk0 -I "{{item.esxNew}}" -N "{{esxNetmask}}" -t static &

    delegate_to: "{{item.esxOld}}"

    async: 10

    poll: 5

    with_items:
      "{{nodeDetails}}"

Current results -

TASK [ESX IP change] ***************************************************************************************************************************************************

Expected results -

TASK [ESX IP change] ***************************************************************************************************************************************************
changed: [...]

Upvotes: 2

Views: 4035

Answers (1)

error404
error404

Reputation: 2823

You can use timeout per tasks basis Like below:-

 vars:
   ansible_command_timeout: 40

timeout_reference_link

Upvotes: 2

Related Questions