basic terraform basic tf file





Basic plugins test
create a .tf file

provider "libvirt" {
    uri = "qemu:///system"
}



create a pool
jlk@ubuntu:~/Documents/github/terraform/basicubuntu$ virsh pool-list
 Name                 State      Autostart 
-------------------------------------------



jlk@ubuntu:~/Documents/github/terraform/basicubuntu$ virsh pool-define /dev/stdin <<EOF
> <pool type='dir'>
>   <name>default</name>
>   <target>
>     <path>/var/lib/libvirt/images</path>
>   </target>
> </pool>
> EOF
Pool default defined from /dev/stdin


jlk@ubuntu:~/Documents/github/terraform/basicubuntu$ virsh pool-start default
Pool default started

jlk@ubuntu:~/Documents/github/terraform/basicubuntu$ virsh pool-autostart default
Pool default marked as autostarted

jlk@ubuntu:~/Documents/github/terraform/basicubuntu$ virsh pool-list
 Name                 State      Autostart 
-------------------------------------------
 default              active     yes 

other example:

https://github.com/Klazomenai/tf-libvirt-centos7