Skip to content

Instantly share code, notes, and snippets.

@Akkiesoft
Created December 12, 2017 04:55
Show Gist options
  • Save Akkiesoft/985cf0de1025b38bc73afbcf94f13f7c to your computer and use it in GitHub Desktop.
Save Akkiesoft/985cf0de1025b38bc73afbcf94f13f7c to your computer and use it in GitHub Desktop.
Debian/UbuntuにDockerをインストールするやつ
- hosts: docker
become: yes
tasks:
- apt:
name:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
update_cache: yes
cache_valid_time: 3600
state: present
- apt_key:
url: https://download.docker.com/linux/{{ansible_distribution|lower}}/gpg
state: present
- apt_repository:
repo: "deb https://download.docker.com/linux/{{ansible_distribution|lower}} {{ansible_distribution_release}} stable"
state: present
- apt:
name: docker-ce
state: present
update_cache: yes
cache_valid_time: 3600
- group:
name: docker
state: present
- user:
append: yes
groups: docker
name: "{{ ansible_ssh_user }}"
changed_when: no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment