ansible-docker icon indicating copy to clipboard operation
ansible-docker copied to clipboard

apt-transport-https missing

Open src386 opened this issue 7 years ago • 3 comments

Debian 9 Stretch, ansible version:

root@debian9:~# ansible --version
ansible 2.2.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides

Playbook:

- hosts: localhost

  roles:
    - debops.docker

  vars:
    - docker__upstream: 'True'

(I use the docker__upstream var as a workaround for #51 )

Play :

root@debian9:~# ansible-playbook playbook.yml 
 [WARNING]: provided hosts list is empty, only localhost is available


PLAY [localhost] ***************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [debops.docker : Get upstream APT GPG key] ********************************
changed: [localhost]

TASK [debops.docker : Configure upstream APT repository] ***********************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: apt.cache.FetchFailedException: E:Le pilote pour la méthode /usr/lib/apt/methods/https n'a pu être trouvé., W:Is the package apt-transport-https installed?, E:Impossible de récupérer https://download.docker.com/linux/debian/dists/stretch/InRelease  , E:Le téléchargement de quelques fichiers d'index a échoué, ils ont été ignorés, ou les anciens ont été utilisés à la place.
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_kXX5UG/ansible_module_apt_repository.py\", line 538, in <module>\n    main()\n  File \"/tmp/ansible_kXX5UG/ansible_module_apt_repository.py\", line 527, in main\n    cache.update()\n  File \"/usr/lib/python2.7/dist-packages/apt/cache.py\", line 464, in update\n    raise FetchFailedException(e)\napt.cache.FetchFailedException: E:Le pilote pour la méthode /usr/lib/apt/methods/https n'a pu être trouvé., W:Is the package apt-transport-https installed?, E:Impossible de récupérer https://download.docker.com/linux/debian/dists/stretch/InRelease  , E:Le téléchargement de quelques fichiers d'index a échoué, ils ont été ignorés, ou les anciens ont été utilisés à la place.\n", "module_stdout": "", "msg": "MODULE FAILURE"}
to retry, use: --limit @/root/playbook.retry

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=1

Workaround:

apt-get install apt-transport-https

src386 avatar Jan 26 '18 19:01 src386

Currently this is not fixed, the role expects at least the debops.apt configuration to be appled on the host, that role installs apt-transport-https package. I guess a task that ensures that this package is present should be added here, epseically that upstream repository works with HTTPS. Still, this should be fixed in the DebOps monorepo where the main development is currently done.

drybjed avatar Jan 26 '18 19:01 drybjed

Thanks for this and for #51 What if I 'backport' those fixes and make a pull request ? DebOps monorepo seems to big for my needs, I like standalone ansible roles.

src386 avatar Feb 03 '18 09:02 src386

@src386 Since standalone DebOps roles from the monorepo won't be available for some time, sure - if you want, you can make a backport to debops/ansible-docker and a PR; if it passes it will be merged.

drybjed avatar Feb 03 '18 10:02 drybjed