---
- hosts: localhost
user: root
tasks:
- command: "ls /root/Tmp/Deployment/script_files/Hotfix"
register: dir_out
- debug: msg="The hotfix ids are: {{dir_out.stdout_lines}}"
我得到的输出是:
但我希望它为
The hotfix ids are :["1001","1002"]
我该怎么做?
答案 0 :(得分:0)
我需要将{{dir_out.stdout_lines}}
更改为{{dir_out.stdout_lines|join(',')}}