aboutsummaryrefslogtreecommitdiffstats
path: root/tests/files/ansible/roles/docker/tasks/main.yml
blob: c434b34a57548778347ddfa457dd8d76477d7817 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
- 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

- name: Kernel update needs a restart 
  sudo: true
  command: shutdown -r now 
  async: 0
  poll: 0
  ignore_errors: true

- name: waiting for server to come back
  local_action: wait_for host={{ inventory_hostname }} port=22
                state=started
  sudo: false

- 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