Basic Ansible example on deploying with git.
vars.yml
---
# Update this to your own settings
project_name: test
project_root: /var/www/test
project_repo: git@github.com:miguelmota/test-repo.git
handlers.yml:
---
- name: restart web server
action: command echo "do something"
sudo_user: root
deploy.yml:
---
- hosts: servers
vars_files:
- vars.yml
gather_facts: false
sudo: true
sudo_user: root
user: root
tasks:
- name: Pull sources from the repository.
git: repo={{project_repo}} dest={{project_root}} version={{branch}}
notify:
- restart web server
handlers:
- include : handlers.yml
hosts:

Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.