97b95f1686
And make centos8 jobs non voting Change-Id: I0002a53f6e2c3582b6de33d8c3e71101ff474196
84 lines
2.6 KiB
YAML
84 lines
2.6 KiB
YAML
---
|
|
- name: "Set centos image facts"
|
|
set_fact:
|
|
centos_image_file: ~/centos9-wholedisk.qcow2
|
|
centos_initramfs_file: ~/centos9-partition.initrd
|
|
centos_kernel_file: ~/centos9-partition.vmlinuz
|
|
centos_partition_file: ~/centos9-partition.qcow2
|
|
|
|
- name: Install kpartx
|
|
package:
|
|
name: kpartx
|
|
state: present
|
|
become: true
|
|
|
|
- name: Install DIB
|
|
pip:
|
|
name: diskimage-builder
|
|
become: true
|
|
vars:
|
|
ansible_python_interpreter: /usr/bin/{{ metalsmith_python | default('python') }}
|
|
|
|
- name: Make kernel files readable (workaround for Ubuntu)
|
|
shell: chmod 0644 /boot/vmlinuz-*
|
|
become: true
|
|
|
|
- name: Detect the right block device element
|
|
set_fact:
|
|
centos_block_device: block-device-efi
|
|
when: metalsmith_boot_mode | default('uefi') != 'bios'
|
|
|
|
- name: Build a centos9 wholedisk image
|
|
command: >
|
|
disk-image-create centos grub2 vm {{ centos_block_device | default('') }}
|
|
-o centos9-wholedisk
|
|
environment:
|
|
DIB_RELEASE: 9-stream
|
|
|
|
- name: Build a centos9 partition image
|
|
command: disk-image-create centos grub2 baremetal -o centos9-partition
|
|
environment:
|
|
DIB_RELEASE: 9-stream
|
|
|
|
- name: Upload the CentOS whole-disk image
|
|
command: >
|
|
openstack image create --disk-format qcow2
|
|
--public --file {{ centos_image_file }}
|
|
{{ centos_glance_whole_disk_image }}
|
|
environment:
|
|
OS_CLOUD: devstack-admin
|
|
when: centos_glance_whole_disk_image is defined
|
|
|
|
- name: Upload the CentOS kernel image
|
|
command: >
|
|
openstack image create --disk-format aki --container-format aki \
|
|
--public --file {{ centos_kernel_file }} -f value -c id
|
|
{{ centos_glance_kernel_image }}
|
|
register: centos_kernel_id
|
|
failed_when: centos_kernel_id.stdout == ""
|
|
environment:
|
|
OS_CLOUD: devstack-admin
|
|
when: centos_glance_kernel_image is defined
|
|
|
|
- name: Upload the CentOS initramfs image
|
|
command: >
|
|
openstack image create --disk-format ari --container-format ari \
|
|
--public --file {{ centos_initramfs_file }} -f value -c id
|
|
{{ centos_glance_initramds_image }}
|
|
register: centos_initramfs_id
|
|
failed_when: centos_initramfs_id.stdout == ""
|
|
environment:
|
|
OS_CLOUD: devstack-admin
|
|
when: centos_glance_initramds_image is defined
|
|
|
|
- name: Upload the CentOS partition image
|
|
command: >
|
|
openstack image create --disk-format qcow2
|
|
--public --file {{ centos_partition_file }}
|
|
--property kernel_id={{ centos_kernel_id.stdout }}
|
|
--property ramdisk_id={{ centos_initramfs_id.stdout }}
|
|
{{ centos_glance_root_image }}
|
|
environment:
|
|
OS_CLOUD: devstack-admin
|
|
when: centos_glance_root_image is defined
|