# Compare two variables

**URL:** <https://forum.ansible.com/t/compare-two-variables/23156>\
**Category:** Ansible Project\
**Created:** [December 1, 2016, 5:53pm UTC](https://forum.ansible.com/t/compare-two-variables/23156 "2016-12-01T17:53:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcin\_zimnica](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@marcin\_zimnica](https://forum.ansible.com/u/marcin_zimnica)\
**Post date:** [December 1, 2016, 5:53pm UTC](https://forum.ansible.com/t/compare-two-variables/23156/1 "2016-12-01T17:53:15Z")

</div>

Hi All,

I am trying to compare two variables however it looks like it does not work. I am new to ansible so please be understanding. I know that this script is not optimal but I am still learning.

My code looks like this

---

<div class="post-metadata">

**Author:** ![marcin\_zimnica](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@marcin\_zimnica](https://forum.ansible.com/u/marcin_zimnica)\
**Post date:** [December 1, 2016, 8:23pm UTC](https://forum.ansible.com/t/compare-two-variables/23156/2 "2016-12-01T20:23:29Z")

</div>

Problem solved

This is working scenario
