-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook-task-sync-images.yml
40 lines (35 loc) · 1.18 KB
/
playbook-task-sync-images.yml
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
32
33
34
35
36
37
38
39
40
- name: Sync images
hosts: "mgmt.{{domain}}"
become: true
tasks:
- name: Copy COS image
ansible.builtin.copy:
src: "images/cos.plain.{{item}}.warewulf.tar"
dest: "/root/cos.plain.{{item}}.warewulf.tar"
loop: "{{all_arch}}"
- name: Import COS image
ansible.builtin.shell: | # XXX the first import sometime fails (!)
wwctl container import "/root/cos.plain.{{item}}.warewulf.tar" "cos_plain.{{item}}" --force --syncuser || \
wwctl container import "/root/cos.plain.{{item}}.warewulf.tar" "cos_plain.{{item}}" --force --syncuser
loop: "{{all_arch}}"
async: 600
poll: 0
register: _cos_import
- name: Wait for COS image import
async_status: { jid: "{{item.ansible_job_id}}" }
register: _jobs_cos_import
retries: 600
delay: 1
until: _jobs_cos_import.finished
loop: "{{_cos_import.results}}"
- name: Configure warewulf
ansible.builtin.shell: |
wwctl overlay build
wwctl configure --all
retries: 5
delay: 2
- name: Restart warewulfd
ansible.builtin.systemd_service:
name: warewulfd
state: restarted
enabled: true