Hello gurus… please I will like to combine below two “replace” tasks into one. Any help will be appreciated. I have the yaml indent correct. I just need help in combing the “replace” tasks into one. thank you
tasks:
-
find:
paths: /etc/yum.repos.d/
patterns: “*.repos”
register: repos -
replace:
path: “{{ item.path }}”
regexp: “gpgcheck=1”
replace: “gpgcheck=0”
loop: “{{ repos.files }}” -
replace:
path: “{{ item.path }}”
regexp: “gpgkey=”
replace: “#gpgkey=”
loop: “{{ repos.files }}”