Skip to content

Commit 7d1dfa9

Browse files
committed
Refactor Flux CLI installation conditions to use registered download status
1 parent ccc281c commit 7d1dfa9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

roles/flux/tasks/main.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
dest: /tmp/flux.tar.gz
1717
mode: '0644'
1818
when: flux_installed_version != flux_target_version
19+
register: flux_download
1920

2021
- name: Extract Flux CLI
2122
unarchive:
2223
src: /tmp/flux.tar.gz
2324
dest: /tmp/
2425
remote_src: yes
25-
when: flux_installed_version != flux_target_version
26+
when: flux_download is changed
2627

2728
- name: Install/Upgrade Flux CLI
2829
copy:
@@ -32,7 +33,7 @@
3233
owner: root
3334
group: root
3435
remote_src: yes
35-
when: flux_installed_version != flux_target_version
36+
when: flux_download is changed
3637

3738
- name: Clean up Flux download files
3839
file:
@@ -41,7 +42,7 @@
4142
loop:
4243
- /tmp/flux.tar.gz
4344
- /tmp/flux
44-
when: flux_installed_version != flux_target_version
45+
when: flux_download is changed
4546

4647
- name: Check if Flux is already installed in cluster
4748
shell: k0s kubectl get namespace {{ flux_namespace }}

0 commit comments

Comments
 (0)