Zack Williams | e4fbacc | 2016-05-21 07:18:43 -0700 | [diff] [blame^] | 1 | --- |
| 2 | # Installs docker with apt, docker-compose with pip, adds user to group |
| 3 | # Must be run as root |
| 4 | |
| 5 | # https://docs.docker.com/engine/installation/linux/ubuntulinux/ |
| 6 | - name: Prereqs and SSL support for apt for SSL |
| 7 | apt: |
| 8 | name={{ item }} |
| 9 | update_cache=yes |
| 10 | cache_valid_time=3600 |
| 11 | with_items: |
| 12 | - apt-transport-https |
| 13 | - ca-certificates |
| 14 | - python-pip |
| 15 | |
| 16 | - name: Trust docker apt key |
| 17 | apt_key: |
| 18 | keyserver=pool.sks-keyservers.net |
| 19 | id=58118E89F3A912897C070ADBF76221572C52609D |
| 20 | |
| 21 | - name: Add docker apt repo |
| 22 | apt_repository: |
| 23 | repo="deb https://apt.dockerproject.org/repo ubuntu-trusty main" |
| 24 | |
| 25 | - name: Install docker |
| 26 | apt: |
| 27 | update_cache=yes |
| 28 | cache_valid_time=3600 |
| 29 | name=docker-engine |
| 30 | |
| 31 | - name: Make user part of the Docker group |
| 32 | user: |
| 33 | name={{ ansible_user_id }} |
| 34 | groups="docker" append=yes |
| 35 | |
| 36 | # https://docs.docker.com/compose/install/#install-using-pip |
| 37 | - name: Install docker-compose from PyPi |
| 38 | pip: |
| 39 | name=docker-compose |
| 40 | |