mirror of
https://codeberg.org/scottslowe/learning-tools.git
synced 2026-03-11 09:04:37 +00:00
Add environment to run Docker CE on Ubuntu 16.04, provisioned by Ansible Signed-off-by: Scott Lowe <scott.lowe@scottlowe.org>
48 lines
1,006 B
YAML
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"
|