Команда,
не удалось понять, в чем проблема, и я попробовал команду, а также модуль оболочки. фактическая команда выполняется нормально, но я не уверен, почему она говорит stderr?
task
- name: "List out PROC Stats on DGX/GPU Nodes Nodes"
shell: "cat {{ proc_stats }} | grep FS"
ignore_errors: no
register: proc_stats
delegate_to: "{{ item }}"
with_items: "{{ groups['gpu_node'] }}"
failed_when: proc_stats.rc != 0
output
TASK [services-pre-install-checks : List out PROC Stats on DGX/GPU Nodes Nodes] ***
16:21:57 Wednesday 06 November 2019 00:21:57 +0000 (0:00:03.628) 0:00:19.398 ****
16:21:59 failed: [localhost -> hostA.test.metal.net] (item=hostA) => {"ansible_loop_var": "item", "changed": true, "cmd": ["cat", "/proc/fs/fscache/stats", "|", "grep", "FS"], "delta": "0:00:00.106478", "end": "2019-11-06 00:21:59.372137", "failed_when_result": true, "item": "hostA", "msg": "non-zero return code", "rc": 1, "start": "2019-11-06 00:21:59.265659", "stderr": "cat: '|': No such file or directory\ncat: grep: No such file or directory\ncat: FS: No such file or directory", "stderr_lines": ["cat: '|': No such file or directory", "cat: grep: No such file or directory", "cat: FS: No such file or directory"], "stdout": "FS-Cache statistics(ver:1.0)\nCookies: idx=613 dat=520 spc=0\nObjects: alc=3 nal=0 avl=3 ded=4\nChkAux : non=0 ok=1 upd=0 obs=0\nPages : mrk=1 unc=1\nAcquire: n=1133 nul=0 noc=0 ok=1133 nbf=0 oom=0\nLookups: n=3 neg=2 pos=1 crt=2 tmo=0\nInvals : n=0 run=0\nUpdates: n=0 nul=0 run=0\nRelinqs: n=1133 nul=0 wcr=0 rtr=0\nAttrChg: n=0 ok=0 nbf=0 oom=0 run=0\nAllocs : n=0 ok=0 wt=0 nbf=0 int=0\nAllocs : ops=0 owt=0 abt=0\nRetrvls: n=520 ok=0 wt=1 nod=1 nbf=519 int=0 oom=0\nRetrvls: ops=1 owt=1 abt=0\nStores : n=1 ok=1 agn=0 nbf=0 oom=0 wrxd=0 sol=0\nStores : ops=1 run=2 pgs=1 rxd=1 irxd=0 olm=0 ipp=0\nVmScan : nos=0 gon=0 bsy=0 can=0 wt=0\nOps : pend=1 run=2 enq=2 can=0 rej=0\nOps : ini=2 dfr=0 rel=2 gc=0\nCacheOp: alo=0 luo=0 luc=0 gro=0\nCacheOp: inv=0 upo=0 dro=0 pto=0 atc=0 syn=0\nCacheOp: rap=0 ras=0 alp=0 als=0 wrp=0 ucp=0 dsp=0\nCacheEv: nsp=0 stl=0 rtr=0 cul=0", "stdout_lines": ["FS-Cache statistics(ver:1.0)", "Cookies: idx=613 dat=520 spc=0", "Objects: alc=3 nal=0 avl=3 ded=4", "ChkAux : non=0 ok=1 upd=0 obs=0", "Pages : mrk=1 unc=1", "Acquire: n=1133 nul=0 noc=0 ok=1133 nbf=0 oom=0", "Lookups: n=3 neg=2 pos=1 crt=2 tmo=0", "Invals : n=0 run=0", "Updates: n=0 nul=0 run=0", "Relinqs: n=1133 nul=0 wcr=0 rtr=0", "AttrChg: n=0 ok=0 nbf=0 oom=0 run=0", "Allocs : n=0 ok=0 wt=0 nbf=0 int=0", "Allocs : ops=0 owt=0 abt=0", "Retrvls: n=520 ok=0 wt=1 nod=1 nbf=519 int=0 oom=0", "Retrvls: ops=1 owt=1 abt=0", "Stores : n=1 ok=1 agn=0 nbf=0 oom=0 wrxd=0 sol=0", "Stores : ops=1 run=2 pgs=1 rxd=1 irxd=0 olm=0 ipp=0", "VmScan : nos=0 gon=0 bsy=0 can=0 wt=0", "Ops : pend=1 run=2 enq=2 can=0 rej=0", "Ops : ini=2 dfr=0 rel=2 gc=0", "CacheOp: alo=0 luo=0 luc=0 gro=0", "CacheOp: inv=0 upo=0 dro=0 pto=0 atc=0 syn=0", "CacheOp: rap=0 ras=0 alp=0 als=0 wrp=0 ucp=0 dsp=0", "CacheEv: nsp=0 stl=0 rtr=0 cul=0"]}