dokku / ansible-dokku

Ansible modules for installing and configuring Dokku
MIT License
171 stars 44 forks source link

Does not install docker #15

Closed adongy closed 4 years ago

adongy commented 5 years ago

Unlike the dokku bootstrap.sh install script, this playbook does not seem to install docker (it only install the apt repository), which breaks the install if you don't have it installed, as herokuish will fail, complaining about the missing docker daemon.

It would be great to mirror the bootstrap.sh script, or at least mention that a running docker daemon is required (in which case adding the docker apt repo seems useless, as the user already installed docker?)

Thanks

notapatch commented 5 years ago

Hello adongy,

I'm not the maintainer. But I was trying to understand your issue as I have my own problems with herokuish deployment. When I run this minimal script using the most recent ansible_dokku role:

---
- hosts: all
  roles:
    - dokku_bot.ansible_dokku
  vars:
    dokku_version: '0.16.4'
    plugn_version: '0.3.2'
    ansible_user: root
    ansible_python_interpreter: /usr/bin/python3
    dokku_skip_key_file: true
  pre_tasks:
    - name: Update apt cache if needed
      apt: update_cache=yes cache_valid_time=3600
      retries: 5

It seems to install docker on the following task: TASK [dokku_bot.ansible_dokku : install dokku packages]

The code of which is here:

- name: install dokku packages
  apt:
    name: "{{ item.key }}={{ item.value }}"
  with_dict:
    plugn: "{{ plugn_version }}"
    sshcommand: "{{ sshcommand_version }}"
    herokuish: "{{ herokuish_version }}"
    dokku: "{{ dokku_version }}"
  tags:
    - dokku
    - dokku-install

When I ssh to the server after the playbook has finished.

It shows docker has installed

docker --version
Docker version 18.09.6, build 481bc77

And the docker daemon

sudo systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-05-22 16:50:36 CEST; 23min ago
     Docs: https://docs.docker.com
 Main PID: 17919 (dockerd)
    Tasks: 12
   Memory: 1.2G
      CPU: 39.568s
   CGroup: /system.slice/docker.service
           └─17919 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

May 22 16:50:36 cava dockerd[17919]: time="2019-05-22T16:50:36.776924566+02:00" level=warning msg="Your kernel does not support swap memory limit"
May 22 16:50:36 cava dockerd[17919]: time="2019-05-22T16:50:36.777008260+02:00" level=warning msg="Your kernel does not support cgroup rt period"
May 22 16:50:36 cava dockerd[17919]: time="2019-05-22T16:50:36.777020870+02:00" level=warning msg="Your kernel does not support cgroup rt runtime"
May 22 16:50:36 cava dockerd[17919]: time="2019-05-22T16:50:36.777479485+02:00" level=info msg="Loading containers: start."
May 22 16:50:36 cava dockerd[17919]: time="2019-05-22T16:50:36.853753065+02:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to s
May 22 16:50:36 cava dockerd[17919]: time="2019-05-22T16:50:36.883972190+02:00" level=info msg="Loading containers: done."
May 22 16:50:36 cava dockerd[17919]: time="2019-05-22T16:50:36.919633030+02:00" level=info msg="Docker daemon" commit=481bc77 graphdriver(s)=overlay2 version=18.09.6
May 22 16:50:36 cava dockerd[17919]: time="2019-05-22T16:50:36.919704635+02:00" level=info msg="Daemon has completed initialization"
May 22 16:50:36 cava dockerd[17919]: time="2019-05-22T16:50:36.934353288+02:00" level=info msg="API listen on /var/run/docker.sock"
May 22 16:50:36 cava systemd[1]: Started Docker Application Container Engine.

How are you seeing it?

thelittlebug commented 5 years ago

im just a random stranger, hopping between repos. for me it seems the installation of docker is planned https://github.com/dokku/ansible-dokku/blob/1cf3cf4f14dfcf4dbcbb356dd99af70c81a2e4cc/tasks/install.yml#L42

josegonzalez commented 5 years ago

Installing dokku should install docker, as the dokku deb depends on docker...

ltalirz commented 4 years ago

I confirm that the dokku ansible role installs docker. I believe this issue can be closed.