From 61999a32e1359ebb6541dfc2e2e0f6eef1ca0a9c Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sun, 5 Nov 2023 10:46:54 +0100 Subject: [PATCH] Remove chown container from database --- .../services/deploy/database/tasks/main.yml | 1 - .../container-database-pgadmin-chown.service | 29 ------------------- .../container-database-pgadmin.service | 7 ++--- 3 files changed, 3 insertions(+), 34 deletions(-) delete mode 100644 playbooks/roles/services/deploy/database/templates/systemd/container-database-pgadmin-chown.service diff --git a/playbooks/roles/services/deploy/database/tasks/main.yml b/playbooks/roles/services/deploy/database/tasks/main.yml index 65c9117..a2663cc 100644 --- a/playbooks/roles/services/deploy/database/tasks/main.yml +++ b/playbooks/roles/services/deploy/database/tasks/main.yml @@ -40,7 +40,6 @@ loop: - "pod-database.service" - "container-database-postgres.service" - - "container-database-pgadmin-chown.service" - "container-database-pgadmin.service" register: services_deploy_database_systemd_files diff --git a/playbooks/roles/services/deploy/database/templates/systemd/container-database-pgadmin-chown.service b/playbooks/roles/services/deploy/database/templates/systemd/container-database-pgadmin-chown.service deleted file mode 100644 index 322c10d..0000000 --- a/playbooks/roles/services/deploy/database/templates/systemd/container-database-pgadmin-chown.service +++ /dev/null @@ -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 diff --git a/playbooks/roles/services/deploy/database/templates/systemd/container-database-pgadmin.service b/playbooks/roles/services/deploy/database/templates/systemd/container-database-pgadmin.service index 861c1d5..5bb82ba 100644 --- a/playbooks/roles/services/deploy/database/templates/systemd/container-database-pgadmin.service +++ b/playbooks/roles/services/deploy/database/templates/systemd/container-database-pgadmin.service @@ -4,8 +4,7 @@ Documentation=man:podman-generate-systemd(1) Wants=network.target After=network-online.target BindsTo=pod-database.service container-database-postgres.service -Requires=container-database-pgadmin-chown.service -After=pod-database.service container-database-postgres.service container-database-pgadmin-chown.service +After=pod-database.service container-database-postgres.service OnFailure=status-mail@%n.service [Service] @@ -23,8 +22,8 @@ ExecStart=/usr/bin/podman run \ --log-driver=journald \ -dt \ -v {{ system_etc_root_directory }}/resolv.conf:/etc/resolv.conf:ro \ - -v {{ services_data_directory }}/pod-database/pgadmin/_data:/var/lib/pgadmin \ - -v ./.config/service/pgadmin.password:/run/secrets/pgadmin.password:ro \ + -v {{ services_data_directory }}/pod-database/pgadmin/_data:/var/lib/pgadmin:U \ + -v ./.config/service/pgadmin.password:/run/secrets/pgadmin.password:U,ro \ -e PGADMIN_DEFAULT_EMAIL="{{ services[services_service_name].pgadmin.email }}" \ -e PGADMIN_DEFAULT_PASSWORD_FILE=/run/secrets/pgadmin.password \ --name=pod-database-pgadmin \