Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
1
Language: Text
Posted by: Massimo Zappino
Added: Nov 15, 2018 11:29 AM
Modified: Nov 15, 2018 1:44 PM
Views: 7
Install Docker with Ansible Playbook
  1. ---
  2. - hosts: all
  3.   become: true
  4.   tasks:
  5.   - name:    Install prerequisites
  6.     apt:     name={{item}} update_cache=yes
  7.     with_items:
  8.     - apt-transport-https
  9.     - ca-certificates
  10.     - curl
  11.     - software-properties-common
  12.   - name:    Add Docker GPG key
  13.     apt_key: url=https://download.docker.com/linux/ubuntu/gpg
  14.   - name:    Add Docker APT repository
  15.     apt_repository:
  16.       repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ansible_distribution_release}} stable
  17.   - name:    Install Docker
  18.     apt:     name=docker-ce