Last active
August 29, 2015 14:03
-
-
Save ptmt/df8d3b0f91852d6bf369 to your computer and use it in GitHub Desktop.
Ansible playbook for install jenkins + mongo on docker
This file contains 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
- hosts: ci | |
sudo: yes | |
tasks: | |
- name: Install Docker on Ubuntu | |
apt: pkg=docker.io state=present | |
- name: Rename docker.io to docker | |
shell: ln -sf /usr/bin/docker.io /usr/local/bin/docker | |
- name: Autocomplete available | |
shell: sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io | |
- name: Start Docker service | |
service: name=docker.io state=started | |
- name: Stop all containers | |
shell: docker stop $(docker ps -a -q) | |
- name: Remove all containers | |
shell: docker rm $(docker ps -a -q) | |
- name: Run mongo | |
shell: docker run --name jenkins-mongo -d mongo | |
- name: Run jenkins slave | |
shell: docker run guilhem/jenkins-slave --name slave -d | |
- name: Run jenkins | |
shell: docker run --name jenkins --link jenkins-mongo:mongo --link slave:slave -d -p 80:8080 -v /home/jenkins:/jenkins aespinosa/jenkins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment