Created
April 10, 2019 12:59
-
-
Save sualex/a40e08179f5198b2eb92e84938f9d5a8 to your computer and use it in GitHub Desktop.
ubuntu-ansible-docker-install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
################################################## | |
# This standalone playbook uses Docker's official Ubuntu 18.04 repository | |
# https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04 | |
################################################## | |
- hosts: all | |
become: true | |
vars: | |
ansible_python_interpreter: "/usr/bin/env python3" | |
tasks: | |
- name: "APT - Add Docker GPG key" | |
apt_key: | |
url: https://download.docker.com/linux/ubuntu/gpg | |
state: present | |
- name: "APT - Add Docker repository" | |
apt_repository: | |
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" | |
state: present | |
filename: docker | |
- name: "APT - install misc packages" | |
apt: | |
name: "{{ item }}" | |
update_cache: yes | |
with_items: | |
- "aptitude" | |
- "apt-transport-https" | |
- "ca-certificates" | |
- "curl" | |
- "software-properties-common" | |
- name: "APT - install 'docker-ce'" | |
apt: | |
name: "docker-ce" | |
update_cache: yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment