How to add/update git tag from local machine using ansible playbook? -


i'm using following ansible playbook deploy applications , add tagging role can automatically add/update tag mark current commit 1 has been deployed.

attempt

my current attempt follow, based on how can move tag on git branch different commit?:

--- - name: removes tag in local repository.   shell: git tag -d {{git_deploy_tag}}   tags: [tagging]  - name: removes tag in remote repository.   shell: git push origin :refs/tags/{{git_deploy_tag}}   tags: [tagging]  - name: adds tag different commit (head).   shell: git tag {{git_deploy_tag}} head   tags: [tagging]  - name: pushes changes remote repository.   shell: git push origin {{git_branch}} --tags   tags: [tagging] 

problem

this role run on remote host doesn't have access git repository, , intend keep so. unable run role on local machine following run command on ansible host.

question

how run tagging role locally (other roles should run on remote). fabric script have local() method

add localhost ansible inventory , split playbook in multiple plays, want run locally first , want run remotely.

what follows ins example only, might work base you. aware ansible runs tasks in parallel, there option chose how many parallel tasks run, need executed 1 task @ time.

--- - hosts: local  tasks:   - name: removes tag in local repository.     shell: git tag -d {{git_deploy_tag}}     tags: [tagging]  - hosts: remote  tasks:   - name: removes tag in remote repository.     shell: git push origin :refs/tags/{{git_deploy_tag}}     tags: [tagging] 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -