Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the client task idempotent #48

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion roles/client/tasks/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
msg: Set uyuni_server to a valid server hostname/FQDN
when: uyuni_server is undefined

- name: Check if the uyuni_repo_file exists
ansible.builtin.stat:
path: "{{ uyuni_repo_file }}"
register: stat_uyuni_repo_file

- name: Download Uyuni bootstrap script
when: stat_uyuni_repo_file.stat.exists == false
ansible.builtin.get_url:
url: "http://{{ uyuni_server }}/pub/bootstrap/{{ uyuni_bootstrap_filename }}"
dest: "{{ uyuni_bootstrap_folder }}/bootstrap.sh"
Expand All @@ -20,7 +26,7 @@
creates: "{{ uyuni_repo_file }}"
become: true

- name: Remove downloded bootsrap script
- name: Remove downloaded bootstrap script
ansible.builtin.file:
path: "{{ uyuni_bootstrap_folder }}/bootstrap.sh"
state: absent
Expand Down