# Check if test server configuration is same as prod server

**URL:** <https://forum.ansible.com/t/check-if-test-server-configuration-is-same-as-prod-server/29689>\
**Category:** Ansible Project\
**Created:** [February 15, 2019, 10:58am UTC](https://forum.ansible.com/t/check-if-test-server-configuration-is-same-as-prod-server/29689 "2019-02-15T10:58:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yacine\_Mourchid](https://avatars.discourse-cdn.com/v4/letter/y/9e8a1a/32.png) [@Yacine\_Mourchid](https://forum.ansible.com/u/Yacine_Mourchid)\
**Post date:** [February 15, 2019, 10:58am UTC](https://forum.ansible.com/t/check-if-test-server-configuration-is-same-as-prod-server/29689/1 "2019-02-15T10:58:51Z")

</div>

Hello,

I’m a beginner with Ansible.  
I wanna know how to check if configuration of test server and prod are same or if there is a difference.  
And if it’s possible, how to know what is the difference between them.

I’ve several server to check.

Thanks  
Yacine

---

<div class="post-metadata">

**Author:** ![Sudheer\_S1](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@Sudheer\_S1](https://forum.ansible.com/u/Sudheer_S1)\
**Post date:** [February 15, 2019, 11:10am UTC](https://forum.ansible.com/t/check-if-test-server-configuration-is-same-as-prod-server/29689/2 "2019-02-15T11:10:02Z")

</div>

You have to provide more details than the abstract requirement.

What configuration do you want to check exactly? Is the configuration stored in some file, database, etc?

Looks like you might want to run a diff against two configuration files.

Having said that, you might want to consider this:

Use Ansible to generate configuration and deploy to the target servers. Manage the differences of environments(prod and test) in inventories. That way you don't have to compare the configuration manually.

---

<div class="post-metadata">

**Author:** ![Yacine\_Mourchid](https://avatars.discourse-cdn.com/v4/letter/y/9e8a1a/32.png) [@Yacine\_Mourchid](https://forum.ansible.com/u/Yacine_Mourchid)\
**Post date:** [February 15, 2019, 1:31pm UTC](https://forum.ansible.com/t/check-if-test-server-configuration-is-same-as-prod-server/29689/3 "2019-02-15T13:31:55Z")

</div>

Thank for reply.

To explain you the context. Currently we have an excel file when we put ALL configuration of both server (prod and test).  
Here an example of parameters we compare for an apache server :

 ![apache_dmz.PNG](https://us1.discourse-cdn.com/ansible/original/2X/e/e35f4a4961c848cc8051e520dde521c5dc1ced6c.png)

 ![me_dmz.PNG](https://us1.discourse-cdn.com/ansible/original/2X/1/1b5ed2e64dde6efe8bf43d464305b258943451c4.png)

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [February 15, 2019, 10:18pm UTC](https://forum.ansible.com/t/check-if-test-server-configuration-is-same-as-prod-server/29689/4 "2019-02-15T22:18:13Z")

</div>

How does this spreadsheet gets populated?

I.e. where do these OK and KO values come from?

It looks like a mixture of desired state and actual state - but in a spreadsheet?

In any case the advice form the previous poster sounds like a good plan. Just have one source of truth and be done with it.  
Regarding the use of a spreadsheet, that is possible but I wonder what benefit that gives. For sure it’s more difficult to keep that in version control.

Dick

> **(attachments)**
>
> ![apache_dmz.PNG](https://us1.discourse-cdn.com/ansible/original/2X/e/e35f4a4961c848cc8051e520dde521c5dc1ced6c.png)  
> ![me_dmz.PNG](https://us1.discourse-cdn.com/ansible/original/2X/1/1b5ed2e64dde6efe8bf43d464305b258943451c4.png)

---

<div class="post-metadata">

**Author:** ![Yacine\_Mourchid](https://avatars.discourse-cdn.com/v4/letter/y/9e8a1a/32.png) [@Yacine\_Mourchid](https://forum.ansible.com/u/Yacine_Mourchid)\
**Post date:** [February 18, 2019, 8:53am UTC](https://forum.ansible.com/t/check-if-test-server-configuration-is-same-as-prod-server/29689/5 "2019-02-18T08:53:28Z")

</div>

This Speadsheet gets populated manually and these OK/KO values are a simply excel formule to compare both values.  
You both comfirm that Ansible is the best way to maintain sure control of configurations and comparison of both environnement.

Do you know a good tutorial to set up this system ?

---

<div class="post-metadata">

**Author:** ![Sudheer\_S1](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@Sudheer\_S1](https://forum.ansible.com/u/Sudheer_S1)\
**Post date:** [February 18, 2019, 11:09am UTC](https://forum.ansible.com/t/check-if-test-server-configuration-is-same-as-prod-server/29689/6 "2019-02-18T11:09:40Z")

</div>

I'd start with the official documentation. Learn some basic Ansible concepts like inventory and start with template module. If you have any specific questions, ask here.
