From 9d4fb2fd3ff2bd147d6c08d8b398fdb3d0039f00 Mon Sep 17 00:00:00 2001 From: Federico Capoano Date: Fri, 5 Jul 2024 10:42:39 -0400 Subject: [PATCH] [chores] Add InfluxData key using get_url + retries --- tasks/main.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 83a0ae2..9f5f283 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -24,23 +24,27 @@ - name: Install system dependencies apt: name: - - curl - rsyslog cache_valid_time: 3000 state: latest tags: [influxdb] -- name: Add influxdb key - shell: | - curl -s https://repos.influxdata.com/influxdata-archive_compat.key -o influxdata-archive_compat.key - echo '393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c influxdata-archive_compat.key' | sha256sum -c && cat influxdata-archive_compat.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null +- name: Add InfluxData key + get_url: + url: https://repos.influxdata.com/influxdata-archive_compat.key + dest: /etc/apt/trusted.gpg.d/influxdata-archive_compat.asc + checksum: sha256:393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c + ignore_errors: true + retries: 5 + delay: 10 + register: result + until: result is success tags: - influxdb - - molecule-idempotence-notest - name: Add influxdb repo apt_repository: - repo: "deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/{{ ansible_distribution.lower() }} stable main" + repo: "deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.asc] https://repos.influxdata.com/{{ ansible_distribution.lower() }} stable main" state: present tags: [influxdb]