Roger Ailes, the longtime Republican media guru, founder of Fox News and its current chairman, had some advice last year for then-Gen. David H. Petraeus. So in spring 2011, Ailes asked a Fox News analyst headed to Afghanistan to pass on his thoughts to Petraeus, who was then the commander of U.S. and coalition forces there. Petraeus, Ailes advised, should turn down an expected offer from President Obama to become CIA director and accept nothing less than the chairmanship of the Joint Chiefs of Staff, the top military post. If Obama did not offer the Joint Chiefs post, Petraeus should resign from the military and run for president, Ailes suggested.