Skip to content

Commit 338f441

Browse files
committed
chore: fix edgecases
1 parent 6328b99 commit 338f441

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

.github/workflows/ami-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Build AMI
2626
run: |
2727
GIT_SHA=${{github.sha}}
28-
packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common.vars.pkr.hcl" -var "ansible_arguments=''" amazon-arm64.pkr.hcl
28+
packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common.vars.pkr.hcl" -var "ansible_arguments=" amazon-arm64.pkr.hcl
2929
3030
- name: Grab release version
3131
id: process_release_version

ebssurrogate/scripts/surrogate-bootstrap.sh

+14-7
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ callbacks_enabled = timer, profile_tasks, profile_roles
212212
EOF
213213
# Run Ansible playbook
214214
#export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_DEBUG=True && export ANSIBLE_REMOTE_TEMP=/mnt/tmp
215-
export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_REMOTE_TEMP=/mnt/tmp
215+
export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_REMOTE_TEMP=/mnt/tmp
216216
ansible-playbook -c chroot -i '/mnt,' /tmp/ansible-playbook/ansible/playbook.yml $ARGS
217217
}
218218

@@ -245,20 +245,27 @@ function clean_system {
245245
touch /mnt/var/log/auth.log
246246

247247
touch /mnt/var/log/pgbouncer.log
248-
chroot /mnt /usr/bin/chown pgbouncer:postgres /var/log/pgbouncer.log
248+
if [ -f /usr/bin/chown ]; then
249+
chroot /mnt /usr/bin/chown pgbouncer:postgres /var/log/pgbouncer.log
250+
fi
249251

250252
# Setup postgresql logs
251253
mkdir -p /mnt/var/log/postgresql
252-
chroot /mnt /usr/bin/chown postgres:postgres /var/log/postgresql
254+
if [ -f /usr/bin/chown ]; then
255+
chroot /mnt /usr/bin/chown postgres:postgres /var/log/postgresql
256+
fi
253257

254258
# Setup wal-g logs
255259
mkdir /mnt/var/log/wal-g
256260
touch /mnt/var/log/wal-g/{backup-push.log,backup-fetch.log,wal-push.log,wal-fetch.log}
257-
chroot /mnt /usr/bin/chown -R postgres:postgres /var/log/wal-g
258-
chroot /mnt /usr/bin/chmod -R 0300 /var/log/wal-g
259261

260-
# audit logs directory for apparmor
261-
mkdir /mnt/var/log/audit
262+
if [ -f /usr/bin/chown ]; then
263+
chroot /mnt /usr/bin/chown -R postgres:postgres /var/log/wal-g
264+
chroot /mnt /usr/bin/chmod -R 0300 /var/log/wal-g
265+
fi
266+
267+
# audit logs directory for apparmor
268+
mkdir /mnt/var/log/audit
262269

263270
# unwanted files
264271
rm -rf /mnt/var/lib/apt/lists/*

0 commit comments

Comments
 (0)