Created
March 26, 2013 20:04
-
-
Save tgerla/5248692 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # a simple playbook to check out a git repository locally and push it to a target | |
| # system using rsync. this avoids the requirement of the git client on the remote | |
| # system, or having the remote system directly access the repo. | |
| --- | |
| - hosts: 127.0.0.1 | |
| connection: local | |
| tasks: | |
| - name: check out the repository | |
| # might want to use /opt/webapp instead of /tmp -- it's safe to keep the contents | |
| # around on the staging system (the system running ansible) so save a full clone | |
| # every time this runs. | |
| git: repo=http://github.com/bennojoy/mywebapp.git dest=/tmp/webapp version=HEAD | |
| - hosts: webservers | |
| tasks: | |
| - name: copy the repository to the target system | |
| local_action: command rsync -a /tmp/webapp ${ansible_hostname}:/tmp/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment