Compare commits
1 Commits
46c65afd25
...
pinp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db651723b2 |
@@ -3,7 +3,7 @@ namespace: uumas
|
||||
name: podman
|
||||
description: Roles for installing services in podman containers
|
||||
readme: README.md
|
||||
version: 0.1.5
|
||||
version: 0.1.1
|
||||
repository: "https://git.uumas.fi/uumas/ansible-podman"
|
||||
license_file: LICENSE
|
||||
authors:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Sets up a caddy container and a systemd socket unit, forwarding traffic from it to target container
|
||||
@@ -14,4 +14,3 @@ container_auto_update: true
|
||||
container_requires: []
|
||||
container_wants: []
|
||||
container_add_capabilities: []
|
||||
container_reload_method: none
|
||||
|
||||
@@ -4,9 +4,3 @@
|
||||
systemd_restart_units: "{{ systemd_restart_units + [container_name ~ '.service'] }}" # noqa: var-naming[no-role-prefix]
|
||||
changed_when: true
|
||||
notify: Apply systemd unit restarts
|
||||
|
||||
- name: Reload container service {{ container_name }}
|
||||
ansible.builtin.systemd_service:
|
||||
name: "{{ container_name }}.service"
|
||||
state: reloaded
|
||||
when: "container_name ~ '.service' not in systemd_restart_units"
|
||||
|
||||
@@ -212,21 +212,3 @@ argument_specs:
|
||||
type: bool
|
||||
required: false
|
||||
default: true
|
||||
container_reload_method:
|
||||
description: |
|
||||
How to reload configuration when systemctl reload is called
|
||||
kill: Sends SIGHUP to the container
|
||||
command: Runs the specified command inside the container
|
||||
type: str
|
||||
required: false
|
||||
default: none
|
||||
choices:
|
||||
- kill
|
||||
- command
|
||||
- none
|
||||
container_reload_command:
|
||||
description: >-
|
||||
Command to run inside container when systemctl reload is called.
|
||||
Required if container_reload_method is command, ignored otherwise.
|
||||
type: str
|
||||
required: false
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
network_name: "{{ network.name }}"
|
||||
network_subnet: "{{ _container_network_subnet }}"
|
||||
network_range: "{{ _container_network_range }}"
|
||||
when:
|
||||
- "'.' not in network.name"
|
||||
- network_created_networks is not defined or network.name not in network_created_networks
|
||||
when: network_created_networks is not defined or network.name not in network_created_networks
|
||||
loop: "{{ container_networks }}"
|
||||
loop_control:
|
||||
loop_var: network
|
||||
|
||||
@@ -69,10 +69,6 @@ _container_labels: >-
|
||||
else {}
|
||||
}}
|
||||
|
||||
_container_reload_commands:
|
||||
kill: podman kill --signal HUP {{ container_name }}
|
||||
command: podman exec {{ container_name }} {{ container_reload_command }}
|
||||
|
||||
_container_quadlet_unit_options: |
|
||||
[Unit]
|
||||
Description=Container {{ container_name }}
|
||||
@@ -94,12 +90,8 @@ _container_quadlet_auto_start_options: |
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
_container_quadlet_reload_options: |
|
||||
[Service]
|
||||
ExecReload={{ _container_reload_commands[container_reload_method] }}
|
||||
_container_quadlet_options_incl_empty:
|
||||
- "{{ 'AutoUpdate=registry' if container_auto_update else '' }}"
|
||||
- "{{ _container_quadlet_unit_options }}"
|
||||
- "{{ _container_quadlet_auto_start_options if container_auto_start else '' }}"
|
||||
- "{{ _container_quadlet_reload_options if container_reload_method != 'none' else '' }}"
|
||||
_container_quadlet_options: "{{ _container_quadlet_options_incl_empty | select('!=', '') }}"
|
||||
|
||||
@@ -3,7 +3,7 @@ _container_networks: >-
|
||||
{{
|
||||
container_networks
|
||||
| map(attribute='name')
|
||||
| map('regex_replace', '^(?!.*\.)(.*)$', '\1.network')
|
||||
| map('regex_replace', '$', '.network')
|
||||
| zip(container_networks | map(attribute='ip', default=''))
|
||||
| map('reject', 'equalto', '')
|
||||
| map('join', ':ip=')
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Sets up a Euro Office podman container.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,14 +0,0 @@
|
||||
---
|
||||
argument_specs:
|
||||
main:
|
||||
description: Sets up a Euro Office podman container.
|
||||
options:
|
||||
euro_office_domains:
|
||||
description: A list of domains the container should listen on.
|
||||
type: list
|
||||
required: true
|
||||
elements: str
|
||||
euro_office_jwt_secret:
|
||||
description: JWT secret, must be at least 32 characters long
|
||||
type: str
|
||||
required: true
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
- name: Euro-Office service
|
||||
ansible.builtin.import_role:
|
||||
name: service
|
||||
vars:
|
||||
service_name: euro-office
|
||||
service_container_image: ghcr.io/euro-office/documentserver:latest
|
||||
service_container_mounts:
|
||||
- type: volume
|
||||
source: data
|
||||
destination: /var/lib/euro-office/documentserver
|
||||
- type: volume
|
||||
source: private
|
||||
destination: /var/www/euro-office/Data
|
||||
- type: copy
|
||||
source: fonts/
|
||||
destination: /usr/share/fonts/custom
|
||||
service_container_http_port: 80
|
||||
service_domains: "{{ euro_office_domains }}"
|
||||
service_database_type: postgres
|
||||
service_database_secret_type: env
|
||||
service_database_secret_target: DB_PWD
|
||||
service_redis: true
|
||||
service_container_secrets:
|
||||
- name: jwt
|
||||
type: env
|
||||
target: JWT_SECRET
|
||||
value: "{{ euro_office_jwt_secret }}"
|
||||
service_container_env:
|
||||
DB_HOST: postgres
|
||||
DB_USER: euro_office
|
||||
DB_NAME: euro_office
|
||||
DB_PASSWORD__FILE: /run/secrets/postgres
|
||||
REDIS_SERVER_HOST: redis
|
||||
@@ -1 +0,0 @@
|
||||
Sets up a headscale container
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
headscale_oidc_issuer_url: ""
|
||||
headscale_oidc_client_id: ""
|
||||
headscale_oidc_client_secret: ""
|
||||
@@ -1,85 +0,0 @@
|
||||
---
|
||||
argument_specs:
|
||||
main:
|
||||
description: "Sets up a headscale container"
|
||||
options:
|
||||
headscale_domain:
|
||||
description: Domain headscale should be available at
|
||||
type: str
|
||||
required: true
|
||||
headscale_magicdns_base_domain:
|
||||
description: Base domain for magic dns hostnames
|
||||
type: str
|
||||
required: true
|
||||
headscale_policy:
|
||||
description:
|
||||
- Headscale policy configuration.
|
||||
- See https://headscale.net/stable/ref/acls/
|
||||
- This role's support for acls is currently quite limited. Waiting for headscale to release grants support.
|
||||
type: dict
|
||||
required: true
|
||||
options:
|
||||
groups:
|
||||
description: >-
|
||||
Groups of users. Formatted as dict where dict key is group name and
|
||||
value is a list of users in the group.
|
||||
type: dict
|
||||
required: false
|
||||
hosts:
|
||||
description: Mapping of host names to ip addresses
|
||||
type: dict
|
||||
required: false
|
||||
tagOwners:
|
||||
description: Mapping of tags to lists of their owners
|
||||
type: dict
|
||||
required: false
|
||||
acls:
|
||||
description: List of acls
|
||||
type: list
|
||||
required: true
|
||||
elements: dict
|
||||
options:
|
||||
action:
|
||||
description: ACL action
|
||||
type: str
|
||||
required: true
|
||||
choices:
|
||||
- accept
|
||||
- check
|
||||
src:
|
||||
description: >-
|
||||
A list of sources, formatted as prefix:name:ports,
|
||||
where prefix is the type of object, like tag: or group:,
|
||||
name is the object name and ports is a comma separated list of ports or *
|
||||
type: list
|
||||
required: true
|
||||
elements: str
|
||||
dst:
|
||||
description: A list of destinations. Same format as sources.
|
||||
type: list
|
||||
required: true
|
||||
elements: str
|
||||
proto:
|
||||
description: Protocol
|
||||
type: str
|
||||
required: false
|
||||
choices:
|
||||
- tcp
|
||||
- udp
|
||||
- icmp
|
||||
|
||||
headscale_oidc_issuer_url:
|
||||
description: OIDC issuer url. Leave unset to not use OIDC.
|
||||
type: str
|
||||
required: false
|
||||
default: ""
|
||||
headscale_oidc_client_id:
|
||||
description: OIDC client id. Required if OIDC issuer is set.
|
||||
type: str
|
||||
required: false
|
||||
default: ""
|
||||
headscale_oidc_client_secret:
|
||||
description: OIDC client secret. Required if OIDC issuer is set.
|
||||
type: str
|
||||
required: false
|
||||
default: ""
|
||||
@@ -1,36 +0,0 @@
|
||||
---
|
||||
- name: Headscale service
|
||||
ansible.builtin.import_role:
|
||||
name: service
|
||||
vars:
|
||||
service_name: headscale
|
||||
service_container_image: docker.io/headscale/headscale:stable
|
||||
service_container_command: serve
|
||||
service_container_mounts:
|
||||
- type: volume
|
||||
source: data
|
||||
destination: /var/lib/headscale
|
||||
- type: template
|
||||
source: config.yaml.j2
|
||||
destination: /etc/headscale/config.yaml
|
||||
- type: template
|
||||
source: policy.hujson.j2
|
||||
destination: /etc/headscale/policy.hujson
|
||||
template_validate_command: headscale policy check --file /etc/headscale/policy.hujson
|
||||
service_container_http_port: 8080
|
||||
service_domains:
|
||||
- "{{ headscale_domain }}"
|
||||
service_container_publish_ports:
|
||||
- name: stun
|
||||
container_port: 3478
|
||||
protocol: udp
|
||||
host_port: 3478
|
||||
service_container_secrets: "{{ _headscale_secrets }}"
|
||||
service_container_reload_method: kill
|
||||
|
||||
- name: Open port for stun
|
||||
ansible.posix.firewalld:
|
||||
service: stun
|
||||
state: enabled
|
||||
permanent: true
|
||||
immediate: true
|
||||
@@ -1,56 +0,0 @@
|
||||
---
|
||||
# vim:ft=yaml
|
||||
# {{ ansible_managed }}
|
||||
|
||||
listen_addr: 0.0.0.0:8080
|
||||
server_url: https://{{ headscale_domain }}
|
||||
|
||||
noise:
|
||||
private_key_path: /var/lib/headscale/noise_private.key
|
||||
|
||||
prefixes:
|
||||
v4: 100.64.0.0/10
|
||||
v6: fd7a:115c:a1e0::/48
|
||||
|
||||
allocation: sequential
|
||||
|
||||
derp:
|
||||
server:
|
||||
enabled: true
|
||||
region_id: 999
|
||||
region_code: "headscale"
|
||||
region_name: "Headscale embedded DERP"
|
||||
verify_clients: true
|
||||
stun_listen_addr: "0.0.0.0:3478"
|
||||
private_key_path: /var/lib/headscale/derp_server_private.key
|
||||
|
||||
urls: []
|
||||
|
||||
database:
|
||||
type: sqlite
|
||||
sqlite:
|
||||
path: /var/lib/headscale/db.sqlite
|
||||
|
||||
policy:
|
||||
mode: file
|
||||
path: /etc/headscale/policy.hujson
|
||||
|
||||
dns:
|
||||
magic_dns: true
|
||||
base_domain: {{ headscale_magicdns_base_domain }}
|
||||
nameservers:
|
||||
global:
|
||||
- https://dns.quad9.net/dns-query
|
||||
|
||||
logtail:
|
||||
enabled: false
|
||||
|
||||
{% if headscale_oidc_issuer_url | length > 0 %}
|
||||
oidc:
|
||||
only_start_if_oidc_is_available: false
|
||||
issuer: {{ headscale_oidc_issuer_url }}
|
||||
client_id: "{{ headscale_oidc_client_id }}"
|
||||
client_secret_path: /run/secrets/oidc-client-secret
|
||||
pkce:
|
||||
enabled: true
|
||||
{% endif %}
|
||||
@@ -1,3 +0,0 @@
|
||||
// {{ ansible_managed }}
|
||||
|
||||
{{ headscale_policy | to_nice_json }}
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
_headscale_oidc_secret:
|
||||
name: oidc-client-secret
|
||||
value: "{{ headscale_oidc_client_secret }}"
|
||||
|
||||
_headscale_secrets: "{{ [_headscale_oidc_secret] if headscale_oidc_issuer_url | length > 0 else [] }}"
|
||||
@@ -46,6 +46,11 @@ passwords:
|
||||
algorithm: argon2id
|
||||
minimum_complexity: 3
|
||||
|
||||
clients:
|
||||
- client_id: 0000000000000000000SYNAPSE
|
||||
client_auth_method: client_secret_basic
|
||||
client_secret: "{{ matrix_authentication_service_client_secret }}"
|
||||
|
||||
matrix:
|
||||
homeserver: {{ matrix_authentication_service_homeserver_name }}
|
||||
secret: "{{ matrix_authentication_service_homeserver_secret }}"
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Sets up a mautrix-whatsapp bridge
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
mautrix_whatsapp_os_name: Matrix bridge
|
||||
mautrix_whatsapp_bot_displayname: WhatsApp bridge
|
||||
mautrix_whatsapp_default_relays: []
|
||||
mautrix_whatsapp_permissions: {}
|
||||
@@ -1,57 +0,0 @@
|
||||
---
|
||||
argument_specs:
|
||||
main:
|
||||
description:
|
||||
- Sets up a mautrix-whatsapp bridge
|
||||
options:
|
||||
mautrix_whatsapp_homeserver_name:
|
||||
description: Matrix server name of homeserver the bridge is connected to.
|
||||
type: str
|
||||
required: true
|
||||
mautrix_whatsapp_as_token:
|
||||
description: A secret token that the application service will use to authenticate requests to the homeserver
|
||||
type: str
|
||||
required: true
|
||||
mautrix_whatsapp_hs_token:
|
||||
description: A secret token that the homeserver will use authenticate requests to the application service
|
||||
type: str
|
||||
required: true
|
||||
mautrix_whatsapp_doublepuppet_token:
|
||||
description: Double puppeting as token to impersonate matrix users
|
||||
type: str
|
||||
required: true
|
||||
mautrix_whatsapp_os_name:
|
||||
description: Device name that's shown in the "WhatsApp Web" section in the mobile app
|
||||
type: str
|
||||
required: false
|
||||
default: Matrix bridge
|
||||
mautrix_whatsapp_bot_displayname:
|
||||
description: Display name for the bridge bot
|
||||
type: str
|
||||
required: false
|
||||
default: WhatsApp bridge
|
||||
mautrix_whatsapp_default_relays:
|
||||
description: List of user login IDs which anyone can set as a relay, as long as the relay user is in the room
|
||||
type: list
|
||||
required: false
|
||||
default: []
|
||||
elements: str
|
||||
mautrix_whatsapp_permissions:
|
||||
description: Permissions for using the bridge. All users are given the relay permission regardless of this.
|
||||
type: list
|
||||
required: false
|
||||
default: []
|
||||
elements: dict
|
||||
options:
|
||||
key:
|
||||
description: Domain or user id to apply permission value to
|
||||
type: str
|
||||
required: true
|
||||
value:
|
||||
description: Permission value to apply
|
||||
type: str
|
||||
required: true
|
||||
choices:
|
||||
- commands
|
||||
- user
|
||||
- admin
|
||||
@@ -1,32 +0,0 @@
|
||||
---
|
||||
- name: Mautrix-WhatsApp container
|
||||
ansible.builtin.import_role:
|
||||
name: service
|
||||
vars:
|
||||
service_name: mautrix-whatsapp
|
||||
service_container_image: "{{ _mautrix_whatsapp_image }}"
|
||||
service_container_user: 1337:1337
|
||||
service_container_command:
|
||||
- /usr/bin/mautrix-whatsapp
|
||||
- --no-update
|
||||
service_database_type: postgres
|
||||
service_container_additional_networks:
|
||||
- synapse-mautrix-whatsapp
|
||||
service_container_mounts:
|
||||
- type: template
|
||||
source: config.yaml.j2
|
||||
destination: /data/config.yaml
|
||||
service_container_secrets:
|
||||
- name: as-token
|
||||
value: "{{ mautrix_whatsapp_as_token }}"
|
||||
- name: hs-token
|
||||
value: "{{ mautrix_whatsapp_hs_token }}"
|
||||
- name: doublepuppet-token
|
||||
value: as_token:{{ mautrix_whatsapp_doublepuppet_token }}
|
||||
- name: encryption-pickle-key
|
||||
service_container_env:
|
||||
BRIDGE_DATABASE__URI_FILE: /run/secrets/postgres-url
|
||||
BRIDGE_APPSERVICE__AS_TOKEN_FILE: /run/secrets/as-token
|
||||
BRIDGE_APPSERVICE__HS_TOKEN_FILE: /run/secrets/hs-token
|
||||
BRIDGE_ENCRYPTION__PICKLE_KEY: /run/secrets/encryption-pickle-key
|
||||
"BRIDGE_DOUBLE_PUPPET__SECRETS__{{ mautrix_whatsapp_homeserver_name }}": /run/secrets/doublepuppet-token
|
||||
@@ -1,73 +0,0 @@
|
||||
---
|
||||
# vim:ft=yaml
|
||||
# {{ ansible_managed }}
|
||||
|
||||
network:
|
||||
os_name: "{{ mautrix_whatsapp_os_name }}"
|
||||
|
||||
send_presence_on_typing: true
|
||||
url_previews: true
|
||||
extev_polls: true
|
||||
|
||||
bridge:
|
||||
cleanup_on_logout:
|
||||
enabled: true
|
||||
manual:
|
||||
private: nothing
|
||||
relayed: nothing
|
||||
shared_no_users: kick
|
||||
shared_has_users: kick
|
||||
bad_credentials:
|
||||
private: nothing
|
||||
relayed: nothing
|
||||
shared_no_users: kick
|
||||
shared_has_users: kick
|
||||
|
||||
relay:
|
||||
enabled: true
|
||||
admin_only: true
|
||||
default_relays:
|
||||
{{ mautrix_whatsapp_default_relays | to_nice_yaml | indent(4) }}
|
||||
permissions:
|
||||
"*": relay
|
||||
{% for item in mautrix_whatsapp_permissions %}
|
||||
"{{ item.key }}": {{ item.value }}
|
||||
{% endfor %}
|
||||
|
||||
database:
|
||||
type: postgres
|
||||
|
||||
homeserver:
|
||||
address: http://synapse:8009
|
||||
domain: {{ mautrix_whatsapp_homeserver_name }}
|
||||
async_media: true
|
||||
|
||||
appservice:
|
||||
address: http://mautrix-whatsapp:8080
|
||||
hostname: 0.0.0.0
|
||||
port: 8080
|
||||
id: whatsapp
|
||||
bot:
|
||||
username: whatsappbot
|
||||
displayname: {{ mautrix_whatsapp_bot_displayname }}
|
||||
|
||||
matrix:
|
||||
delivery_receipts: true
|
||||
|
||||
provisioning:
|
||||
shared_secret: disable
|
||||
|
||||
encryption:
|
||||
allow: true
|
||||
default: false
|
||||
msc4190: true
|
||||
|
||||
allow_key_sharing: true
|
||||
|
||||
env_config_prefix: BRIDGE_
|
||||
|
||||
logging:
|
||||
min_level: info
|
||||
writers:
|
||||
- type: stdout
|
||||
format: pretty-colored
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
_mautrix_whatsapp_image: dock.mau.dev/mautrix/whatsapp:latest
|
||||
@@ -1,4 +1,3 @@
|
||||
---
|
||||
nextcloud_tag: stable
|
||||
nextcloud_install_harp: false
|
||||
nextcloud_additional_networks: []
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
- name: Unregister AppAPI daemon
|
||||
containers.podman.podman_container_exec:
|
||||
name: nextcloud
|
||||
user: www-data
|
||||
argv:
|
||||
- /var/www/html/occ
|
||||
- app_api:daemon:unregister
|
||||
@@ -15,7 +14,6 @@
|
||||
- name: Register AppAPI daemon
|
||||
containers.podman.podman_container_exec:
|
||||
name: nextcloud
|
||||
user: www-data
|
||||
argv:
|
||||
- /bin/sh
|
||||
- -c
|
||||
|
||||
@@ -22,9 +22,3 @@ argument_specs:
|
||||
type: bool
|
||||
required: false
|
||||
default: false
|
||||
nextcloud_additional_networks:
|
||||
description: Additional docker networks to add nextcloud container to
|
||||
type: list
|
||||
elements: str
|
||||
required: false
|
||||
default: []
|
||||
|
||||
@@ -29,4 +29,3 @@
|
||||
NEXTCLOUD_ADMIN_PASSWORD_FILE: /run/secrets/admin-password
|
||||
service_additional_containers: "{{ _nextcloud_additional_containers }}"
|
||||
service_vhost_locations: "{{ _nextcloud_vhost_locations }}"
|
||||
service_container_additional_networks: "{{ nextcloud_additional_networks }}"
|
||||
|
||||
@@ -9,7 +9,6 @@ service_proxy_pass_host_header: true
|
||||
service_proxy_auth_type: none
|
||||
|
||||
service_container_ip: ""
|
||||
service_container_hostname: ""
|
||||
service_container_additional_networks: []
|
||||
service_container_user: ""
|
||||
service_container_publish_ports: []
|
||||
@@ -18,8 +17,7 @@ service_container_devices: []
|
||||
service_container_secrets: []
|
||||
service_container_env: {}
|
||||
service_container_add_capabilities: []
|
||||
service_container_reload_method: none
|
||||
service_container_reload_command: ""
|
||||
service_container_pinp: false
|
||||
|
||||
service_database_type: none
|
||||
service_database_additional_networks: []
|
||||
@@ -28,9 +26,6 @@ service_database_secret_target: "{{ service_database_type }}"
|
||||
service_postgres_image: docker.io/pgautoupgrade/pgautoupgrade
|
||||
service_postgres_tag: alpine
|
||||
service_redis: false
|
||||
service_tailscale: false
|
||||
service_tailscale_login_server: ""
|
||||
service_tailscale_apikey: ""
|
||||
|
||||
service_additional_containers: []
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ argument_specs:
|
||||
service_container_http_port:
|
||||
description:
|
||||
- Port inside the container where http requests are proxied to.
|
||||
- If set to 0, http requests are proxied to fd:3 inside the container
|
||||
- If set to 0, http requests are proxied to /run/<service name>.sock inside the container
|
||||
type: int
|
||||
required: false
|
||||
default: 0
|
||||
@@ -82,11 +82,6 @@ argument_specs:
|
||||
type: str
|
||||
required: false
|
||||
default: ""
|
||||
service_container_hostname:
|
||||
description: Hostname to set inside the container.
|
||||
type: str
|
||||
required: false
|
||||
default: ""
|
||||
service_container_additional_networks:
|
||||
description: >-
|
||||
A list of additional podman networks for the service container (in
|
||||
@@ -113,14 +108,6 @@ argument_specs:
|
||||
description: Container port to publish
|
||||
type: int
|
||||
required: true
|
||||
protocol:
|
||||
description: Protocol of the port
|
||||
type: str
|
||||
required: false
|
||||
default: tcp
|
||||
choices:
|
||||
- tcp
|
||||
- udp
|
||||
type:
|
||||
description: Whether to publish as a port or socket
|
||||
type: str
|
||||
@@ -163,7 +150,7 @@ argument_specs:
|
||||
- Mount source.
|
||||
- If mount type is volume, name of the volume.
|
||||
- If mount type is bind, host path to bind mount inside the container.
|
||||
- If mount type is template, the name of the template file, must end in .j2.
|
||||
- If mount type is template, the name of the template file, must end in .j2
|
||||
- If mount type is copy, name of the file or directory to copy. Directory name must end in /.
|
||||
type: str
|
||||
required: true
|
||||
@@ -215,23 +202,6 @@ argument_specs:
|
||||
elements: str
|
||||
required: false
|
||||
default: []
|
||||
template_validate_command:
|
||||
description: >-
|
||||
Command used to verify templated file validity.
|
||||
Will be run in a temporary container using the same container image as the main service.
|
||||
File will be available in the same place as in the service container (destination).
|
||||
Only applicable if mount type is template.
|
||||
type: str
|
||||
required: false
|
||||
template_directory:
|
||||
description: >-
|
||||
Whether to create a directory and mount it at the destination file's parent directory.
|
||||
This is required for container to see templated file changes without restart.
|
||||
Only applicable if mount type is template.
|
||||
type: bool
|
||||
required: false
|
||||
default: false
|
||||
|
||||
service_container_devices:
|
||||
description: List of devices to be added inside the service main container.
|
||||
type: list
|
||||
@@ -307,25 +277,21 @@ argument_specs:
|
||||
default: []
|
||||
elements: str
|
||||
|
||||
service_container_reload_method:
|
||||
description: |
|
||||
How to reload configuration when systemctl reload is called
|
||||
kill: Sends SIGHUP to the container
|
||||
command: Runs the specified command inside the container
|
||||
type: str
|
||||
service_container_pinp:
|
||||
description:
|
||||
- If true, runs the container with podman in podman
|
||||
- This starts a podman service inside the outer container
|
||||
- The podman socket is exposed to the inner container at /var/run/docker.sock
|
||||
- >-
|
||||
This allows the container to manage other containers, which are run inside the
|
||||
same outer container
|
||||
- >-
|
||||
The inner containers use host networking, so they share the network namespace
|
||||
with the outer container and each other.
|
||||
- This support is experimental and may not work with all images or configurations.
|
||||
type: bool
|
||||
required: false
|
||||
default: none
|
||||
choices:
|
||||
- kill
|
||||
- command
|
||||
- none
|
||||
service_container_reload_command:
|
||||
description: >-
|
||||
Command to run inside container when systemctl reload is called.
|
||||
Required if container_reload_method is command, ignored otherwise.
|
||||
type: str
|
||||
required: false
|
||||
default: ""
|
||||
default: false
|
||||
|
||||
service_database_type:
|
||||
description:
|
||||
@@ -335,7 +301,6 @@ argument_specs:
|
||||
host <service database type> on the default port.
|
||||
- The database user will be <service name>
|
||||
- The password will be accessible as secret at /run/secrets/<service database type>
|
||||
- A postgres url is accessible as secret at /run/secrets/postgres-url
|
||||
- >
|
||||
The password will also be available as the
|
||||
service_podman_secrets['<service name>-<service database type>'] variable.
|
||||
@@ -387,23 +352,6 @@ argument_specs:
|
||||
type: bool
|
||||
required: false
|
||||
default: false
|
||||
service_tailscale:
|
||||
description: >-
|
||||
Whether to install tailscale in a container and have the service container use its
|
||||
network. This will make the container accessible over tailscale.
|
||||
type: bool
|
||||
required: false
|
||||
default: false
|
||||
service_tailscale_login_server:
|
||||
description: Tailscale login server. Required if tailscale is enabled.
|
||||
type: str
|
||||
required: false
|
||||
default: ""
|
||||
service_tailscale_apikey:
|
||||
description: Tailscale API key. Required if tailscale is enabled.
|
||||
type: str
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
service_additional_containers:
|
||||
description:
|
||||
@@ -550,7 +498,7 @@ argument_specs:
|
||||
- Name of the port.
|
||||
- >-
|
||||
If type is socket, the socket will be created at
|
||||
/run/<service name>-<port name>-socat.sock on the host.
|
||||
/run/<service name>-<additional container name>-<port name>.sock on the host.
|
||||
- If type is not socket, this is just informative.
|
||||
type: str
|
||||
required: true
|
||||
@@ -558,14 +506,6 @@ argument_specs:
|
||||
description: Container port to publish
|
||||
type: int
|
||||
required: true
|
||||
protocol:
|
||||
description: Protocol of the port
|
||||
type: str
|
||||
required: false
|
||||
default: tcp
|
||||
choices:
|
||||
- tcp
|
||||
- udp
|
||||
type:
|
||||
description: Whether to publish as a port or socket
|
||||
type: str
|
||||
@@ -600,32 +540,6 @@ argument_specs:
|
||||
type: list
|
||||
required: false
|
||||
elements: str
|
||||
reload_method:
|
||||
description: |
|
||||
How to reload configuration when systemctl reload is called
|
||||
kill: Sends SIGHUP to the container
|
||||
command: Runs the specified command inside the container
|
||||
type: str
|
||||
required: false
|
||||
default: none
|
||||
choices:
|
||||
- kill
|
||||
- command
|
||||
- none
|
||||
reload_command:
|
||||
description: >-
|
||||
Command to run inside container when systemctl reload is called.
|
||||
Required if container_reload_method is command, ignored otherwise.
|
||||
type: str
|
||||
required: false
|
||||
default: ""
|
||||
tailscale:
|
||||
description: >-
|
||||
Whether to install tailscale in a container and this container use its
|
||||
network. This will make the container accessible over tailscale.
|
||||
type: bool
|
||||
required: false
|
||||
default: false
|
||||
secrets:
|
||||
description:
|
||||
- >
|
||||
@@ -673,23 +587,21 @@ argument_specs:
|
||||
the name of the environment variable. Defaults to secret name.
|
||||
type: str
|
||||
required: false
|
||||
requires:
|
||||
description: >-
|
||||
List of systemd units this container depends on, in addition to
|
||||
service-wide requires.
|
||||
type: list
|
||||
pinp:
|
||||
description:
|
||||
- If true, runs the container with podman in podman
|
||||
- This starts a podman service inside the outer container
|
||||
- The podman socket is exposed to the inner container at /var/run/docker.sock
|
||||
- >-
|
||||
This allows the container to manage other containers, which are run inside the
|
||||
same outer container
|
||||
- >-
|
||||
The inner containers use host networking, so they share the network namespace
|
||||
with the outer container and each other.
|
||||
- This support is experimental and may not work with all images or configurations.
|
||||
type: bool
|
||||
required: false
|
||||
default: []
|
||||
elements: str
|
||||
wants:
|
||||
description: >-
|
||||
List of systemd units this container weakly depends on, in addition to
|
||||
service-wide wants.
|
||||
type: list
|
||||
required: false
|
||||
default: []
|
||||
elements: str
|
||||
|
||||
default: false
|
||||
|
||||
service_requires:
|
||||
description: List of systemd units this service container depends on.
|
||||
|
||||
@@ -1,47 +1,31 @@
|
||||
---
|
||||
- name: Additional container {{ _service_additional_container.name }}
|
||||
- name: Additional containers for {{ service_name }}
|
||||
ansible.builtin.include_role:
|
||||
name: container
|
||||
vars:
|
||||
container_name: "{{ _service_additional_container.name }}"
|
||||
container_image: "{{ _service_additional_container.image }}"
|
||||
container_command: "{{ _service_additional_container.command }}"
|
||||
container_entrypoint: "{{ _service_additional_container.entrypoint }}"
|
||||
container_user: "{{ _service_additional_container.user }}"
|
||||
container_mounts: "{{ _service_additional_container_mounts }}"
|
||||
container_image: "{{ _service_additional_container_final.image }}"
|
||||
container_entrypoint: "{{ _service_additional_container_final.entrypoint }}"
|
||||
container_command: "{{ _service_additional_container_final.command }}"
|
||||
container_user: "{{ _service_additional_container_final.user }}"
|
||||
container_mounts: "{{ _service_additional_container_final.mounts }}"
|
||||
container_devices: "{{ _service_additional_container.devices }}"
|
||||
container_publish_ports: "{{ _service_additional_container_publish_ports }}"
|
||||
container_networks: >-
|
||||
{{
|
||||
_service_additional_container_networks if not _service_additional_container.tailscale
|
||||
else [{'name': _service_additional_container.name ~ '-tailscale.container'}]
|
||||
}}
|
||||
container_networks: "{{ _service_additional_container_networks }}"
|
||||
container_hostname: "{{ _service_additional_container.name | regex_replace('^' ~ service_name ~ '-', '') }}"
|
||||
container_secrets: "{{ _service_additional_container_secrets }}"
|
||||
container_env: "{{ _service_additional_container.env }}"
|
||||
container_env: "{{ _service_additional_container_final.env }}"
|
||||
container_add_capabilities: "{{ _service_additional_container.add_capabilities }}"
|
||||
container_reload_method: "{{ _service_additional_container.reload_method }}"
|
||||
container_reload_command: "{{ _service_additional_container.reload_command }}"
|
||||
container_requires: "{{ _service_additional_container_requires }}"
|
||||
container_requires: "{{ _service_container_requires }}"
|
||||
container_wants: "{{ _service_additional_container_wants }}"
|
||||
container_auto_update: "{{ service_auto_update }}"
|
||||
|
||||
- name: Socat for socket published ports of {{ _service_additional_container.name }}
|
||||
ansible.builtin.include_role:
|
||||
name: socat
|
||||
loop: "{{ _service_additional_container_publish_socket_ports }}"
|
||||
loop: "{{ _service_additional_containers }}"
|
||||
loop_control:
|
||||
loop_var: publish_port
|
||||
vars:
|
||||
socat_service_name: "{{ service_name }}-{{ publish_port.name }}"
|
||||
socat_target_container: "{{ _service_additional_container.name }}"
|
||||
socat_target_http_port: "{{ publish_port.container_port }}"
|
||||
socat_auto_update: "{{ service_auto_update }}"
|
||||
loop_var: _service_additional_container
|
||||
index_var: _service_additional_container_index
|
||||
|
||||
- name: Tailscale for {{ _service_additional_container.name }}
|
||||
ansible.builtin.include_tasks: tailscale.yaml
|
||||
when: _service_additional_container.tailscale
|
||||
vars:
|
||||
_service_tailscale_container_name: "{{ _service_additional_container.name }}"
|
||||
_service_tailscale_networks: "{{ _service_additional_container_networks }}"
|
||||
_service_tailscale_hostname: "{{ _service_additional_container.name | regex_replace('^' ~ service_name ~ '-', '') }}"
|
||||
- name: Socat sockets for additional containers of {{ service_name }}
|
||||
ansible.builtin.include_tasks: additional_socat.yaml
|
||||
loop: "{{ _service_additional_containers }}"
|
||||
loop_control:
|
||||
loop_var: _service_additional_container
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user