{"id":15679917,"url":"https://github.com/rgl/terraform-libvirt-ubuntu-example","last_synced_at":"2025-05-07T09:26:09.081Z","repository":{"id":139753325,"uuid":"213240606","full_name":"rgl/terraform-libvirt-ubuntu-example","owner":"rgl","description":"example on how to launch a ubuntu vm using terraform-libvirt","archived":false,"fork":false,"pushed_at":"2024-07-14T10:13:12.000Z","size":42,"stargazers_count":13,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T20:53:46.142Z","etag":null,"topics":["example","libvirt","terraform"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-06T20:41:41.000Z","updated_at":"2025-03-05T02:47:07.000Z","dependencies_parsed_at":"2024-07-14T11:40:46.732Z","dependency_job_id":null,"html_url":"https://github.com/rgl/terraform-libvirt-ubuntu-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fterraform-libvirt-ubuntu-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fterraform-libvirt-ubuntu-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fterraform-libvirt-ubuntu-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fterraform-libvirt-ubuntu-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgl","download_url":"https://codeload.github.com/rgl/terraform-libvirt-ubuntu-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252849623,"owners_count":21813831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["example","libvirt","terraform"],"created_at":"2024-10-03T16:39:10.298Z","updated_at":"2025-05-07T09:26:09.041Z","avatar_url":"https://github.com/rgl.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Usage (Ubuntu 22.04 host)\n\n[![Lint](https://github.com/rgl/terraform-libvirt-ubuntu-example/actions/workflows/lint.yml/badge.svg)](https://github.com/rgl/terraform-libvirt-ubuntu-example/actions/workflows/lint.yml)\n\nCreate and install the [base Ubuntu 22.04 vagrant box](https://github.com/rgl/ubuntu-vagrant).\n\nInstall Terraform:\n\n```bash\nwget https://releases.hashicorp.com/terraform/1.9.2/terraform_1.9.2_linux_amd64.zip\nunzip terraform_1.9.2_linux_amd64.zip\nsudo install terraform /usr/local/bin\nrm terraform terraform_*_linux_amd64.zip\n```\n\nCreate the infrastructure:\n\n```bash\nexport CHECKPOINT_DISABLE=1\nexport TF_LOG=TRACE\nexport TF_LOG_PATH=\"$PWD/terraform.log\"\nterraform init\nterraform plan -out=tfplan\ntime terraform apply tfplan\n```\n\n**NB** if you have errors alike `Could not open '/var/lib/libvirt/images/terraform_example_root.img': Permission denied'` you need to reconfigure libvirt by setting `security_driver = \"none\"` in `/etc/libvirt/qemu.conf` and restart libvirt with `sudo systemctl restart libvirtd`.\n\nShow information about the libvirt/qemu guest:\n\n```bash\nvirsh dumpxml terraform_example\nvirsh qemu-agent-command terraform_example '{\"execute\":\"guest-info\"}' --pretty\nvirsh qemu-agent-command terraform_example '{\"execute\":\"guest-network-get-interfaces\"}' --pretty\n./qemu-agent-guest-exec terraform_example id\n./qemu-agent-guest-exec terraform_example uname -a\nssh-keygen -f ~/.ssh/known_hosts -R \"$(terraform output --raw ip)\"\nssh \"vagrant@$(terraform output --raw ip)\"\n```\n\nDestroy the infrastructure:\n\n```bash\ntime terraform destroy -auto-approve\n```\n\nList this repository dependencies (and which have newer versions):\n\n```bash\nGITHUB_COM_TOKEN='YOUR_GITHUB_PERSONAL_TOKEN' ./renovate.sh\n```\n\n# Virtual BMC\n\nYou can externally control the VM using the following terraform providers:\n\n* [vbmc terraform provider](https://registry.terraform.io/providers/rgl/vbmc)\n  * exposes an [IPMI](https://en.wikipedia.org/wiki/Intelligent_Platform_Management_Interface) endpoint.\n  * you can use it with [ipmitool](https://github.com/ipmitool/ipmitool).\n  * for more information see the [rgl/terraform-provider-vbmc](https://github.com/rgl/terraform-provider-vbmc) repository.\n* [sushy-vbmc terraform provider](https://registry.terraform.io/providers/rgl/sushy-vbmc)\n  * exposes a [Redfish](https://en.wikipedia.org/wiki/Redfish_(specification)) endpoint.\n  * you can use it with [redfishtool](https://github.com/DMTF/Redfishtool).\n  * for more information see the [rgl/terraform-provider-sushy-vbmc](https://github.com/rgl/terraform-provider-sushy-vbmc) repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fterraform-libvirt-ubuntu-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgl%2Fterraform-libvirt-ubuntu-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fterraform-libvirt-ubuntu-example/lists"}