You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.2 KiB
47 lines
1.2 KiB
---
|
|
|
|
- name: Add Docker s official GPG key
|
|
remote_user: ubuntu
|
|
apt_key:
|
|
url: https://download.docker.com/linux/ubuntu/gpg
|
|
state: present
|
|
|
|
- name: Verify that we have the key with the fingerprint
|
|
remote_user: ubuntu
|
|
apt_key:
|
|
id: 0EBFCD88
|
|
state: present
|
|
|
|
- name: Add deb repository
|
|
apt_repository:
|
|
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
|
|
state: present
|
|
update_cache: yes
|
|
|
|
- name: Update apt packages
|
|
remote_user: ubuntu
|
|
apt:
|
|
update_cache: yes
|
|
|
|
- name: Install docker
|
|
remote_user: ubuntu
|
|
apt:
|
|
name: docker-ce
|
|
state: present
|
|
update_cache: yes
|
|
|
|
- name: Create Docker group
|
|
group: name=docker state=present
|
|
|
|
- name: Add current user to Docker group
|
|
user: name="{{ ansible_env.USER }}" groups=docker append=yes
|
|
|
|
- name: "Ensure Docker is {{ docker.start | ternary('started','stopped') }}"
|
|
service: name=docker state={{ docker.start | ternary('restarted','stopped') }} enabled={{ docker.service_enabled }}
|
|
|
|
- name: Install docker-compose
|
|
get_url:
|
|
url: https://github.com/docker/compose/releases/download/1.27.4/docker-compose-Linux-x86_64
|
|
dest: /usr/local/bin/docker-compose
|
|
force: no
|
|
mode: 0755
|