在fscache stats上的shell cat命令的ansible中格式化stdout输出

在fscache stats上的shell cat命令的ansible中格式化stdout输出,ansible,ansible-2.x,ansible-facts,Ansible,Ansible 2.x,Ansible Facts,团队,我的任务有以下输出。当我直接从linux终端获取它时,如何能够像它所显示的那样很好地打印它 下面是我的任务,它在所有主机上运行ssh命令,并分别列出每个主机的输出,但我想像下面列出的示例输出一样漂亮地打印它 任务 输出: ok: [localhost] => (item=hostA) => { "msg": "FS-Cache statistics(ver:1.0)\nCookies: idx=600 dat=519 spc=0\nObjects: alc=0 n

团队,我的任务有以下输出。当我直接从linux终端获取它时,如何能够像它所显示的那样很好地打印它

下面是我的任务,它在所有主机上运行ssh命令,并分别列出每个主机的输出,但我想像下面列出的示例输出一样漂亮地打印它

任务

输出:

 ok: [localhost] => (item=hostA) => {
      "msg": "FS-Cache statistics(ver:1.0)\nCookies: idx=600 dat=519 spc=0\nObjects: alc=0 nal=0 avl=0 ded=2\nChkAux : non=0 ok=0 upd=0 obs=0\nPages  : mrk=0 unc=0\nAcquire: n=1119 nul=0 noc=0 ok=1119 nbf=0 oom=0\nLookups: n=0 neg=0 pos=0 crt=0 tmo=0\nInvals : n=0 run=0\nUpdates: n=0 nul=0 run=0\nRelinqs: n=1119 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=519 ok=0 wt=0 nod=0 nbf=519 int=0 oom=0\nRetrvls: ops=0 owt=0 abt=0\nStores : n=0 ok=0 agn=0 nbf=0 oom=0 wrxd=0 sol=0\nStores : ops=0 run=0 pgs=0 rxd=0 irxd=0 olm=0 ipp=0\nVmScan : nos=0 gon=0 bsy=0 can=0 wt=0\nOps    : pend=0 run=0 enq=0 can=0 rej=0\nOps    : ini=0 dfr=0 rel=0 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"
  }
预期产出:

cat /proc/fs/fscache/stats
FS-Cache statistics(ver:1.0)
Cookies: idx=600 dat=519 spc=0
Objects: alc=0 nal=0 avl=0 ded=2
ChkAux : non=0 ok=0 upd=0 obs=0
Pages  : mrk=0 unc=0
Acquire: n=1119 nul=0 noc=0 ok=1119 nbf=0 oom=0
Lookups: n=0 neg=0 pos=0 crt=0 tmo=0
Invals : n=0 run=0
Updates: n=0 nul=0 run=0
Relinqs: n=1119 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=519 ok=0 wt=0 nod=0 nbf=519 int=0 oom=0
Retrvls: ops=0 owt=0 abt=0
Stores : n=0 ok=0 agn=0 nbf=0 oom=0 wrxd=0 sol=0
Stores : ops=0 run=0 pgs=0 rxd=0 irxd=0 olm=0 ipp=0
VmScan : nos=0 gon=0 bsy=0 can=0 wt=0
Ops    : pend=0 run=0 enq=0 can=0 rej=0
Ops    : ini=0 dfr=0 rel=0 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
尝试拆分函数

 msg: "{{ item.stdout.split('\n') }}"

只是每行末尾都会有一个额外的

Aah。。commmaaaa。没有吗?
 msg: "{{ item.stdout.split('\n') }}"