0
yum 모듈을 사용하여 시스템의 모든 업데이트를 나열 할 수 있습니다. 내가 작업에 사용Filter Anabilities의 JSON 출력을 필터링하여 문자열과 비교하십시오.
results: [
{
"name": "rubygem-ffi",
"nevra": "0:rubygem-ffi-1.9.10-2.el7.x86_64",
"repo": "epel",
"epoch": "0",
"version": "1.9.10",
"release": "2.el7",
"yumstate": "available",
"arch": "x86_64"
}
{
"name": "some-package",
"nevra": "blah",
"repo": "epel",
"epoch": "0",
"version": "6",
"release": "6.el7",
"yumstate": "available",
"arch": "x86_64"
}
]
및 코드 : : 출력은 다음과 같은 것입니다
- name: yum list
yum: list=updates
register: output
내가 원하는 것은 패키지의 이름이 발견되는 경우에만 디버그 메시지를 인쇄하는 것입니다 json 출력. 이처럼 :
- debug: msg="Found it!"
when: [output.I don't know the right filter] == "rubygem-ffi"
내가 output.results.name
또는 output.results|map(attribute='name')|list
뭔가를 시도했지만 그들은
모든 단서를 작동하지 않는 것?