blob: ba04debb0ae0569c661af32055fc0295f5fbbc45 [file] [log] [blame]
---
# pxeboot tasks/ubuntu1804.yml
#
# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
# SPDX-License-Identifier: Apache-2.0
- name: Create ubuntu1804 dir in webroot
file:
state: directory
path: "{{ pxeboot_web_root }}/ubuntu1804"
owner: "{{ pxeboot_username }}"
group: "{{ pxeboot_groupname }}"
mode: "0755"
- name: Download ubuntu1804 files
get_url:
url: "{{ pxeboot_ubuntu1804_base_url }}/{{ pxeboot_ubuntu1804_version }}/{{ item['name'] }}"
dest: "{{ pxeboot_web_root }}/ubuntu1804/{{ item['name'] }}"
checksum: "{{ item['checksum'] }}"
owner: "{{ pxeboot_username }}"
group: "{{ pxeboot_groupname }}"
mode: "0644"
with_items: "{{ pxeboot_ubuntu1804_files }}"
- name: Create preseed files (serial)
template:
src: "ubuntu1804_preseed.cfg.j2"
dest: "{{ pxeboot_web_root }}/ubuntu1804/{{ item['serial'] }}_preseed.cfg"
owner: "{{ pxeboot_username }}"
group: "{{ pxeboot_groupname }}"
mode: "0644"
with_items: "{{ pxeboot_hosts }}"
when: "'serial' in item and item.serial"
- name: Create preseed files (MAC)
template:
src: "ubuntu1804_preseed.cfg.j2"
dest: "{{ pxeboot_web_root }}/ubuntu1804/{{ item['mac_address'] | lower }}_preseed.cfg"
owner: "{{ pxeboot_username }}"
group: "{{ pxeboot_groupname }}"
mode: "0644"
with_items: "{{ pxeboot_hosts }}"
when: "'mac_address' in item and item.mac_address"