Skip to content

Simple Ansible playbook to install docker and docker-compose on your systems

Notifications You must be signed in to change notification settings

SjamonDaal/ansible-docker-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible - Docker Setup

This Ansible playbook install docker and docker-compose with the latest version of docker.

Documentation

Ansible tags list

  • docker
  • Just installs docker and skips other tags.
  • docker-compose
  • Just installs docker-compose and skips other tags.

Example for the hosts.yml file

Example with DNS hostnames and the same SSH username as your system

all:
  hosts:
    hostname-01:
    hostname-02:

Example with another username and no dns server that could resolve the hostnames.

all:
  hosts:
    hostname-01:
      ansible_user: ubuntu
      ansible_host: 192.168.1.10
    hostname-02:
      ansible_user: ubuntu
      ansible_host: 192.168.1.11

Example for the variables.yml file

---

- name: Set facts for environment
  set_fact:
    custom_user:
      available: true
      username: ubuntu
    docker:
      # Docker versions: stable, nightly, test
      version: stable
    docker_compose:
      version: "1.26.0"

Example ansible commands

Default example to run the playbook

ansible-playbook -i hosts.yml site.yml -vvvv

Custom example with specific tags

ansible-playbook -i hosts.yml site.yml --tags=docker,docker-compose -vvvv

Custom example with hostname limit

ansible-playbook -i hosts.yml site.yml --limit=hostname-01 -vvvv

Credits

Build and Managed by: Djamon Staal

About

Simple Ansible playbook to install docker and docker-compose on your systems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published