ZhangZhihui's Blog  
scnzzh@ZUBT1:~/zzh$ cat test.yml
---
- name: Test Play
  hosts: zubt1

  tasks:
    - name:  test
      shell: pwd
      register: result
    - debug:
        msg: "{{ result.stdout }}"


scnzzh@ZUBT1:~/zzh$ ansible-playbook -i zinventory test.yml

PLAY [Test Play] ****************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************
ok: [zubt1]

TASK [test] *********************************************************************************************************************************************************
changed: [zubt1]

TASK [debug] ********************************************************************************************************************************************************
ok: [zubt1] => {
    "msg": "/home/scnzzh"
}

PLAY RECAP **********************************************************************************************************************************************************
zubt1                      : ok=3    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

 

posted on 2020-12-14 15:49  ZhangZhihuiAAA  阅读(129)  评论(0编辑  收藏  举报