Skip to content

Instantly share code, notes, and snippets.

@Kyuubang
Last active October 1, 2023 17:48
Show Gist options
  • Save Kyuubang/4fd98b59ab811562b9214b90575e29e5 to your computer and use it in GitHub Desktop.
Save Kyuubang/4fd98b59ab811562b9214b90575e29e5 to your computer and use it in GitHub Desktop.
sample ansible playbook for install docker
- hosts: 'master, worker'
become: yes
tasks:
- name: update and install dependencies
apt:
name:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
update_cache: yes
- name: add key repo
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: add docker repo
apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
state: present
filename: docker
- name: install docker-ce
apt:
name: docker-ce
state: present
- name: make sure docker is running
ansible.builtin.service:
name: docker
state: started
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment