Hi,

I am trying to replicate a deployment strategy in Ansible to replace a few 
hastily thrown together shell scripts. Perhaps some of this would normally 
be handled by a CI setup, but we don't currently have one and there are 
over a hundred projects this will be applied to.

To this end I am trying to iterate until I find a unique git tag like so:

- name: tag a new 
release                                                          
     local_action: shell git tag -m deployed deployed-{{ release_tag }}{% 
if new_release_tag_contents|default(false) != false %}_{{     
new_release_tag_contents.attempts }}{% endif 
%}                                                                              
    

     register: 
new_release_tag_contents                                               
     until: new_release_tag_contents.stdout.find("already exists") == 
-1              
     retries: 
20                                                                      
     delay: 1

It would seem that new_release_tag_contents is not available within the 
local action as it appears to always evaluate to false. Is it possible to 
access the attempts value in the task? Is there a better way of doing this?

To give you a further idea of the work flow if needed; when a new release 
takes place we:
- create a new git tag (for example deployed-2014-03-10)
- push to bitbucket
- push to a bare repo on production
- ssh into production
- copy previous release folder to new folder (name matches release tag)
- git pull and checkout release tag
- symlink new release directory to pub.tmp
- mv pub.tmp to pub

I tweeted about this over at 
https://twitter.com/Treffynnon/status/444536025957015552 and was asked to 
post here instead.

Thanks,
Simon

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8953c0a7-7a30-4a99-90a2-2ac393526aeb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to