An Ansible playbook to easily deploy Jenkins CI servers in Debian OSs (Tested on Debian 7.2 Wheezy).
Jenkins is managed by Nginx web server, which acts as a proxy to serve the CI server via port 80. Iptables ensures that standard Jenkins port 8080 is unreachable from the outside.
Want to try the playbook? You can easily set up a VM using Vagrant and then run directly the ansible-playbook command for it:
vagrant box add debian-7.2 https://dl.dropboxusercontent.com/u/197673519/debian-7.2.0.box
vagrant init debian-7.2
Now edit the Vagrantfile to include this:
config.vm.network :forwarded_port, host: 9000, guest: 80
Launch the VM:
vagrant up
Run Ansible playbook:
ansible-playbook site.yml
Once finished, check it out in your browser using the localhost port 9000 (the way to access port 80 of your running VM, remember we configured it before). You will see the Jenkins dashboard there waiting for new jobs!