I am a complete newbie to Ansible and I’m piloting the tool at our company by writing a patching update playbook.
I am trying to move all *repo files in /etc/yum.repos.d to /etc/yum.repos.d/off so we can put our own custom repo file in place there. I know we can disable repos with the yum module, but we have a lot of custom repo files out in the directory on the servers, so I’d like to just move them all to ‘off’ and be done with it.
Is there a way to /bin/mv /etc/yum.repos.d/*repo /etc/yum.repos.d/off?
Also, if anyone has any tips/advice on pointing to a custom repo site and doing a yum update (and rebooting)…
I tried mv with ‘command’ and it was squawking at /etc/yum.repos.d/*repo (error: could not stat file) like it wasn’t wildcarding the asterisk. Using ‘shell’ appears to work OK.
I learned if there is no file to move, it errors, but I can throw ignore_errors at it. I’m learning.
I’ll look into yum-config-manager. The hard part is each system is unique and configured differently, so that’s why I decided to use the hammer and just move all/any yum repos out of the way and start fresh.