scottslowe-learning-tools/docker/docker-ce-edge/provision.yml
Scott Lowe d9504bffff
Add environment for Docker CE
Add environment to run Docker CE on Ubuntu 16.04, provisioned by Ansible

Signed-off-by: Scott Lowe <scott.lowe@scottlowe.org>
2017-05-17 12:50:57 -06:00

48 lines
1,006 B
YAML

---
- hosts: "all"
become: "yes"
remote_user: "ubuntu"
tasks:
- name: "Install Pip"
apt:
name: "python-pip"
state: "present"
update_cache: "yes"
- name: "Install some Python modules"
pip:
name: "{{ item }}"
state: "present"
with_items:
- "urllib3"
- "pyopenssl"
- "ndg-httpsclient"
- "pyasn1"
- name: "Install Docker APT Key"
apt_key:
url: "https://download.docker.com/linux/ubuntu/gpg"
state: "present"
- name: "Add Docker repository"
apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial edge"
state: "present"
update_cache: "yes"
- name: "Install Docker CE Edge"
package:
name: "docker-ce"
state: "present"
- name: "Add user to Docker group"
user:
name: "{{ ansible_ssh_user }}"
group: "docker"
append: "yes"
- name: "Restart Docker daemon"
systemd:
name: "docker"
state: "restarted"