From 2e2ee170f8d780d860b59b7e2ec29dac5d1d393b Mon Sep 17 00:00:00 2001
From: Clark Boylan <clark.boylan@gmail.com>
Date: Wed, 22 Apr 2020 14:09:46 -0700
Subject: [PATCH] Fix rooted path to docker-compose

In places like crontab entries we use full paths to executables because
PATH is different under cron. Unfortunately, this meant we broke
docker-compose commands using /usr/bin/docker-compose when we installed
it under /usr/local/bin/docker-compose. In particular this impacted
database backups on gitea nodes and etherpad.

Update these paths so that everything is happy again.

Change-Id: Ib001baab419325ef1a43ac8e3364e755a6655617
---
 doc/source/etherpad.rst                  | 2 +-
 playbooks/roles/etherpad/tasks/main.yaml | 2 +-
 playbooks/roles/gitea/tasks/main.yaml    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/source/etherpad.rst b/doc/source/etherpad.rst
index aff61ea933..5ac6285dfe 100644
--- a/doc/source/etherpad.rst
+++ b/doc/source/etherpad.rst
@@ -49,7 +49,7 @@ browser). This is fairly easily accomplished via the `HTTP API`_, but
 you need the key which is saved in a file on the server so it's easiest
 if done when SSH'd into it locally::
 
-  /usr/bin/docker-compose -f /etc/etherpad-docker/docker-compose.yaml exec -T etherpad \
+  /usr/local/bin/docker-compose -f /etc/etherpad-docker/docker-compose.yaml exec -T etherpad \
   bash -c "wget -qO- 'http://localhost:9001/api/1/deletePad?apikey='$(cat \
   /opt/etherpad-lite/APIKEY.txt)'&padID=XXXXXXXXXX'"
 
diff --git a/playbooks/roles/etherpad/tasks/main.yaml b/playbooks/roles/etherpad/tasks/main.yaml
index f206494204..f3fbef1d6e 100644
--- a/playbooks/roles/etherpad/tasks/main.yaml
+++ b/playbooks/roles/etherpad/tasks/main.yaml
@@ -129,7 +129,7 @@
     state: present
     user: root
     job: >
-      /usr/bin/docker-compose -f /etc/etherpad-docker/docker-compose.yaml exec -T mariadb
+      /usr/local/bin/docker-compose -f /etc/etherpad-docker/docker-compose.yaml exec -T mariadb
       bash -c '/usr/bin/mysqldump --opt --databases etherpad-lite --single-transaction -uroot -p"$MYSQL_ROOT_PASSWORD"' |
       gzip -9 > /var/backups/etherpad-mariadb/etherpad-mariadb.sql.gz
     minute: 42
diff --git a/playbooks/roles/gitea/tasks/main.yaml b/playbooks/roles/gitea/tasks/main.yaml
index 08cc07e4f4..0204e0c1b8 100644
--- a/playbooks/roles/gitea/tasks/main.yaml
+++ b/playbooks/roles/gitea/tasks/main.yaml
@@ -170,7 +170,7 @@
     state: present
     user: root
     job: >
-      /usr/bin/docker-compose -f /etc/gitea-docker/docker-compose.yaml exec -T mariadb
+      /usr/local/bin/docker-compose -f /etc/gitea-docker/docker-compose.yaml exec -T mariadb
       bash -c '/usr/bin/mysqldump --opt --databases gitea --single-transaction -uroot -p"$MYSQL_ROOT_PASSWORD"' |
       gzip -9 > /var/backups/gitea-mariadb/gitea-mariadb.sql.gz
     minute: 42