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?

http://docs.fedoraproject.org/en-US/Fedora/16/html/System_Administrators_Guide/sec-Managing_Yum_Repositories.html

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


On Mon, Dec 16, 2013 at 2:10 PM, Michael Jeffrey <[email protected]> wrote:

>
> 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)... :-)
>
> --Michael
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Tim Gerla
[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to