Skip to content
Snippets Groups Projects
Commit 752188a2 authored by Chris Croome's avatar Chris Croome
Browse files

Use jc to extract GPG fingerprints

parent 7778a63d
No related branches found
Tags 3.2.1
No related merge requests found
Pipeline #21957 passed
......@@ -4,7 +4,6 @@
Ansible Role to install [Docker CE](https://docs.docker.com/engine/installation/linux/docker-ce/debian/) on Debian and Ubuntu.
This role can also optionally install the last version of `docker-compose` version 1, [Docker Compose 1.29.2 ](https://github.com/docker/compose/tree/5becea4ca9f68875334c92f191a13482bcd6e5cf#docker-compose) and [Compose Switch](https://github.com/docker/compose-switch).
See the [defaults/main.yml](defaults/main.yml) for the default settings and [vars/main.yml](vars/main.yml) for the `gpg` and `apt` variables.
......@@ -71,7 +70,13 @@ docker_daemon:
- 9.9.9.9
```
The role uses `.sources` rather than `.list` files for `apt` and it also checks the `gpg` public key used to sign packages and limits what packages can be installed from the Docker repo.
The role uses `.sources` rather than `.list` files for `apt`, see the Debian wiki page with [instructions to connect to a third-party repository](https://wiki.debian.org/DebianRepository/UseThirdParty) and it also checks the `gpg` public key used to sign packages and limits what packages can be installed from the Docker repo.
This role requires [jc](https://github.com/kellyjonbrazil/jc) version `1.20.2` or later to be installed on the Ansible controller using `pip` for the parsing of GPG command output, `jc` can be [installed using Ansible](https://git.coop/webarch/jc/), or simply run:
```bash
pip3 install jc
```
The primary URL of this repo is [`https://git.coop/webarch/docker`](https://git.coop/webarch/docker) however it is also [mirrored to GitHub](https://github.com/webarch-coop/ansible-role-docker) and [available via Ansible Galaxy](https://galaxy.ansible.com/chriscroome/docker).
......
......@@ -92,19 +92,11 @@
ansible.builtin.set_fact:
docker_gpg_fingerprints_found: "{{ docker_gpg.stdout | community.general.jc('gpg') | community.general.json_query('[?type==`fpr`].user_id') | list }}"
- name: Debug vars
debug:
var: docker_gpg_fingerprints_found
- name: Debug vars
debug:
var: docker_gpg_fingerprints[0]
- name: Docker gpg key check first fingerprint for GPG versions less that 2.2.12
ansible.builtin.assert:
that:
- docker_gpg_fingerprints_found[0] == docker_gpg_fingerprints[0]
# when: ansible_local.gpg.version is version('2.2.12', '<')
when: ansible_local.gpg.version is version('2.2.12', '<')
- name: Docker gpg key check all fingerprints
ansible.builtin.assert:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment