Remove chown container from database

This commit is contained in:
Wojciech Kozlowski 2023-11-05 10:46:54 +01:00
parent b3c4695cfc
commit 61999a32e1
3 changed files with 3 additions and 34 deletions

View File

@ -40,7 +40,6 @@
loop: loop:
- "pod-database.service" - "pod-database.service"
- "container-database-postgres.service" - "container-database-postgres.service"
- "container-database-pgadmin-chown.service"
- "container-database-pgadmin.service" - "container-database-pgadmin.service"
register: services_deploy_database_systemd_files register: services_deploy_database_systemd_files

View File

@ -1,29 +0,0 @@
[Unit]
Description=Podman container-database-pgadmin-chown.service
Documentation=man:podman-generate-systemd(1)
After=pod-database.service
Before=container-database-pgadmin.service
OnFailure=status-mail@%n.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/container-database-pgadmin-chown.pid %t/container-database-pgadmin-chown.ctr-id
ExecStart=/usr/bin/podman run \
--conmon-pidfile %t/container-database-pgadmin-chown.pid \
--cidfile %t/container-database-pgadmin-chown.ctr-id \
--cgroups=no-conmon \
--pod-id-file %t/pod-database.pod-id \
--replace \
-v {{ services_data_directory }}/pod-database/pgadmin/_data:/var/lib/pgadmin \
-v ./.config/service/pgadmin.password:/run/secrets/pgadmin.password \
--user=0 \
--entrypoint="/bin/sh" \
--name=pod-database-pgadmin-chown \
docker.io/dpage/pgadmin4:{{ services_service_deploy_versions.pgadmin4 }} \
-c "chown -R 5050:5050 /var/lib/pgadmin /run/secrets/pgadmin.password"
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/container-database-pgadmin-chown.ctr-id
Type=oneshot
[Install]
WantedBy=container-database-pgadmin.service

View File

@ -4,8 +4,7 @@ Documentation=man:podman-generate-systemd(1)
Wants=network.target Wants=network.target
After=network-online.target After=network-online.target
BindsTo=pod-database.service container-database-postgres.service BindsTo=pod-database.service container-database-postgres.service
Requires=container-database-pgadmin-chown.service After=pod-database.service container-database-postgres.service
After=pod-database.service container-database-postgres.service container-database-pgadmin-chown.service
OnFailure=status-mail@%n.service OnFailure=status-mail@%n.service
[Service] [Service]
@ -23,8 +22,8 @@ ExecStart=/usr/bin/podman run \
--log-driver=journald \ --log-driver=journald \
-dt \ -dt \
-v {{ system_etc_root_directory }}/resolv.conf:/etc/resolv.conf:ro \ -v {{ system_etc_root_directory }}/resolv.conf:/etc/resolv.conf:ro \
-v {{ services_data_directory }}/pod-database/pgadmin/_data:/var/lib/pgadmin \ -v {{ services_data_directory }}/pod-database/pgadmin/_data:/var/lib/pgadmin:U \
-v ./.config/service/pgadmin.password:/run/secrets/pgadmin.password:ro \ -v ./.config/service/pgadmin.password:/run/secrets/pgadmin.password:U,ro \
-e PGADMIN_DEFAULT_EMAIL="{{ services[services_service_name].pgadmin.email }}" \ -e PGADMIN_DEFAULT_EMAIL="{{ services[services_service_name].pgadmin.email }}" \
-e PGADMIN_DEFAULT_PASSWORD_FILE=/run/secrets/pgadmin.password \ -e PGADMIN_DEFAULT_PASSWORD_FILE=/run/secrets/pgadmin.password \
--name=pod-database-pgadmin \ --name=pod-database-pgadmin \