Sahih Muslim , Book 27, Hadith 28 (In-Book)

Abd al-Rahman b. Samura reported that Allah's Messenger said to me: Abd al-Rahman b. Samura, don't ask for authority for if it is granted to you for asking for it, you would be commissioned for it (without having the support of Allah), but if you are granted it without your asking for it. You would be helped (by Allah) in it. And when you take an oath and find something else better than that, expiate for (breaking) your oath, and do that which is better. This hadith has also been transmitted on the authority of Ibn Farrukh.

حَدَّثَنَا شَيْبَانُ بْنُ فَرُّوخَ، حَدَّثَنَا جَرِيرُ بْنُ حَازِمٍ، حَدَّثَنَا الْحَسَنُ، حَدَّثَنَا عَبْدُ الرَّحْمَنِ، بْنُ سَمُرَةَ قَالَ قَالَ لِي رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ يَا عَبْدَ الرَّحْمَنِ بْنَ سَمُرَةَ لاَ تَسْأَلِ الإِمَارَةَ فَإِنَّكَ إِنْ أُعْطِيتَهَا عَنْ مَسْأَلَةٍ وُكِلْتَ إِلَيْهَا وَإِنْ أُعْطِيتَهَا عَنْ غَيْرِ مَسْأَلَةٍ أُعِنْتَ عَلَيْهَا وَإِذَا حَلَفْتَ عَلَى يَمِينٍ فَرَأَيْتَ غَيْرَهَا خَيْرًا مِنْهَا فَكَفِّرْ عَنْ يَمِينِكَ وَائْتِ الَّذِي هُوَ خَيْرٌ ‏" ‏ ‏.‏

sunnah.com