Hi Michael,
To literally answer your question, you probably just want to do something like:
- name: create directory
file: path=/etc/yum.repos.d/off/ state=directory
- name: move repo files out of the way
command: mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/off/ creates=/etc/yum.repos.d/<some known repo name>
The creates= argument will cause the task to be skipped if the path specified already exists.
But maybe instead of just moving the repos files out of the way, you could use yum-config-manager instead?
You could combine this with the creates= or removes= option to the command: call, too, if you can figure out which paths to reference.
-Tim