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
Post a Comment