summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/roles/create-nodes/tasks/download_opnfvimage.yml
blob: a227bc4f8f7416c42284d314c5a1b6a6fdd4dece (plain)
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
---
- name: Download the {{ xci_distro }} image checksum file
  get_url:
    dest: "{{ xci_cache }}/deployment_image.qcow2.sha256.txt"
    force: no
    url: http://artifacts.opnfv.org/releng/xci/images/{{ xci_distro }}.qcow2.sha256.txt
    timeout: 3000
- name: Extract checksum
  shell: awk '{print $1}' "{{ xci_cache }}/deployment_image.qcow2.sha256.txt"
  register: _image_checksum
- fail:
    msg: "Failed to get image checksum"
  when: _image_checksum == ''
- set_fact:
    image_checksum: "{{ _image_checksum.stdout }}"
- name: Download the {{ xci_distro }} image file
  get_url:
    url: http://artifacts.opnfv.org/releng/xci/images/{{ xci_distro }}.qcow2
    checksum: "sha256:{{ image_checksum }}"
    timeout: 3000
    dest: "{{ xci_cache }}/deployment_image.qcow2"
    force: no
- name: Set correct mode for deployment_image.qcow2 file
  file:
    path: "{{ xci_cache }}/deployment_image.qcow2"
    mode: '0755'
    owner: 'root'
    group: 'root'

- name: Create copy of original deployment image
  shell: "cp {{ xci_cache }}/deployment_image.qcow2 {{ opnfv_image_path }}/opnfv.qcow2"
  become: yes