samdoran/ansible-role-gitlab

Order of apt operations on Debian

tszym opened this issue · 2 comments

tszym commented

Hi,

There is an issue when executing this role on Debian Jessie. I tested this on version 3.1.1 of this role.

The repo file is added to the system before the inclusion of the Debian specific tasks file and the apt tasks.
At this point, the role will failt at the cache update of the apt task because the apt-transport-https package is not installed yet, and apt cannot use the previously added repo. It will be installed too late.

Ansible output:

TASK [samdoran.gitlab : DEBIAN | Install support packages] *********************
fatal: [debian]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to update apt cache."}

On the host:

user@jessie:~$ sudo apt-get update
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?

The issue is solved by installing the apt-transport-https package before calling this role.

Thanks for bringing this to my attention. Looking into it now.

Looks like setting update_cache: no on the Install support packages task is sufficient to fix this.