Add an end-to-end qcow2 test that follows a customer's steps with `composer-cli`. The image is booted with libvirt to allow the best virtualization options to be chosen by libvirt. It also uses libvirt's default network. Signed-off-by: Major Hayden <major@redhat.com>
27 lines
No EOL
881 B
Bash
Executable file
27 lines
No EOL
881 B
Bash
Executable file
#!/bin/bash
|
|
set -euxo pipefail
|
|
|
|
# Get OS details.
|
|
source /etc/os-release
|
|
|
|
# Set up a dnf repository for the RPMs we built via mock.
|
|
sudo cp osbuild-mock.repo /etc/yum.repos.d/osbuild-mock.repo
|
|
sudo dnf repository-packages osbuild-mock list
|
|
|
|
# Create temporary directories for Ansible.
|
|
sudo mkdir -vp /opt/ansible_{local,remote}
|
|
sudo chmod -R 777 /opt/ansible_{local,remote}
|
|
|
|
# Restart systemd to work around some Fedora issues in cloud images.
|
|
sudo systemctl restart systemd-journald
|
|
|
|
# Write a simple hosts file for Ansible.
|
|
echo -e "[test_instances]\nlocalhost ansible_connection=local" > hosts.ini
|
|
|
|
# Deploy osbuild/osbuild-composer via the repository we created.
|
|
export ANSIBLE_CONFIG=ansible-osbuild/ansible.cfg
|
|
git clone https://github.com/osbuild/ansible-osbuild.git ansible-osbuild
|
|
ansible-playbook \
|
|
-i hosts.ini \
|
|
-e install_source=os \
|
|
ansible-osbuild/playbook.yml |