Design of discrete time second order all pass filter
HINTS:

What value does $H(z_0)$ have if there's a phase shift of $180$ degrees (for $|z_0|=1$)?
Equate $H(z_0)$ to that value and write down the resulting equation for $a_1$ and $a_2$ and $z_0$.
You want a stable all-pass filter, so choose $a_2$ such that a given desired pole radius $r$, $0&lt;r&lt;1$, is achieved if you assume two complex conjugate poles.
With that value of $a_2$, and with a given frequency $\omega_0$ for which the phase shift is $180$ degrees, solve the equation you got in 2. for $a_1$. The result will have the form $$a_1=f(a_2)\cos(\omega_0)$$ where $f(\cdot)$ is a simple affine function. Note that $\omega_0$ is normalized by the sampling frequency.