Single playbook for docker and ec2

yes, check the facts, there are several that indicate the virtualization type.