Zack Williams | 5b5d9a7 | 2020-11-06 13:59:06 -0700 | [diff] [blame] | 1 | --- |
| 2 | # pxeboot tasks/memtest.yml |
| 3 | # |
| 4 | # SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| 5 | # SPDX-License-Identifier: Apache-2.0 |
| 6 | |
| 7 | - name: Create memtest dir in webroot |
| 8 | file: |
| 9 | state: directory |
| 10 | path: "{{ pxeboot_web_root }}/memtest" |
| 11 | owner: "{{ pxeboot_username }}" |
| 12 | group: "{{ pxeboot_groupname }}" |
| 13 | mode: "0755" |
| 14 | |
| 15 | - name: Download memtest compressed ISO |
| 16 | get_url: |
| 17 | url: > |
| 18 | http://memtest.org/download/{{ pxeboot_memtest_version }}/memtest86+-{{ pxeboot_memtest_version }}.iso.gz |
| 19 | checksum: "{{ pxeboot_memtest_checksum }}" |
| 20 | dest: "{{ pxeboot_dist_dir }}/memtest86+-{{ pxeboot_memtest_version }}.iso.gz" |
| 21 | owner: "root" |
| 22 | group: "root" |
| 23 | mode: "0644" |
| 24 | register: memtest_dl |
| 25 | |
| 26 | # ansible unarchive module can't handle bare (not tarred) gzipped files |
| 27 | # https://docs.ansible.com/ansible/latest/collections/ansible/builtin/unarchive_module.html#notes |
| 28 | - name: Decompress memtest ISO |
| 29 | command: |
| 30 | cmd: "gunzip -k {{ pxeboot_dist_dir }}/memtest86+-{{ pxeboot_memtest_version }}.iso.gz" |
| 31 | creates: "{{ pxeboot_dist_dir }}/memtest86+-{{ pxeboot_memtest_version }}.iso" |
| 32 | |
| 33 | - name: Copy memtest ISO to web root |
| 34 | copy: |
| 35 | remote_src: true |
| 36 | src: "{{ pxeboot_dist_dir }}/memtest86+-{{ pxeboot_memtest_version }}.iso" |
| 37 | dest: "{{ pxeboot_web_root }}/memtest/memtest.iso" |
| 38 | owner: "{{ pxeboot_username }}" |
| 39 | group: "{{ pxeboot_groupname }}" |
| 40 | mode: 0644 |