Skip to content

Commit b843be8

Browse files
authored
Make the client task idempotent (#48)
* add check for bootstrap file, make task idempotent * fix typo in task name
1 parent 02db537 commit b843be8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

roles/client/tasks/bootstrap.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
msg: Set uyuni_server to a valid server hostname/FQDN
55
when: uyuni_server is undefined
66

7+
- name: Check if the uyuni_repo_file exists
8+
ansible.builtin.stat:
9+
path: "{{ uyuni_repo_file }}"
10+
register: stat_uyuni_repo_file
11+
712
- name: Download Uyuni bootstrap script
13+
when: stat_uyuni_repo_file.stat.exists == false
814
ansible.builtin.get_url:
915
url: "http://{{ uyuni_server }}/pub/bootstrap/{{ uyuni_bootstrap_filename }}"
1016
dest: "{{ uyuni_bootstrap_folder }}/bootstrap.sh"
@@ -20,7 +26,7 @@
2026
creates: "{{ uyuni_repo_file }}"
2127
become: true
2228

23-
- name: Remove downloded bootsrap script
29+
- name: Remove downloaded bootstrap script
2430
ansible.builtin.file:
2531
path: "{{ uyuni_bootstrap_folder }}/bootstrap.sh"
2632
state: absent

0 commit comments

Comments
 (0)