Distribution to run can be selected when running `ansible-playbook` by
appending `-e 'distribution=fedora'` to the command.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
- name: Start build container
hosts: localhost
+ vars:
+ image:
+ fedora: registry.fedoraproject.org/fedora:latest
+ alpine: docker.io/library/alpine:latest
+ debian: docker.io/library/debian:latest
+
roles:
- role: build_container
- vars:
- container_image: registry.fedoraproject.org/fedora:latest
- name: CI run
hosts: builder
# tasks file for build_container
- name: Pull container image
containers.podman.podman_image:
- name: '{{ container_image }}'
+ name: '{{ image[distribution] }}'
- name: Create and start container
containers.podman.podman_container:
name: builder
state: started
- image: '{{ container_image }}'
+ image: '{{ image[distribution] }}'
command: "sleep 1d"
- name: Create repo
---
# tasks file for ci_run
- name: 'Include distribution specific ci_run tasks fedora'
- include_tasks: '{{ include_file }}'
- loop_control:
- loop_var: include_file
- with_first_found:
- - files: fedora.yml
+ include_tasks: '{{ distribution }}.yml'