小编Pan*_*ndu的帖子

Ansible jinja2 过滤器拒绝

我需要从标准输出行中拒绝“*”。

"stdout_lines": [
    "rchinnn01",
    "rchinnn02",
    "*"
]

- set_fact:
  nfs_clients:  "{{ nfs_clients_out.stdout_lines | reject('search','*') | list }}"
Run Code Online (Sandbox Code Playgroud)

剧本输出:

TASK [set_fact] *****************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: error: nothing to repeat
fatal: [rchinnn03]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}
Run Code Online (Sandbox Code Playgroud)

ansible

2
推荐指数
1
解决办法
5245
查看次数

标签 统计

ansible ×1