I am in the process of building an open source terraform repository for all my company assets. It is split in the following modules:

node: the scaleway provider VMs that are provisioned with custom SSH/user config

docker: securely configures docker on a scaleway instance

docker_master: configures a docker swarm master on a docker instance

docker_worker: configures a docker swarm worker on a docker instance, needs at least 1 master

So node needs to configure a scaleway in stance before docker can be installed. But depending on docker_master or docker_worker, different commands need to be ran. (Join or Start a master)

Is there a way to pass remote-exec provisioners to the underlying module?

Code: https://github.com/ironPeakServices/infrastructure/tree/feat/dockersecurity/modules