# Two queries regarding ansible

**URL:** <https://forum.ansible.com/t/two-queries-regarding-ansible/12416>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [February 24, 2013, 2:26pm UTC](https://forum.ansible.com/t/two-queries-regarding-ansible/12416 "2013-02-24T14:26:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [February 24, 2013, 2:26pm UTC](https://forum.ansible.com/t/two-queries-regarding-ansible/12416/1 "2013-02-24T14:26:33Z")

</div>

> I have just started using ansible so pardon me my n00b-ness 😃

No problem!

> I have two questions
> 
> 1) It is my understanding that when we use yum it downloads the packages  
> from internet.How can we orchestrate the rpm's installation from one machine  
> to another.

You can configure whatever sources you like in /etc/yum.repos.d

The template module is great for this.

Typically yum repos are created with createrepo and mirrored with reposync.

> Explanation
> 
> I have all the packages on server A which is the entry point of all other  
> servers in the infrastructure.I want to run ansible on server A and install  
> rpm's which are placed on server A on all other machines.How would i do  
> that?
> 
> 2) If i want to change only one parameter in a file on clients how can i  
> achieve this without copying a file everytime? e.g i want to change the  
> webserver port in httpd.conf from 80 to 8080.

The lineinfile module is good for config file surgery operations,  
though it's always better to declare exactly what is in the file if  
you can, that  
way you are positive you know what is in the file.

It's also not true that the copy module will copy the file every time.

Both copy and template will transfer the file only if the remote  
md5sum would have been different.
