does the curvature fixes a connection on the principal bundle? Consider a connection $d$ on a principle bundle $E\to M$. It gives gives you a curvature by the usual 
$$
d^2s=Fs \quad \forall s\in \Gamma(E)
$$
I was wondering if the connection is completely determined by $F$.
For an abelian group it looks like it's true, but in general it seems a difficult problem.
This is actually for physics so you could use YM's equation $d\star F=0$ but I don't believe it is needed.
pushing a little further, I wanted also to know if this works for GR, is the connection completely constrained by the Riemman Tensor?
 A: It is not true, if the bundle is defined by the trivialization $(U_i)$, locally, the connection is defined by $d+\alpha_i$ where $d$ is the differential and $\alpha_i$ a $1$-form which takes its values in the Lie algebra${\cal G}$ of $G$ the structural group, the curvature is $d\alpha_i+\alpha_i\wedge \alpha_i$. Suppose that the Lie algebra ${\cal G}$ is commutative, and $\beta$ a closed $1$-form which takes its values in ${\cal G}$, we can define a connection by $d+\alpha_i+\beta_{\mid U_i}$ which has the same curvature.
You can also consider flat bundles (bundles whose curvature vanishes) defined for examples over a surface $M$, the classified by representations $\pi_1(M)\rightarrow G$ and are not in general non trivial, their moduli space are studied. See the paper of Goldman below:
http://www2.math.umd.edu/~wmg/SymplecticNature.pdf
Consider for example the trivial $\mathbb{R}$-bundle over $\mathbb{R}$ and $\beta=df$ where $f$ is a function defined on $\mathbb{R}$.
https://en.wikipedia.org/wiki/Connection_(vector_bundle)#Local_expression
