Skip to content

Commit

Permalink
made it a little prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei Mikhaltsov committed Aug 1, 2024
1 parent 0dd4761 commit 04e7e3f
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions tasks/install_remote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,37 @@

- 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: yes

Check failure on line 22 in tasks/install_remote.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[truthy]

Truthy value should be one of \[false, true]
use_proxy: "{{ use_proxy }}"
register: checksum_file
failed_when: checksum_file.status != 200
tags:
- installation

- name: Find checksum line

Check failure on line 29 in tasks/install_remote.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

fqcn[action-core]

Use FQCN for builtin module actions (set_fact).
set_fact:
consul_sha256: "{{ (checksum_file.content.splitlines() | select('search', consul_pkg) | first).split()[0] }}"
tags:
- installation

- name: Read Consul package checksum

Check failure on line 35 in tasks/install_remote.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

command-instead-of-shell

Use shell only when shell functionality is required.
ansible.builtin.shell: grep {{ consul_pkg }} {{ consul_temp_dir.path }}/consul_{{ consul_version }}_SHA256SUMS
register: consul_sha256
changed_when: false
tags:
- installation
- skip_ansible_lint

- name: Download Consul # noqa risky-file-permissions
- name: Download Consul

Check failure on line 42 in tasks/install_remote.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

risky-file-permissions

File permissions unset or incorrect.
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 04e7e3f

Please sign in to comment.