Created
October 23, 2023 14:29
-
-
Save tomwalsh/91fe0c5b579c2687f053a1d9447dd2f6 to your computer and use it in GitHub Desktop.
Ansible playbook checking for docker.gpg on Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Check for the Docker GPG key | |
stat: | |
path: /etc/apt/trusted.gpg.d/docker.gpg | |
register: docker_key | |
- name: Download the Docker GPG key | |
get_url: | |
url: https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg | |
dest: "/tmp/docker.gpg" | |
mode: '0777' | |
when: not docker_key.stat.exists | |
- name: Install the Docker GPG key | |
command: | |
cmd: "gpg --dearmor -o /etc/apt/trusted.gpg.d/docker.gpg /tmp/docker.gpg" | |
when: not docker_key.stat.exists |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment