aboutsummaryrefslogtreecommitdiffstats
path: root/roles/vmm/tasks/init_alpine.yml
blob: da0a33caebcf535d4f38e023308adda399807182 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

# vmm ~~ tasks/init_alpine.yml

---

- set_fact:
    dest_symlink: "{{ vmm.iso.dir }}/{{ vmm.iso.alpine.name }}-latest.iso"

- set_fact:
    dest_iso: "{{ dest_symlink | regex_replace('latest', vmm.iso.alpine.version) }}"
    url_iso: "{{ vmm.iso.alpine.url | regex_replace('VERSION', vmm.iso.alpine.version) }}"

- name: Check latest Alpine iso on disk
  stat:
    path: "{{ dest_iso }}"
  register: dest_result

- name: Get latest Alpine iso
  get_url:
    url: "{{ url_iso }}"
    dest: "{{ dest_iso }}"
    checksum: "sha256:{{ url_iso }}.sha256"
  when: not dest_result.stat.exists

- name: Symlink latest iso
  file:
    src: "{{ dest_iso }}"
    dest: "{{ dest_symlink }}"
    #owner: "{{ vmm.user }}"
    #group: "{{ vmm.group }}"
    state: link
remember that computers suck.