Created
April 19, 2020 02:44
-
-
Save danggrianto/8618b28a6a56a8976f0496a6f180c4f0 to your computer and use it in GitHub Desktop.
Install docker on raspberry pi
This file contains hidden or 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
all: | |
children: | |
raspi: | |
ansible_host: <your-raspi-ip-address> | |
vars: | |
ansible_connection: ssh | |
ansible_user: pi | |
discovered_interpreter_python: /usr/bin/python3 |
This file contains hidden or 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
--- | |
- hosts: raspi | |
become: true | |
tasks: | |
- name: Install aptitude using apt | |
apt: name=aptitude state=latest update_cache=yes force_apt_get=yes | |
- name: Install required system packages | |
apt: name={{ item }} state=latest update_cache=yes | |
loop: [ 'apt-transport-https', 'ca-certificates', 'curl', 'software-properties-common', 'python3-pip', 'python3-setuptools'] | |
- name: Add Docker GPG apt Key | |
apt_key: | |
url: https://download.docker.com/linux/raspbian/gpg | |
state: present | |
- name: Add Docker Repository | |
apt_repository: | |
repo: deb https://download.docker.com/linux/raspbian stretch stable | |
state: present | |
- name: Update apt and install docker-ce | |
apt: update_cache=yes name=docker-ce state=latest install_recommends=no | |
- name: adding user pi to docker group | |
user: | |
name: pi | |
groups: docker | |
append: yes | |
- name: install docker compose | |
pip: | |
name: docker-compose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment