From 0dd0dc97a0167f51b25abb0a2d0084044eb04db3 Mon Sep 17 00:00:00 2001 From: uumas Date: Fri, 8 Nov 2024 04:29:08 +0200 Subject: [PATCH] Add example role --- roles/example/README.md | 1 + roles/example/meta/argument_specs.yml | 11 +++++++++ roles/example/tasks/main.yml | 33 +++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 roles/example/README.md create mode 100644 roles/example/meta/argument_specs.yml create mode 100644 roles/example/tasks/main.yml diff --git a/roles/example/README.md b/roles/example/README.md new file mode 100644 index 0000000..8d2a982 --- /dev/null +++ b/roles/example/README.md @@ -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. diff --git a/roles/example/meta/argument_specs.yml b/roles/example/meta/argument_specs.yml new file mode 100644 index 0000000..c2e5c2d --- /dev/null +++ b/roles/example/meta/argument_specs.yml @@ -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 diff --git a/roles/example/tasks/main.yml b/roles/example/tasks/main.yml new file mode 100644 index 0000000..cf397c8 --- /dev/null +++ b/roles/example/tasks/main.yml @@ -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: {}