diff --git a/roles/alpine/README.md b/roles/alpine/README.md new file mode 100644 index 0000000..ed2ebc8 --- /dev/null +++ b/roles/alpine/README.md @@ -0,0 +1 @@ +Sets up an alpine docker container. To be used as a template for other roles. diff --git a/roles/alpine/meta/argument_specs.yml b/roles/alpine/meta/argument_specs.yml new file mode 100644 index 0000000..e51aaac --- /dev/null +++ b/roles/alpine/meta/argument_specs.yml @@ -0,0 +1,60 @@ +--- + +argument_specs: + main: + short_description: Alpine container + description: "Sets up an alpine docker container. This role can be used as a template for other roles using the container role." + options: + + # All options after this will be passed directly to the container role + docker_service_suffix: + description: "A suffix used to allow running multiple instances of the same service on a host. If docker_service is gitea and docker_service_suffix production, the container will be gitea_production" + type: str + required: false + docker_host_user: + description: "If true, creates a user on the host for this service. The container will run as this user's uid/gid. Bind mount volumes will be owned by this user." + type: bool + required: false + default: true + + databse_passwords: + description: "database_passwords[docker_service] is a string with the password used for communication between the service and database. Required if docker_database is postgres or mariadb" + type: dict + required: false + docker_additional_services: + description: "List of additional services to configure (in separate containers). These will be accessible with hostname [_suffix]_" + type: list + required: false + elements: str + choices: + - memcached + default: [] + + docker_volume_type: + description: "Defines whether to use named volumes or bind mounts for mounts with name" + type: str + required: false + choices: + - named + - bind + default: named + reverse_proxy_type: + description: "Defines which kind of reverse proxy to configure for the container. Traefik support is experimental." + type: str + required: false + choices: + - caddy + - traefik + - none + default: caddy + ports: + description: "ports[docker_service]['http'] or ports[docker_service]['https'] defines the port on which the container will listen on for reverse proxy connections. Required if reverse_proxy_type is caddy." + type: dict + docker_vhost_domains: + description: "docker_vhost_domains[docker_service] is a list which defines which domains should be proxied to the container. Required if reverse_proxy_type is not none" + type: dict + docker_entrypoint: + description: "Docker entrypoint as list of command and arguments" + type: list + required: false + elements: str diff --git a/roles/alpine/tasks/main.yml b/roles/alpine/tasks/main.yml new file mode 100644 index 0000000..2692def --- /dev/null +++ b/roles/alpine/tasks/main.yml @@ -0,0 +1,15 @@ +--- + +- name: Alpine container + import_role: + name: container + vars: + docker_service: alpine + docker_image: alpine + docker_image_http_port: 8080 + docker_database: postgres + docker_mounts: + - name: data + path: /data + docker_env: + TZ: "{{ timezone }}" diff --git a/roles/container/meta/argument_specs.yml b/roles/container/meta/argument_specs.yml index 6d4faa7..b03b3c3 100644 --- a/roles/container/meta/argument_specs.yml +++ b/roles/container/meta/argument_specs.yml @@ -99,9 +99,9 @@ argument_specs: ports: description: "ports[docker_service]['http'] or ports[docker_service]['https'] defines the port on which the container will listen on for reverse proxy connections. Required if reverse_proxy_type is caddy." type: dict - required: false docker_vhost_domains: description: "docker_vhost_domains[docker_service] is a list which defines which domains should be proxied to the container. Required if reverse_proxy_type is not none" + type: dict docker_published_ports: description: "A list of published ports in docker format (::)" type: list