美文网首页
ansible 按顺序执行命令

ansible 按顺序执行命令

作者: _fishman | 来源:发表于2019-12-23 13:47 被阅读0次
---
- hosts: 10.253.253.15 10.253.253.16 10.253.253.17
  tasks:
    - name: test loop
      shell: date
      delegate_to: "{{ item }}"
      run_once: true
      with_items:
        - "{{ play_hosts }}"
      loop_control:
        pause: 2
PLAY [10.253.253.15 10.253.253.16 10.253.253.17] **********************************************************************************************************************************************

TASK [Gathering Facts] ************************************************************************************************************************************************************************
ok: [10.253.253.15]
ok: [10.253.253.17]
ok: [10.253.253.16]

TASK [test loop] ******************************************************************************************************************************************************************************
changed: [10.253.253.15 -> 10.253.253.15] => (item=10.253.253.15)
changed: [10.253.253.15 -> 10.253.253.16] => (item=10.253.253.16)
changed: [10.253.253.15 -> 10.253.253.17] => (item=10.253.253.17)

PLAY RECAP ************************************************************************************************************************************************************************************
10.253.253.15              : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
10.253.253.16              : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
10.253.253.17              : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

相关文章

网友评论

      本文标题:ansible 按顺序执行命令

      本文链接:https://www.haomeiwen.com/subject/xlpznctx.html