feat(cinny): add ansible role

This commit is contained in:
2024-09-19 18:04:30 +02:00
parent 6790f4d2d3
commit dedbb72b70
21 changed files with 439 additions and 0 deletions

View File

@ -0,0 +1,33 @@
# `cinny` deployment using `docker`
> [!NOTE]
> Needs the python library `docker` on the `ansible_host`.
## Configuration
The following options to the
[`docker_container` module](https://docs.ansible.com/ansible/latest/collections/community/docker/docker_container_module.html)
are available under the `cinny_container_` prefix:
- `env`
- `ports`
- `labels`
- `networks`
- `etc_hosts`
- `purge_networks`
The following variables are pre-populated by the role, so override them with care:
- `name`
- `image`
- `user`
- `volumes`
- `restart_policy`
## Pulling from a self-hosted container registry
Set `cinny_container_image_registry` to use a self-hosted docker registry / mirror / cache.
If you need to authenticate to your registry and are not yet logged in, set `cinny_container_image_registry_{username,password}` and the role will attempt to log in.
Set `cinny_container_image_registry_reauthorize` to `true` if you want to force a reauthorization at the registry.

11
roles/cinny/docs/nginx.md Normal file
View File

@ -0,0 +1,11 @@
# `cinny` deployment using `nginx` virtual host
The role will create a virtual host named after `cinny_nginx_vhost_name` (default: `cinny`) in `cinny_nginx_available_sites` (default: `/etc/nginx/sites-available`).
If you choose `cinny_nginx_vhost_enable` (default: `true`), it will also create a symlink from `cinny_nginx_enabled_sites` to it's vhost.
> [!TIP]
> If you are deploying multiple cinny instances on a single host, customize `cinny_nginx_vhost_name` to contain your `cinny_nginx_server` in order to avoid filename collisions.
> [!IMPORTANT]
> If `cinny_nginx_vhost_enable` is `true`, the role will expect `nginx` to be in the `$PATH` (in order to test the configuration using `nginx -t`)

View File

@ -0,0 +1,13 @@
# `cinny` deployment from a tarball
The role supports just downloading and extracting a tarball, which can
then be served with a webserver of your own choice.
When `cinny_deployment_method` is set to `tarball`, the directory
`cinny_dist_path` (defaults to `/opt/cinny/src/dist`) needs to be
served at the desired URL.
Additionally, the following equivalent rules to
[the sample docker+nginx configuration](https://github.com/cinnyapp/cinny/blob/dev/docker-nginx.conf)
are needed for the webapp to work properly. For hosting in a path
like `/app`, set `cinny_config_hash_router_basename`.