The Prophet ﷺ said to me, "Abd al-Rahman bin Samura, do not ask for a position of leadership. If you are granted it after asking, you will be left to handle it on your own, but if you are granted it without asking, you will be aided in it. And when you swear an oath and then see something better than it, expiate for your oath and do what is better."
قال لي النبي ﷺ: يا عبد الرحمن بن سمرة! لا تسأل الإمارة، فإنك إن أعطيتها عن مسألة وكلت إليها، وإن أعطيتها عن غير مسألة أعنت عليها، وإذا حلفت على يمين فرأيت غيرها خيرا منها فكفر عن يمينك، وأت الذي خير.
Bukhari related it in Al-Ahkam (7146), and Muslim in Al-Imarah (1652:13), both through the route of Jareer bin Hazim, who said, Hasan narrated to us, Abdul-Rahman bin Samura narrated to us, and he related it.