Update setup-Debian.yml to support Ubuntu16 (#2)

* Add conditions to use apt-key for old versions of ubuntu (16.04 and older)
This commit is contained in:
berthin 2022-11-09 14:10:22 +01:00 committed by GitHub
parent 9154e3bf75
commit 5c0726e7d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,17 +33,22 @@
force: true
register: add_repository_key
ignore_errors: "{{ docker_apt_ignore_key_error }}"
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('18.04', '>=')
- name: Ensure curl is present (on older systems without SNI).
package: name=curl state=present
when: add_repository_key is failed
when: >
(add_repository_key is skipped)
or (add_repository_key is failed)
- name: Add Docker apt key (alternative for older systems without SNI).
shell: >
curl -sSL {{ docker_apt_gpg_key }} | apt-key add -
args:
warn: false
when: add_repository_key is failed
when: >
(add_repository_key is skipped)
or (add_repository_key is failed)
- name: Add Docker repository.
apt_repository: