@@ -212,7 +212,7 @@ callbacks_enabled = timer, profile_tasks, profile_roles
212
212
EOF
213
213
# Run Ansible playbook
214
214
# 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
216
216
ansible-playbook -c chroot -i ' /mnt,' /tmp/ansible-playbook/ansible/playbook.yml $ARGS
217
217
}
218
218
@@ -245,20 +245,27 @@ function clean_system {
245
245
touch /mnt/var/log/auth.log
246
246
247
247
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
249
251
250
252
# Setup postgresql logs
251
253
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
253
257
254
258
# Setup wal-g logs
255
259
mkdir /mnt/var/log/wal-g
256
260
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
259
261
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
262
269
263
270
# unwanted files
264
271
rm -rf /mnt/var/lib/apt/lists/*
0 commit comments