Ansible setup to provide testing servers, closes #3

This commit is contained in:
sveneh
2015-01-27 12:21:36 +01:00
parent cd0d7ef899
commit 52b83a4451
13 changed files with 1024 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
---
- name: restart sshd
sudo: true
service: name=ssh state=restarted
- name: restart server
sudo: true
command: shutdown -r now
async: 0
poll: 0
ignore_errors: true
notify: wait for server restart
- name: wait for server restart
local_action: wait_for host={{ inventory_hostname }} port=22
state=started
sudo: false

View File

@@ -0,0 +1,32 @@
---
- name: update package list
sudo: true
apt: update_cache=true
- name: install docker dependencies
sudo: true
apt: name={{ item }} install_recommends=false
with_items:
# Docker has serious problems on EC2: http://www.danstutzman.com/2014/07/speed-up-docker-on-ec2
# and https://github.com/docker/docker/issues/4036
- linux-generic
- python-pip
notify: restart server
# make sure resteart is done now, not at end of play
- meta: flush_handlers
- name: install docker
sudo: true
# install script from https://docs.docker.com/installation/ubuntulinux/
# TODO this is not idempotent
shell: curl -sSL https://get.docker.com/ubuntu/ | sudo sh
- name: install docker python API
sudo: true
pip: name=docker-py
- name: enable docker for standard user
sudo: true
user: name={{ ansible_ssh_user }} groups=docker append=yes
notify: restart sshd