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

41 views
Skip to first unread message

poiuytrez

unread,
Mar 21, 2016, 7:30:43 AM3/21/16
to Ansible Project
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

Michel blanc

unread,
Mar 21, 2016, 7:39:52 AM3/21/16
to ansible...@googlegroups.com
Le 21/03/2016 12:30, poiuytrez a écrit :
> 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?


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
--
{ :github => "@leucos", :twitter => "@b9m", :gpg => "0X24B35C22" }

Guillaume Charhon

unread,
Mar 22, 2016, 4:56:21 AM3/22/16
to ansible...@googlegroups.com
Thank you Michel for your suggestions.


--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/IecbY7TS0wE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/56EFDD7A.3080600%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages