Last active
October 1, 2023 17:48
-
-
Save Kyuubang/4fd98b59ab811562b9214b90575e29e5 to your computer and use it in GitHub Desktop.
sample ansible playbook for install docker
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
- 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