Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 524

How can I use a jq query to extract a string from this Ansible dictionary?

$
0
0

So I have the following tasks in my playbook

- name: gather package facts  package_facts:- name: send packages containing 'fence-agents' to a file  lineinfile:    path: /etc/leapp/transaction/to_remove    line: "{{ item }}"  loop: "{{ ansible_facts.packages | ???????"  become: true 

Is there anyway to extract a list with all packages which contain the string fence-agents?

I don't want to loop the entire package list as it would increase the playbook run time significantly.


Viewing all articles
Browse latest Browse all 524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>