我最近在一台装有 RHEL6 的机器上发现:
ls -lbi
917921 -rw-r-----. 1 alex pivotal 5245 Dec 17 20:36 application.yml
917922 -rw-r-----. 1 alex pivotal 2972 Dec 17 20:36 application11.yml
917939 -rw-r-----. 1 alex pivotal 3047 Dec 17 20:36 application11.yml
917932 -rw-r-----. 1 alex pivotal 2197 Dec 17 20:36 applicationall.yml
Run Code Online (Sandbox Code Playgroud)
我想知道如何实现这样的目标?
我有一本剧本,其中一个任务收集有关在特定主机上运行 docker 容器的信息。
- name: Gather info
hosts: "{{ hosts }}"
gather_facts: no
tasks:
- name: Check all running containers
become: yes
command: docker ps --format "{{ \.Names }}"
register: dkr_ps
- debug: msg="{{dkr_ps}}"
Run Code Online (Sandbox Code Playgroud)
但不知何故,由命令模块运行的 docker cmd 仍然存在,并抛出以下错误:
TemplateSyntaxError: unexpected char u'\\' at 23
line 1
Run Code Online (Sandbox Code Playgroud)
我想我没有正确逃脱?