Add example role

This commit is contained in:
uumas
2024-11-08 04:29:08 +02:00
parent 3fbd737eb6
commit 0dd0dc97a0
3 changed files with 45 additions and 0 deletions

1
roles/example/README.md Normal file
View File

@@ -0,0 +1 @@
Sets up a hello world podman container. This role can be used as a template for other roles using the container role.

View File

@@ -0,0 +1,11 @@
---
argument_specs:
main:
description: "Sets up a hello world podman container. This role can be used as a template for other roles using the container role."
options:
example_domains:
description: A list of domains the container should listen on
type: list
required: false
default: []
elements: str

View File

@@ -0,0 +1,33 @@
---
- name: Hello world container
ansible.builtin.include_role:
name: service
vars:
service_name: hello-world
service_container_image: "docker.io/library/hello-world:latest"
service_container_mounts:
- type: volume
source: config
destination: /config
- type: bind
source: /media/hello-world
destination: /media
- type: bind
source: /etc/locale.conf
destination: /etc/locale.conf
readonly: true
service_container_http_port: 8080
service_domains: "{{ example_domains }}"
service_container_publish_ports:
- "127.0.0.1:8080:8080"
- "0.0.0.0:4443:8043"
service_requires:
- network-online.target
service_container_env:
TZ: "Etc/UTC"
service_additional_containers:
name: worker
# image: "docker.io/library/hello-world:latest"
mounts: []
publish_ports: []
# env: {}