Skip to content

Commit

Permalink
made it a little prettier (#603)
Browse files Browse the repository at this point in the history
* made it a little prettier

---------

Co-authored-by: Sergei Mikhaltsov <[email protected]>
  • Loading branch information
metanovii and Sergei Mikhaltsov authored Aug 2, 2024
1 parent 0dd4761 commit a342eef
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions tasks/install_remote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,30 @@

- name: Download and unarchive Consul
block:
- name: Read Consul package checksum file
ansible.builtin.stat:
path: "{{ consul_temp_dir.path }}/consul_{{ consul_version }}_SHA256SUMS"
register: consul_checksum
changed_when: false
tags: installation

- name: Download Consul package checksum file # noqa risky-file-permissions
ansible.builtin.get_url:
- name: Get Consul checksum
ansible.builtin.uri:
url: "{{ consul_checksum_file_url }}"
dest: "{{ consul_temp_dir.path }}/consul_{{ consul_version }}_SHA256SUMS"
validate_certs: false
tags: installation
when: not consul_checksum.stat.exists | bool
return_content: true
use_proxy: "{{ use_proxy }}"
register: checksum_file
failed_when: checksum_file.status != 200
tags:
- installation

- name: Read Consul package checksum
ansible.builtin.shell: grep {{ consul_pkg }} {{ consul_temp_dir.path }}/consul_{{ consul_version }}_SHA256SUMS
register: consul_sha256
changed_when: false
- name: Find checksum line
ansible.builtin.set_fact:
consul_sha256: "{{ (checksum_file.content.splitlines() | select('search', consul_pkg) | first).split()[0] }}"
tags:
- installation
- skip_ansible_lint

- name: Download Consul # noqa risky-file-permissions
ansible.builtin.get_url:
url: "{{ consul_zip_url }}"
dest: "{{ consul_temp_dir.path }}/{{ consul_pkg }}"
checksum: sha256:{{ consul_sha256.stdout.split(' ') | first }}
checksum: sha256:{{ consul_sha256 }}
timeout: 42
use_proxy: "{{ use_proxy }}"
register: consul_download
tags: installation

Expand Down

0 comments on commit a342eef

Please sign in to comment.