connection_url = ""
tenant = ""
username = ""
password = ""
image_id = ""
network_name = ""
machine_flavor_name = ""

ssh_public_key=""" """

# change OS parameter to match the actual image
import redhat
import ubuntu
os = redhat::fedora23

import vm
import openstack
import ssh

# register ssh key
my_key = ssh::Key(name="mykey", public_key=ssh_public_key)     

# get a openstack config object
provider = openstack::OpenstackConfig(connection_url=connection_url,
                                         username=username,
                                         password=password,
                                         tenant=tenant)  
# create an iaas object
# the iaas object can represent any iaas
# by changing the config object, you decide on which iaas the machine is created
iaas = vm::IaaS(name = "iaas_openstack", route_script = "", config = provider)

# make a vm!
host1 = vm::Host(name="testhost",
                   image = image_id, 
                   network=vm::Network(name=network_name),
                   public_key=my_key, 
                   os=os , 
                   flavor=machine_flavor_name, 
                   iaas = iaas,
                   user_data="")

