# How not to deploy an old version of an ansible playbook?

**URL:** <https://forum.ansible.com/t/how-not-to-deploy-an-old-version-of-an-ansible-playbook/20942>\
**Category:** Ansible Project\
**Created:** [March 21, 2016, 11:30am UTC](https://forum.ansible.com/t/how-not-to-deploy-an-old-version-of-an-ansible-playbook/20942 "2016-03-21T11:30:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guillaume\_Charhon](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@Guillaume\_Charhon](https://forum.ansible.com/u/Guillaume_Charhon)\
**Post date:** [March 21, 2016, 11:30am UTC](https://forum.ansible.com/t/how-not-to-deploy-an-old-version-of-an-ansible-playbook/20942/1 "2016-03-21T11:30:43Z")

</div>

Hello,

We are a team of 10 people. Our ansible playbooks are hosted on a git repository. It happens that someone deploys an outdated version of a playbook on machine because he forgot to do a git pull before deploying. Do you have a strategy to avoid this issue?

Thank you for your help,  
poiuytrez

---

<div class="post-metadata">

**Author:** ![Michel\_Blanc1](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@Michel\_Blanc1](https://forum.ansible.com/u/Michel_Blanc1)\
**Post date:** [March 21, 2016, 11:39am UTC](https://forum.ansible.com/t/how-not-to-deploy-an-old-version-of-an-ansible-playbook/20942/2 "2016-03-21T11:39:38Z")

</div>

Hi Guillaume,

I see two quick solutions:

- have people login to a bastion host which serves as a deployment  
machine (may be some 'git checkout && git pull' trick in .bashrc)  
- use tags, deploy a "version" file and do a "remote\_tag |  
version\_compare(current\_tag, '\>=')"; this woould involve some local  
tricks to get the latest tag (e.g. git describe --always --tag | cut -f  
1 -d'-').

However the latter is really workflow dependent, and requires some  
discipline setting tags (and thus might just move the problem elsewhere  
instead of fixing it).

M

---

<div class="post-metadata">

**Author:** ![Guillaume\_Charhon](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@Guillaume\_Charhon](https://forum.ansible.com/u/Guillaume_Charhon)\
**Post date:** [March 22, 2016, 8:55am UTC](https://forum.ansible.com/t/how-not-to-deploy-an-old-version-of-an-ansible-playbook/20942/3 "2016-03-22T08:55:47Z")

</div>

Thank you Michel for your suggestions.
