This demo uses Ansistrano to deploy a static site with an unprivileged user.
The demo relies on Vagrant, the Vagrant plugin Vagrant Hostsupdater, VirtualBox, and Ansible.
The important files are:
Vagrantfile
: This boots a Vagrant VM to an initial state with a demo website at http://ansistrano-demo.local.provision.yml
: This Ansible playbook runs atvagrant up
(the first time),vagrant up --provision
, orvagrant provision
. It handles the initial deployment of the demo site.deploy.yml
: This Ansible playbook deploys a changed version of the demo site'sindex.html
file to the VM via rsync (the changed version is located in this repo atdocroot/index.html
).
To test:
- Run
git clone https://github.com/ctorgalson/ansistrano-demo.git
- Run
cd ansistrano-demo && vagrant up
- Run
ansible-playbook deploy.yml
- Visit http://ansistrano-demo.local in a browser.
- Run
vagrant ssh
thencd /var/www/html && ls -hal
.
To retest, change the file at docroot/index.html
and re-run steps 3 to 5.