Using terraform to abstract OpenStack


#1

Bonjour,

I’d like to propose that terraform is used to abstract OpenStack for creating VMs for molecule tests and destroying them. The delegated molecule driver could be used for that purpose because terraform is not natively supported.

The idea is also to use Docker support in terraform to enable testing locally with containers (running systemd + an ssh daemon, see the example here).

The platform part of the molecule.yml file could look like this:

---
driver:
  name: delegated
  options:
    managed: False
    driver: ${TERRAFORM_DRIVER:-openstack} # could be docker instead
platforms:
  - name: bind-host
  - name: bind-client-host

Ideally the docker configuration for the nodes (i.e. bind-host & bind-client-host) would be in a docker compose file. Each molecule directory could have one for their own testing and another that could be shared with other directories (using multiple docker-compose files is possible, they merge in the same way ansible yaml files merge).

Cheers

P.S. Another way to use terraform later on would be to automate interactions with Gandi (to acquire a domain name) or OVH (to aquire an OpenStack tenant). However it looks like Gandi support is limited and not maintained and OVH support does not allow for creating an OpenStack (public cloud) project.


#2

After looking into the details… I’m not sure I see the value in using terraform because it looks like there is no language to abstract the description of compute (i.e. containers for Docker or servers for OpenStack) or volume or network resources. For example Docker containers are described in a terraform specific format
that is entirely different from the OpenStack description of a compute instance.

It would make more sense to use the Ansible docker container module and the OpenStack server module since Enough already heavily relies on Ansible.