Turn shell task into smaller Ansible tasks
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul Brinkmeier 2022-09-15 13:58:48 +02:00
parent ef9d3d0beb
commit 045506a9ab

View File

@ -11,14 +11,21 @@
- gnupg
- lsb-release
- name: Add Docker GPG key # noqa command-instead-of-module risky-shell-pipe
- name: Retrieve Docker GPG key
ansible.builtin.uri:
url: https://download.docker.com/linux/debian/gpg
return_content: true
register: docker_gpg_key
- name: Install Docker GPG key
become: true
ansible.builtin.shell: "curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg"
ansible.builtin.command: "gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg"
args:
stdin: "{{ docker_gpg_key.content }}"
creates: /usr/share/keyrings/docker-archive-keyring.gpg
- name: Retrieve dpkg architecture # noqa command-instead-of-shell
ansible.builtin.shell: dpkg --print-architecture
- name: Retrieve dpkg architecture
ansible.builtin.command: dpkg --print-architecture
register: dpkg_architecture
changed_when: false