All kinds of ebooks over the years. For all the reasons you mentioned and more. Though a majority are reports, or short ebooks.
Obviously I create many to sell. Also for listbuilding or lead magnets. Done some for document sharing sites, though never saw great results from that route.
While not ebooks I've created a number of FAQ or how-to's for my customers. Again, usually short reports, like 10-15 pages.
One other thing that so many seem to balk when I say it, I create reports just to give away, free to download. Most people say, "Oh you should make them opt-in!". While they are not wrong, I like to try and cover all my bases, like to get those people who don't want to give up their email address.
Also, not really ebooks, when I write long blog posts, I try to remember to turn them into PDF's, and link a download at the end of the blog post.
Naturally, everything I create has my name and website links in it. Always marketing