1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-03-22 02:29:08 +00:00

Add option for inline Containerfile in podman_image (#781)

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
This commit is contained in:
Sergey 2024-06-09 14:37:33 +03:00 committed by GitHub
parent fb6ebaae55
commit e60d54f629
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 108 additions and 24 deletions

View file

@ -370,6 +370,50 @@
path: /var/tmp/build
register: build_image2
- name: Build image from a given Containerfile
containers.podman.podman_image:
executable: "{{ test_executable | default('podman') }}"
name: testimage2:customfile
path: "{{ playbook_dir }}"
build:
container_file: |-
FROM quay.io/coreos/alpine-sh
RUN echo "Hello World" > /tmp/hello.txt
register: build_custom1
- name: Build image from a given Containerfile w/o path
containers.podman.podman_image:
executable: "{{ test_executable | default('podman') }}"
name: testimage2:customfile2
state: build
build:
container_file: |-
FROM quay.io/coreos/alpine-sh
RUN echo "Hello2 World" > /tmp/hello2.txt
force: true
register: build_custom2
- name: Build image from a given Containerfile and file (fail)
containers.podman.podman_image:
executable: "{{ test_executable | default('podman') }}"
name: testimage2:failme
state: build
build:
container_file: |-
FROM quay.io/coreos/alpine-sh
RUN echo "Hello2 World" > /tmp/hello2.txt
file: /var/tmp/build/Dockerfile
force: true
register: fail_custom_image
ignore_errors: true
- name: Check if image was built properly
assert:
that:
- build_custom1 is changed
- build_custom2 is changed
- fail_custom_image is failed
- include_tasks: idem_push.yml
- name: Create a Quadlet for image with filename