how do you create instances i hetzner? with cloud init?

I created for me some scripts to add node (Hetzner instance with Ubuntu) in a Docker Swarm, and I would really love to find something as you did but for Docker Swarm