I am very new to Ansible and I am learning through youtube videos as I am enquiring about this problem. It might be a simple one to some of you guys:
So I have multiple servers on my System. I have a VM by the name of YUM which has all the updates (updates folder) on its /var/www/html folder so it can be referenced from other systems if it was done manually (which is what i have been doing until now).
How do I specify this folder in Ansible to all other hosts?
You could use variable and reference that variable inside playbook.
I this way you don’t have to repeat on call same path mutiple time instead you can call that variable.
Based on the situation you define below, it sounds like you are wanting
to add a custom yum repository to some hosts. Let's look at how you
could go about doing it.
(1) You will need to create a yum repository file on your hosts. This
file will point to your custom repository on your Yum server. You can
achieve that via ansible module(s) or just copy the yum repository file
that you created to each host. You will need to do some research on how
to do it. As others have pointed out, the yum module is a good place to
start. I'm only offering two ways to achieve this step but there might
be others strategies.
(2) You will need to have ansible update your systems. I'm including
part of my upgrade playbook below to use as a reference (I'm on fedora
so using dnf instead of yum). You can have your hosts defined in your
ansible hosts file (/etc/ansible/hosts). I'm not sure your strategy for
organizing your hosts as there is a lot to say here but again some
investigation is needed.
Finally, you could combine step 1 and 2 into a single playbook to have
them be two playbooks depending on your needs. I hope this is helpful.