Step 1: Write the system in matrix form.
The given equations are:
\[
x + y + az = 2, 2y + 2z = 1, ax + 2z = b.
\]
This can be written as:
\[
\begin{bmatrix}
1 & 1 & a \\
0 & 2 & 2 \\
a & 0 & 2
\end{bmatrix}
\begin{bmatrix}
x \\ y \\ z
\end{bmatrix}
=
\begin{bmatrix}
2 \\ 1 \\ b
\end{bmatrix}.
\]
Step 2: Condition for infinite solutions.
For a system to have infinitely many solutions:
\[
\text{rank}(A) = \text{rank}([A|B])<\text{number of variables}.
\]
Here, number of variables = 3. So, $\det(A)=0$ is necessary.
Step 3: Compute determinant of $A$.
\[
A = \begin{bmatrix}
1 & 1 & a \\
0 & 2 & 2 \\
a & 0 & 2
\end{bmatrix}.
\]
\[
\det(A) = 1 \cdot (2 \cdot 2 - 2 \cdot 0) - 1 \cdot (0 \cdot 2 - 2a) + a \cdot (0 \cdot 0 - 2a).
\]
\[
= 1 \cdot 4 - 1 \cdot (-2a) + a \cdot (-2a).
\]
\[
= 4 + 2a - 2a^2.
\]
So,
\[
\det(A) = -2a^2 + 2a + 4.
\]
Step 4: Solve for $a$.
\[
-2a^2 + 2a + 4 = 0 \;\Rightarrow\; a^2 - a - 2 = 0.
\]
\[
(a-2)(a+1)=0 \;\Rightarrow\; a=2 \text{or} a=-1.
\]
Step 5: Find corresponding $b$ values.
\underline{Case 1: $a=2$}
System becomes:
\[
x + y + 2z = 2, 2y + 2z = 1, 2x + 2z = b.
\]
Divide third equation by 2:
\[
x+z = \tfrac{b}{2}.
\]
From first equation: $x = 2 - y - 2z$. Substituting second eqn $y+z=\tfrac{1}{2} \Rightarrow y=\tfrac{1}{2}-z$.
So:
\[
x = 2 - \left(\tfrac{1}{2}-z\right) - 2z = \tfrac{3}{2} - z.
\]
Now $x+z = \tfrac{3}{2}$. But also $x+z=\tfrac{b}{2}$. So:
\[
\tfrac{b}{2} = \tfrac{3}{2} \Rightarrow b=3.
\]
Hence $(a,b)=(2,3)$.
\underline{Case 2: $a=-1$}
System becomes:
\[
x + y - z = 2, 2y + 2z = 1, -x+2z=b.
\]
From second: $y+z=\tfrac{1}{2} \Rightarrow y=\tfrac{1}{2}-z$.
First eqn: $x+\tfrac{1}{2}-z - z=2 \Rightarrow x= \tfrac{3}{2}+2z$.
Third eqn: $-x+2z=b$. Substituting:
\[
-(\tfrac{3}{2}+2z)+2z=b \Rightarrow -\tfrac{3}{2}=b.
\]
So $(a,b)=(-1,-\tfrac{3}{2})$.
Final Answer:
\[
\boxed{(a,b)=(2,3)\ \text{and}\ (a,b)=(-1,-\tfrac{3}{2})}
\]