Add example role
This commit is contained in:
1
roles/example/README.md
Normal file
1
roles/example/README.md
Normal 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.
|
||||
11
roles/example/meta/argument_specs.yml
Normal file
11
roles/example/meta/argument_specs.yml
Normal 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
|
||||
33
roles/example/tasks/main.yml
Normal file
33
roles/example/tasks/main.yml
Normal 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: {}
|
||||
Reference in New Issue
Block a user