Maybe an easier way to do it is to apply the polynomial remainder theorem. It says that dividing a polynomial [tex]p(x)[/tex] by [tex]x-c[/tex] leaves a remainder of [tex]p(c)[/tex].
In this case, [tex]c=2[/tex], and we have
[tex]a(2)^3-7(2)^2+7(2)-2=8a-16[/tex]
[tex](2)^3-2a(2)^2+8(2)-8=16-8a[/tex]
Then
[tex]8a-16=16-8a\implies16a=32\implies a=2[/tex]