Skip to content
Snippets Groups Projects
Commit 5b96d551 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Use find since with_fileglob perform locally

parent c5243949
No related branches found
No related tags found
No related merge requests found
---
- name: Get CentOS repo files
shell: ls /etc/yum.repos.d/CentOS-*
register: repo_files
- name: Remove mirrorlist from CentOS repo files
ansible.builtin.replace:
path: "{{ item }}"
regexp: '^mirrorlist'
replace: '#mirrorlist'
backup: yes
with_fileglob: '/etc/yum.repos.d/CentOS-*.repo'
with_items: "{{ repo_files.stdout_lines }}"
- name: Use vault baseurl to CentOS repo files
ansible.builtin.replace:
......@@ -13,4 +17,4 @@
regexp: '^#baseurl=http://mirror.centos.org'
replace: 'baseurl=http://vault.centos.org'
backup: yes
with_fileglob: '/etc/yum.repos.d/CentOS-*.repo'
with_items: "{{ repo_files.stdout_lines }}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment