I will provide solutions to two different interpretations of your question. I don't claim that they are the only or the best solutions.
Every place in which independent Bernoulli is mentioned below, it is to be independent of everything else (all other Bernoullis).
Interpretation A:
$X$ has a Bernoulli distribution having success probability $0.5$.
Solution:
Step 1. Generate $X$ per Bernoulli distribution having success probability $0.5$.
Step 2.
If $\rho \ge 0$, then for each sample of $X$, set $Y = X$ with probability $\rho$ (i.e., per independent Bernoulli having success probability $\rho$), otherwise set $Y$ = independent Bernoulli having success probability $0.5$.
If $\rho \lt 0$, then for each sample of $X$, set $Y = 1-X$ with probability $-\rho$ (i.e., per independent Bernoulli having success probability $-\rho$), otherwise set $Y$ = independent Bernoulli having success probability $0.5$.
Result: $Y$ has a Bernoulli distribution having success probability $0.5$, and $\text{Corr}(X,Y) = \rho$.
Interpretation B: $X$ has a Bernoulli distribution having success probability $b$, and $Y$ must also have a Bernoulli distribution having success probability $b$, with $\text{Corr}(X,Y) = \rho$.
Solution is provided for $\rho \ge 0$ (note that solution for $\rho \lt 0$ and $b = 0.5$ is provided under Interpretation A; otherwise things are problematic).
Step 1. Generate $X$ per Bernoulli distribution having success probability $b$.
Step 2. For each sample of $X$, set $Y = X$ with probability $\rho$ (i.e., per independent Bernoulli having success probability $\rho$), otherwise set $Y$ = Independent Bernoulli having success probability $b$.
Result: $Y$ has a Bernoulli distribution having success probability $b$, and $\text{Corr}(X,Y) = \rho$.
$x$
produces $x$ $\endgroup$