A quick comparison of Ansible and CloudFormation followed by some best practices for CloudFormation.
Accompanying code at https://github.com/stevenringo/cloudformation-ruby-ansible-examples