8 Let $f(x)=\cos 2x-2a(1+\cos x)$ have a minimum value of $-\frac{1}{2}$, then $a=$
8
$$
\begin{aligned}
f(x) & =2 \cos ^{2} x-1-2 a-2 a \cos x \\
& =2\left(\cos x-\frac{a}{2}\right)^{2}-\frac{1}{2} a^{2}-2 a-1,
\end{aligned}
$$

If $a>2$, $f(x)$ takes the minimum value $1-4a$ when $\cos x=1$; if $a>2$ or $a<-2$, the minimum value of $f(x)$ cannot be $-\frac{1}{2}$, hence
$$
-\frac{1}{2} a^{2}-2 a-1=-\frac{1}{2},
$$

Solving this, we get
$$
a=-2+\sqrt{3}, a=-2-\sqrt{3} \text{ (rejected). }
$$