Open dzintars opened 3 years ago
~/.terraform.d/plugins
docsterraform init
places "official" plugins is .terraform/plugins/<OS>_<ARCH>
docs~/.local/share/terraform/plugins/registry.terraform.io/dmacvicar/libvirt/0.6.3/linux_amd64
(can't find the source). Be careful about the correct path structure.So... this silly stage does the job for now. For sure need to refactor it, but as PoC it's fine.
I need to place the terraform-provider-libvirt
vinary in the booth locations.
stage('1 Install dmacvicar/libvirt plugin') {
steps {
git 'https://github.com/dmacvicar/terraform-provider-libvirt.git'
sh 'ls -lah'
script {
try {
sh 'make'
} catch (err) {
echo err.getMessage()
}
}
sh 'ls -lah'
sh 'mkdir ~/.terraform.d/plugins'
sh 'cp terraform-provider-libvirt ~/.terraform.d/plugins/'
sh 'mkdir -p ~/.local/share/terraform/plugins/registry.terraform.io/dmacvicar/libvirt/0.6.3/linux_amd64'
sh 'cp terraform-provider-libvirt ~/.local/share/terraform/plugins/registry.terraform.io/dmacvicar/libvirt/0.6.3/linux_amd64'
}
}
P.S. BTW this stage does not work in the rootless Jenkins container even if make
and go
are installed. For now i just left it aside and installed Jenkins in the VM.
Also it it important that every terraform module contains
terraform {
required_version = ">= 0.14.4"
required_providers {
libvirt = {
source = "dmacvicar/libvirt"
version = "~>0.6.3"
}
}
}
and
provider "libvirt" {
uri = "qemu:///system"
}
stanzas. And... not only the child modules, but also in the root module. Can't remember the issue i read about this workaround. If will find, will make a refference later.