feat: restructure
This commit is contained in:
parent
106cfe806d
commit
f11feb6579
31 changed files with 712 additions and 73 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
||||||
.terraform/
|
.terraform/
|
||||||
|
__pycache__/
|
||||||
|
venv/
|
||||||
|
|
4
devops/cloudinit/README.md
Normal file
4
devops/cloudinit/README.md
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
- `ssh_import_id` works only when it is available on the target image.
|
||||||
|
Fails on [debain ](https://cloud.debian.org/images/cloud/buster/latest/debian-10-genericcloud-amd64.qcow2")
|
||||||
|
|
||||||
|
- cloudinit logs can be found at `/var/log/cloud-init.log` in the VM
|
|
@ -0,0 +1,4 @@
|
||||||
|
See Ubuntu example from
|
||||||
|
[here](https://github.com/dmacvicar/terraform-provider-libvirt/blob/main/examples/v0.13/ubuntu/cloud_init.cfg)
|
||||||
|
|
||||||
|
Depends on `mkisofs`, available on [archlinux from the `crdkit` package](https://bbs.archlinux.org/viewtopic.php?id=35066)
|
|
@ -0,0 +1,8 @@
|
||||||
|
#cloud-config
|
||||||
|
# vim: syntax=yaml
|
||||||
|
|
||||||
|
ssh_pwauth: True
|
||||||
|
chpasswd:
|
||||||
|
list: |
|
||||||
|
root:terraform-libvirt-linux
|
||||||
|
expire: False
|
138
devops/sandbox/terraform/libvirt/getting-started/conf.tf
Normal file
138
devops/sandbox/terraform/libvirt/getting-started/conf.tf
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
libvirt = {
|
||||||
|
source = "dmacvicar/libvirt"
|
||||||
|
version = "~> 0.7.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
provider "libvirt" {
|
||||||
|
uri = "qemu:///system"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
variable "prefix" {
|
||||||
|
default = "libvirt_getting_started"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# see https://github.com/dmacvicar/terraform-provider-libvirt/blob/v0.6.14/website/docs/r/network.markdown
|
||||||
|
resource "libvirt_network" "libvirt_getting_started" {
|
||||||
|
name = var.prefix
|
||||||
|
mode = "nat"
|
||||||
|
domain = "libvirt_getting_started.test"
|
||||||
|
addresses = ["10.17.3.0/24"]
|
||||||
|
dhcp {
|
||||||
|
enabled = false
|
||||||
|
}
|
||||||
|
dns {
|
||||||
|
enabled = true
|
||||||
|
local_only = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "libvirt_pool" "debian" {
|
||||||
|
name = "debian-getting-started"
|
||||||
|
type = "dir"
|
||||||
|
path = "/var/lib/libvirt/images/terraform-provider-libvirt-pool-debian"
|
||||||
|
}
|
||||||
|
|
||||||
|
# We fetch the latest debian release image from their mirrors
|
||||||
|
resource "libvirt_volume" "debian-qcow2" {
|
||||||
|
name = "debian-qcow2"
|
||||||
|
pool = libvirt_pool.debian.name
|
||||||
|
source = "https://cloud.debian.org/images/cloud/buster/latest/debian-10-genericcloud-amd64.qcow2"
|
||||||
|
format = "qcow2"
|
||||||
|
}
|
||||||
|
|
||||||
|
data "template_file" "user_data" {
|
||||||
|
template = file("${path.module}/cloud_init.cfg")
|
||||||
|
}
|
||||||
|
|
||||||
|
data "template_file" "network_config" {
|
||||||
|
template = file("${path.module}/network_config.cfg")
|
||||||
|
}
|
||||||
|
|
||||||
|
# for more info about paramater check this out
|
||||||
|
# https://github.com/dmacvicar/terraform-provider-libvirt/blob/master/website/docs/r/cloudinit.html.markdown
|
||||||
|
# Use CloudInit to add our ssh-key to the instance
|
||||||
|
# you can add also meta_data field
|
||||||
|
resource "libvirt_cloudinit_disk" "commoninit" {
|
||||||
|
name = "commoninit.iso"
|
||||||
|
user_data = data.template_file.user_data.rendered
|
||||||
|
network_config = data.template_file.network_config.rendered
|
||||||
|
pool = libvirt_pool.debian.name
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
resource "libvirt_domain" "libvirt_getting_started" {
|
||||||
|
name = "debian-terraform"
|
||||||
|
memory = "512"
|
||||||
|
vcpu = 1
|
||||||
|
|
||||||
|
cloudinit = libvirt_cloudinit_disk.commoninit.id
|
||||||
|
|
||||||
|
|
||||||
|
network_interface {
|
||||||
|
network_id = libvirt_network.libvirt_getting_started.id
|
||||||
|
wait_for_lease = true
|
||||||
|
addresses = ["10.17.3.2"]
|
||||||
|
}
|
||||||
|
|
||||||
|
# # IMPORTANT: this is a known bug on cloud images, since they expect a console
|
||||||
|
# # we need to pass it
|
||||||
|
# # https://bugs.launchpad.net/cloud-images/+bug/1573095
|
||||||
|
console {
|
||||||
|
type = "pty"
|
||||||
|
target_port = "0"
|
||||||
|
target_type = "serial"
|
||||||
|
}
|
||||||
|
|
||||||
|
console {
|
||||||
|
type = "pty"
|
||||||
|
target_type = "virtio"
|
||||||
|
target_port = "1"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
connection {
|
||||||
|
type = "ssh"
|
||||||
|
user = "root"
|
||||||
|
host = self.network_interface[0].addresses[0] # see https://github.com/dmacvicar/terraform-provider-libvirt/issues/660
|
||||||
|
public_key = file("~/.ssh/aravinth.pub")
|
||||||
|
}
|
||||||
|
|
||||||
|
disk {
|
||||||
|
volume_id = libvirt_volume.debian-qcow2.id
|
||||||
|
}
|
||||||
|
|
||||||
|
graphics {
|
||||||
|
type = "vnc"
|
||||||
|
listen_type = "address"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
boot_device {
|
||||||
|
dev = ["hd", "network"]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
network_interface {
|
||||||
|
network_id = libvirt_network.libvirt_getting_started.id
|
||||||
|
wait_for_lease = true
|
||||||
|
addresses = ["10.17.3.2"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
output "ip" {
|
||||||
|
value = length(libvirt_domain.libvirt_getting_started.network_interface[0].addresses) > 0 ? libvirt_domain.libvirt_getting_started.network_interface[0].addresses[0] : ""
|
||||||
|
}
|
|
@ -0,0 +1,297 @@
|
||||||
|
{
|
||||||
|
"version": 4,
|
||||||
|
"terraform_version": "1.3.2",
|
||||||
|
"serial": 13,
|
||||||
|
"lineage": "fb3ee49a-fca7-23c3-e26f-6eb1a2420ba2",
|
||||||
|
"outputs": {
|
||||||
|
"ip": {
|
||||||
|
"value": "10.17.3.2",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"resources": [
|
||||||
|
{
|
||||||
|
"mode": "data",
|
||||||
|
"type": "template_file",
|
||||||
|
"name": "network_config",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/template\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"filename": null,
|
||||||
|
"id": "b36a1372ce4ea68b514354202c26c0365df9a17f25cd5acdeeaea525cd913edc",
|
||||||
|
"rendered": "version: 2\nethernets:\n ens3:\n dhcp4: true\n",
|
||||||
|
"template": "version: 2\nethernets:\n ens3:\n dhcp4: true\n",
|
||||||
|
"vars": null
|
||||||
|
},
|
||||||
|
"sensitive_attributes": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mode": "data",
|
||||||
|
"type": "template_file",
|
||||||
|
"name": "user_data",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/template\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"filename": null,
|
||||||
|
"id": "913c54c5c37d22ff3d13f002db797bf6bffe68781beb886cc662940bf3569744",
|
||||||
|
"rendered": "#cloud-config\n# vim: syntax=yaml\n\nssh_pwauth: True\nchpasswd:\n list: |\n root:terraform-libvirt-linux\n expire: False\n",
|
||||||
|
"template": "#cloud-config\n# vim: syntax=yaml\n\nssh_pwauth: True\nchpasswd:\n list: |\n root:terraform-libvirt-linux\n expire: False\n",
|
||||||
|
"vars": null
|
||||||
|
},
|
||||||
|
"sensitive_attributes": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "libvirt_cloudinit_disk",
|
||||||
|
"name": "commoninit",
|
||||||
|
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"id": "/var/lib/libvirt/images/terraform-provider-libvirt-pool-debian/commoninit.iso;8c4b7d6f-17f9-4069-a690-30cde11ee528",
|
||||||
|
"meta_data": "",
|
||||||
|
"name": "commoninit.iso",
|
||||||
|
"network_config": "version: 2\nethernets:\n ens3:\n dhcp4: true\n",
|
||||||
|
"pool": "debian-getting-started",
|
||||||
|
"user_data": "#cloud-config\n# vim: syntax=yaml\n\nssh_pwauth: True\nchpasswd:\n list: |\n root:terraform-libvirt-linux\n expire: False\n"
|
||||||
|
},
|
||||||
|
"sensitive_attributes": [],
|
||||||
|
"private": "bnVsbA==",
|
||||||
|
"dependencies": [
|
||||||
|
"data.template_file.network_config",
|
||||||
|
"data.template_file.user_data",
|
||||||
|
"libvirt_pool.debian"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "libvirt_domain",
|
||||||
|
"name": "libvirt_getting_started",
|
||||||
|
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"status": "tainted",
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"arch": null,
|
||||||
|
"autostart": null,
|
||||||
|
"boot_device": [
|
||||||
|
{
|
||||||
|
"dev": [
|
||||||
|
"hd",
|
||||||
|
"network"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"cloudinit": "/var/lib/libvirt/images/terraform-provider-libvirt-pool-debian/commoninit.iso;8c4b7d6f-17f9-4069-a690-30cde11ee528",
|
||||||
|
"cmdline": null,
|
||||||
|
"console": [
|
||||||
|
{
|
||||||
|
"source_host": "127.0.0.1",
|
||||||
|
"source_path": "",
|
||||||
|
"source_service": "0",
|
||||||
|
"target_port": "0",
|
||||||
|
"target_type": "serial",
|
||||||
|
"type": "pty"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source_host": "127.0.0.1",
|
||||||
|
"source_path": "",
|
||||||
|
"source_service": "0",
|
||||||
|
"target_port": "1",
|
||||||
|
"target_type": "virtio",
|
||||||
|
"type": "pty"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"coreos_ignition": null,
|
||||||
|
"cpu": null,
|
||||||
|
"description": null,
|
||||||
|
"disk": [
|
||||||
|
{
|
||||||
|
"block_device": "",
|
||||||
|
"file": "",
|
||||||
|
"scsi": false,
|
||||||
|
"url": "",
|
||||||
|
"volume_id": "/var/lib/libvirt/images/terraform-provider-libvirt-pool-debian/debian-qcow2",
|
||||||
|
"wwn": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"emulator": null,
|
||||||
|
"filesystem": [],
|
||||||
|
"firmware": null,
|
||||||
|
"fw_cfg_name": "opt/com.coreos/config",
|
||||||
|
"graphics": [
|
||||||
|
{
|
||||||
|
"autoport": true,
|
||||||
|
"listen_address": "127.0.0.1",
|
||||||
|
"listen_type": "address",
|
||||||
|
"type": "vnc",
|
||||||
|
"websocket": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"id": "80ffcf42-464b-4d76-8cb7-972fb2ca6ece",
|
||||||
|
"initrd": null,
|
||||||
|
"kernel": null,
|
||||||
|
"machine": null,
|
||||||
|
"memory": 512,
|
||||||
|
"metadata": null,
|
||||||
|
"name": "debian-terraform",
|
||||||
|
"network_interface": [
|
||||||
|
{
|
||||||
|
"addresses": [
|
||||||
|
"10.17.3.2"
|
||||||
|
],
|
||||||
|
"bridge": "",
|
||||||
|
"hostname": "",
|
||||||
|
"mac": "",
|
||||||
|
"macvtap": "",
|
||||||
|
"network_id": "f6484c68-9238-4a68-9a57-1096c8dc9eb0",
|
||||||
|
"network_name": "",
|
||||||
|
"passthrough": "",
|
||||||
|
"vepa": "",
|
||||||
|
"wait_for_lease": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"addresses": [
|
||||||
|
"10.17.3.2"
|
||||||
|
],
|
||||||
|
"bridge": "",
|
||||||
|
"hostname": "",
|
||||||
|
"mac": "",
|
||||||
|
"macvtap": "",
|
||||||
|
"network_id": "f6484c68-9238-4a68-9a57-1096c8dc9eb0",
|
||||||
|
"network_name": "",
|
||||||
|
"passthrough": "",
|
||||||
|
"vepa": "",
|
||||||
|
"wait_for_lease": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"nvram": [],
|
||||||
|
"qemu_agent": false,
|
||||||
|
"running": true,
|
||||||
|
"timeouts": null,
|
||||||
|
"tpm": [],
|
||||||
|
"vcpu": 1,
|
||||||
|
"video": [],
|
||||||
|
"xml": []
|
||||||
|
},
|
||||||
|
"sensitive_attributes": [],
|
||||||
|
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDB9fQ==",
|
||||||
|
"dependencies": [
|
||||||
|
"data.template_file.network_config",
|
||||||
|
"data.template_file.user_data",
|
||||||
|
"libvirt_cloudinit_disk.commoninit",
|
||||||
|
"libvirt_network.libvirt_getting_started",
|
||||||
|
"libvirt_pool.debian",
|
||||||
|
"libvirt_volume.debian-qcow2"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "libvirt_network",
|
||||||
|
"name": "libvirt_getting_started",
|
||||||
|
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"addresses": [
|
||||||
|
"10.17.3.0/24"
|
||||||
|
],
|
||||||
|
"autostart": false,
|
||||||
|
"bridge": "virbr2",
|
||||||
|
"dhcp": [
|
||||||
|
{
|
||||||
|
"enabled": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dns": [
|
||||||
|
{
|
||||||
|
"enabled": true,
|
||||||
|
"forwarders": [],
|
||||||
|
"hosts": [],
|
||||||
|
"local_only": false,
|
||||||
|
"srvs": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dnsmasq_options": [],
|
||||||
|
"domain": "libvirt_getting_started.test",
|
||||||
|
"id": "f6484c68-9238-4a68-9a57-1096c8dc9eb0",
|
||||||
|
"mode": "nat",
|
||||||
|
"mtu": null,
|
||||||
|
"name": "libvirt_getting_started",
|
||||||
|
"routes": [],
|
||||||
|
"xml": []
|
||||||
|
},
|
||||||
|
"sensitive_attributes": [],
|
||||||
|
"private": "bnVsbA=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "libvirt_pool",
|
||||||
|
"name": "debian",
|
||||||
|
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"allocation": 466995195904,
|
||||||
|
"available": 25046917120,
|
||||||
|
"capacity": 492042113024,
|
||||||
|
"id": "77919777-5321-432d-bc8a-772a393679dd",
|
||||||
|
"name": "debian-getting-started",
|
||||||
|
"path": "/var/lib/libvirt/images/terraform-provider-libvirt-pool-debian",
|
||||||
|
"type": "dir",
|
||||||
|
"xml": []
|
||||||
|
},
|
||||||
|
"sensitive_attributes": [],
|
||||||
|
"private": "bnVsbA=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "libvirt_volume",
|
||||||
|
"name": "debian-qcow2",
|
||||||
|
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"base_volume_id": null,
|
||||||
|
"base_volume_name": null,
|
||||||
|
"base_volume_pool": null,
|
||||||
|
"format": "qcow2",
|
||||||
|
"id": "/var/lib/libvirt/images/terraform-provider-libvirt-pool-debian/debian-qcow2",
|
||||||
|
"name": "debian-qcow2",
|
||||||
|
"pool": "debian-getting-started",
|
||||||
|
"size": 2147483648,
|
||||||
|
"source": "https://cloud.debian.org/images/cloud/buster/latest/debian-10-genericcloud-amd64.qcow2",
|
||||||
|
"xml": []
|
||||||
|
},
|
||||||
|
"sensitive_attributes": [],
|
||||||
|
"private": "bnVsbA==",
|
||||||
|
"dependencies": [
|
||||||
|
"libvirt_pool.debian"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"check_results": []
|
||||||
|
}
|
|
@ -1,9 +1,14 @@
|
||||||
{
|
{
|
||||||
"version": 4,
|
"version": 4,
|
||||||
"terraform_version": "1.3.2",
|
"terraform_version": "1.3.2",
|
||||||
"serial": 5,
|
"serial": 6,
|
||||||
"lineage": "ad020180-a9b1-2642-e7c1-0de5d2b318c5",
|
"lineage": "fb3ee49a-fca7-23c3-e26f-6eb1a2420ba2",
|
||||||
"outputs": {},
|
"outputs": {
|
||||||
|
"ip": {
|
||||||
|
"value": "10.17.3.2",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
"resources": [
|
"resources": [
|
||||||
{
|
{
|
||||||
"mode": "data",
|
"mode": "data",
|
||||||
|
@ -34,9 +39,9 @@
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"filename": null,
|
"filename": null,
|
||||||
"id": "74c90b4966a0af6c145fc5551db49d4e5e463b0e5cdf771229aee494649157e3",
|
"id": "913c54c5c37d22ff3d13f002db797bf6bffe68781beb886cc662940bf3569744",
|
||||||
"rendered": "#cloud-config\n# vim: syntax=yaml\n#\n# ***********************\n# \t---- for more examples look at: ------\n# ---\u003e https://cloudinit.readthedocs.io/en/latest/topics/examples.html\n# ******************************\n#\n# This is the configuration syntax that the write_files module\n# will know how to understand. encoding can be given b64 or gzip or (gz+b64).\n# The content will be decoded accordingly and then written to the path that is\n# provided.\n#\n# Note: Content strings here are truncated for example purposes.\nssh_pwauth: True\nchpasswd:\n list: |\n root:terraform-libvirt-linux\n expire: False\n",
|
"rendered": "#cloud-config\n# vim: syntax=yaml\n\nssh_pwauth: True\nchpasswd:\n list: |\n root:terraform-libvirt-linux\n expire: False\n",
|
||||||
"template": "#cloud-config\n# vim: syntax=yaml\n#\n# ***********************\n# \t---- for more examples look at: ------\n# ---\u003e https://cloudinit.readthedocs.io/en/latest/topics/examples.html\n# ******************************\n#\n# This is the configuration syntax that the write_files module\n# will know how to understand. encoding can be given b64 or gzip or (gz+b64).\n# The content will be decoded accordingly and then written to the path that is\n# provided.\n#\n# Note: Content strings here are truncated for example purposes.\nssh_pwauth: True\nchpasswd:\n list: |\n root:terraform-libvirt-linux\n expire: False\n",
|
"template": "#cloud-config\n# vim: syntax=yaml\n\nssh_pwauth: True\nchpasswd:\n list: |\n root:terraform-libvirt-linux\n expire: False\n",
|
||||||
"vars": null
|
"vars": null
|
||||||
},
|
},
|
||||||
"sensitive_attributes": []
|
"sensitive_attributes": []
|
||||||
|
@ -52,19 +57,19 @@
|
||||||
{
|
{
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"id": "/tmp/terraform-provider-libvirt-pool-ubuntu/commoninit.iso;f998a504-a990-4b4a-bb52-4df8b70f3934",
|
"id": "/var/lib/libvirt/images/terraform-provider-libvirt-pool-debian/commoninit.iso;8c4b7d6f-17f9-4069-a690-30cde11ee528",
|
||||||
"meta_data": "",
|
"meta_data": "",
|
||||||
"name": "commoninit.iso",
|
"name": "commoninit.iso",
|
||||||
"network_config": "version: 2\nethernets:\n ens3:\n dhcp4: true\n",
|
"network_config": "version: 2\nethernets:\n ens3:\n dhcp4: true\n",
|
||||||
"pool": "ubuntu",
|
"pool": "debian-getting-started",
|
||||||
"user_data": "#cloud-config\n# vim: syntax=yaml\n#\n# ***********************\n# \t---- for more examples look at: ------\n# ---\u003e https://cloudinit.readthedocs.io/en/latest/topics/examples.html\n# ******************************\n#\n# This is the configuration syntax that the write_files module\n# will know how to understand. encoding can be given b64 or gzip or (gz+b64).\n# The content will be decoded accordingly and then written to the path that is\n# provided.\n#\n# Note: Content strings here are truncated for example purposes.\nssh_pwauth: True\nchpasswd:\n list: |\n root:terraform-libvirt-linux\n expire: False\n"
|
"user_data": "#cloud-config\n# vim: syntax=yaml\n\nssh_pwauth: True\nchpasswd:\n list: |\n root:terraform-libvirt-linux\n expire: False\n"
|
||||||
},
|
},
|
||||||
"sensitive_attributes": [],
|
"sensitive_attributes": [],
|
||||||
"private": "bnVsbA==",
|
"private": "bnVsbA==",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"data.template_file.network_config",
|
"data.template_file.network_config",
|
||||||
"data.template_file.user_data",
|
"data.template_file.user_data",
|
||||||
"libvirt_pool.ubuntu"
|
"libvirt_pool.debian"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -72,16 +77,24 @@
|
||||||
{
|
{
|
||||||
"mode": "managed",
|
"mode": "managed",
|
||||||
"type": "libvirt_domain",
|
"type": "libvirt_domain",
|
||||||
"name": "domain-ubuntu",
|
"name": "libvirt_getting_started",
|
||||||
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
||||||
"instances": [
|
"instances": [
|
||||||
{
|
{
|
||||||
|
"status": "tainted",
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"arch": "x86_64",
|
"arch": null,
|
||||||
"autostart": false,
|
"autostart": null,
|
||||||
"boot_device": [],
|
"boot_device": [
|
||||||
"cloudinit": "/tmp/terraform-provider-libvirt-pool-ubuntu/commoninit.iso;f998a504-a990-4b4a-bb52-4df8b70f3934",
|
{
|
||||||
|
"dev": [
|
||||||
|
"hd",
|
||||||
|
"network"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"cloudinit": "/var/lib/libvirt/images/terraform-provider-libvirt-pool-debian/commoninit.iso;8c4b7d6f-17f9-4069-a690-30cde11ee528",
|
||||||
"cmdline": null,
|
"cmdline": null,
|
||||||
"console": [
|
"console": [
|
||||||
{
|
{
|
||||||
|
@ -102,23 +115,19 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"coreos_ignition": null,
|
"coreos_ignition": null,
|
||||||
"cpu": [
|
"cpu": null,
|
||||||
{
|
"description": null,
|
||||||
"mode": "custom"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "",
|
|
||||||
"disk": [
|
"disk": [
|
||||||
{
|
{
|
||||||
"block_device": "",
|
"block_device": "",
|
||||||
"file": "",
|
"file": "",
|
||||||
"scsi": false,
|
"scsi": false,
|
||||||
"url": "",
|
"url": "",
|
||||||
"volume_id": "/tmp/terraform-provider-libvirt-pool-ubuntu/ubuntu-qcow2",
|
"volume_id": "/var/lib/libvirt/images/terraform-provider-libvirt-pool-debian/debian-qcow2",
|
||||||
"wwn": ""
|
"wwn": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"emulator": "/usr/bin/qemu-system-x86_64",
|
"emulator": null,
|
||||||
"filesystem": [],
|
"filesystem": [],
|
||||||
"firmware": null,
|
"firmware": null,
|
||||||
"fw_cfg_name": "opt/com.coreos/config",
|
"fw_cfg_name": "opt/com.coreos/config",
|
||||||
|
@ -127,29 +136,45 @@
|
||||||
"autoport": true,
|
"autoport": true,
|
||||||
"listen_address": "127.0.0.1",
|
"listen_address": "127.0.0.1",
|
||||||
"listen_type": "address",
|
"listen_type": "address",
|
||||||
"type": "spice",
|
"type": "vnc",
|
||||||
"websocket": 0
|
"websocket": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"id": "c932a058-d7f3-4b2c-a21f-b54a3c3e8c10",
|
"id": "99b3e1a2-36ba-4a6c-8ff7-1003f870a7b5",
|
||||||
"initrd": "",
|
"initrd": null,
|
||||||
"kernel": "",
|
"kernel": null,
|
||||||
"machine": "pc",
|
"machine": null,
|
||||||
"memory": 512,
|
"memory": 512,
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "ubuntu-terraform",
|
"name": "debian-terraform",
|
||||||
"network_interface": [
|
"network_interface": [
|
||||||
{
|
{
|
||||||
"addresses": [],
|
"addresses": [
|
||||||
|
"10.17.3.2"
|
||||||
|
],
|
||||||
"bridge": "",
|
"bridge": "",
|
||||||
"hostname": "",
|
"hostname": "",
|
||||||
"mac": "52:54:00:AA:5B:84",
|
"mac": "",
|
||||||
"macvtap": "",
|
"macvtap": "",
|
||||||
"network_id": "f50e127a-7413-4d45-80de-587b22da0aa6",
|
"network_id": "f6484c68-9238-4a68-9a57-1096c8dc9eb0",
|
||||||
"network_name": "default",
|
"network_name": "",
|
||||||
"passthrough": "",
|
"passthrough": "",
|
||||||
"vepa": "",
|
"vepa": "",
|
||||||
"wait_for_lease": false
|
"wait_for_lease": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"addresses": [
|
||||||
|
"10.17.3.2"
|
||||||
|
],
|
||||||
|
"bridge": "",
|
||||||
|
"hostname": "",
|
||||||
|
"mac": "",
|
||||||
|
"macvtap": "",
|
||||||
|
"network_id": "f6484c68-9238-4a68-9a57-1096c8dc9eb0",
|
||||||
|
"network_name": "",
|
||||||
|
"passthrough": "",
|
||||||
|
"vepa": "",
|
||||||
|
"wait_for_lease": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"nvram": [],
|
"nvram": [],
|
||||||
|
@ -167,27 +192,70 @@
|
||||||
"data.template_file.network_config",
|
"data.template_file.network_config",
|
||||||
"data.template_file.user_data",
|
"data.template_file.user_data",
|
||||||
"libvirt_cloudinit_disk.commoninit",
|
"libvirt_cloudinit_disk.commoninit",
|
||||||
"libvirt_pool.ubuntu",
|
"libvirt_network.libvirt_getting_started",
|
||||||
"libvirt_volume.ubuntu-qcow2"
|
"libvirt_pool.debian",
|
||||||
|
"libvirt_volume.debian-qcow2"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"mode": "managed",
|
"mode": "managed",
|
||||||
"type": "libvirt_pool",
|
"type": "libvirt_network",
|
||||||
"name": "ubuntu",
|
"name": "libvirt_getting_started",
|
||||||
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
||||||
"instances": [
|
"instances": [
|
||||||
{
|
{
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"allocation": 36864,
|
"addresses": [
|
||||||
"available": 11981750272,
|
"10.17.3.0/24"
|
||||||
"capacity": 11981787136,
|
],
|
||||||
"id": "b8d85970-bfed-4907-9b73-c26c3578b7c6",
|
"autostart": false,
|
||||||
"name": "ubuntu",
|
"bridge": "virbr2",
|
||||||
"path": "/tmp/terraform-provider-libvirt-pool-ubuntu",
|
"dhcp": [
|
||||||
|
{
|
||||||
|
"enabled": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dns": [
|
||||||
|
{
|
||||||
|
"enabled": true,
|
||||||
|
"forwarders": [],
|
||||||
|
"hosts": [],
|
||||||
|
"local_only": false,
|
||||||
|
"srvs": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dnsmasq_options": [],
|
||||||
|
"domain": "libvirt_getting_started.test",
|
||||||
|
"id": "f6484c68-9238-4a68-9a57-1096c8dc9eb0",
|
||||||
|
"mode": "nat",
|
||||||
|
"mtu": null,
|
||||||
|
"name": "libvirt_getting_started",
|
||||||
|
"routes": [],
|
||||||
|
"xml": []
|
||||||
|
},
|
||||||
|
"sensitive_attributes": [],
|
||||||
|
"private": "bnVsbA=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "libvirt_pool",
|
||||||
|
"name": "debian",
|
||||||
|
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"allocation": 466760273920,
|
||||||
|
"available": 25281839104,
|
||||||
|
"capacity": 492042113024,
|
||||||
|
"id": "77919777-5321-432d-bc8a-772a393679dd",
|
||||||
|
"name": "debian-getting-started",
|
||||||
|
"path": "/var/lib/libvirt/images/terraform-provider-libvirt-pool-debian",
|
||||||
"type": "dir",
|
"type": "dir",
|
||||||
"xml": []
|
"xml": []
|
||||||
},
|
},
|
||||||
|
@ -199,7 +267,7 @@
|
||||||
{
|
{
|
||||||
"mode": "managed",
|
"mode": "managed",
|
||||||
"type": "libvirt_volume",
|
"type": "libvirt_volume",
|
||||||
"name": "ubuntu-qcow2",
|
"name": "debian-qcow2",
|
||||||
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
||||||
"instances": [
|
"instances": [
|
||||||
{
|
{
|
||||||
|
@ -209,17 +277,17 @@
|
||||||
"base_volume_name": null,
|
"base_volume_name": null,
|
||||||
"base_volume_pool": null,
|
"base_volume_pool": null,
|
||||||
"format": "qcow2",
|
"format": "qcow2",
|
||||||
"id": "/tmp/terraform-provider-libvirt-pool-ubuntu/ubuntu-qcow2",
|
"id": "/var/lib/libvirt/images/terraform-provider-libvirt-pool-debian/debian-qcow2",
|
||||||
"name": "ubuntu-qcow2",
|
"name": "debian-qcow2",
|
||||||
"pool": "ubuntu",
|
"pool": "debian-getting-started",
|
||||||
"size": 2361393152,
|
"size": 2147483648,
|
||||||
"source": "https://cloud-images.ubuntu.com/releases/xenial/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img",
|
"source": "https://cloud.debian.org/images/cloud/buster/latest/debian-10-genericcloud-amd64.qcow2",
|
||||||
"xml": []
|
"xml": []
|
||||||
},
|
},
|
||||||
"sensitive_attributes": [],
|
"sensitive_attributes": [],
|
||||||
"private": "bnVsbA==",
|
"private": "bnVsbA==",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"libvirt_pool.ubuntu"
|
"libvirt_pool.debian"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
1
devops/sandbox/terraform/libvirt/ubuntu/.gitignore
vendored
Normal file
1
devops/sandbox/terraform/libvirt/ubuntu/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
plan
|
60
devops/sandbox/terraform/libvirt/ubuntu/.terraform.lock.hcl
Normal file
60
devops/sandbox/terraform/libvirt/ubuntu/.terraform.lock.hcl
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
# This file is maintained automatically by "terraform init".
|
||||||
|
# Manual edits may be lost in future updates.
|
||||||
|
|
||||||
|
provider "registry.terraform.io/dmacvicar/libvirt" {
|
||||||
|
version = "0.7.0"
|
||||||
|
constraints = "~> 0.7.0"
|
||||||
|
hashes = [
|
||||||
|
"h1:1RiomFBEdgi6GvqaAf16mW6bRqrxAV0P47HKKwETH3E=",
|
||||||
|
"zh:1161bfcac075d5790c9b36145811d95241622636b859222f995888471ba04efa",
|
||||||
|
"zh:317bca5edd36e2497e0ac2ed07dd5e7f09cfd5561a96607cb53fe1af6b0632c0",
|
||||||
|
"zh:4fa67e3baf6845148f2b4e617fb01c47f0971ce2d945efa805ac5c3820bb0ca6",
|
||||||
|
"zh:6e17f5f24373e21c0ff463d36d9caa4f08528e13764c5d1d7eceb719dcef6a14",
|
||||||
|
"zh:84622e2aca8bc91d71d3596fcd1b298c5dfe572c8722ab98084495d26b5c5e7d",
|
||||||
|
"zh:8ce125d872b26ce9b71a729437eb8ab36944a86da3784edaab7368af43ca3858",
|
||||||
|
"zh:8fc7eee76776d515c023d013c018a7b9816f0e840578af01bfaf58e49f020c03",
|
||||||
|
"zh:a4d6fccc0188746be35488396c431e4b313cd1221df408871c710d3a7382b02e",
|
||||||
|
"zh:b575bb2d2f8987043aecbb22ac3bbf1e9c8b9da49b201b6b225baf2b4595dae4",
|
||||||
|
"zh:b65b1733c29a09491912a98a829b19c9842af5971fbb358bc0e979b95bf33248",
|
||||||
|
"zh:b8266ed7b4bce4791fee5433d102d89187974a273574d69f637cfdeb913462c2",
|
||||||
|
"zh:bd0b842d6f694c6d558d3329a2c157dd9d84074d618d5ced891ef36798b1c97b",
|
||||||
|
"zh:dacf0299c2c11d84bdaa2f614ca14aeac36ffba0f20dff5a63437a81a61f6867",
|
||||||
|
"zh:e8c92794a06df42c15ff071859e99c6e95e93dcb40797c4128d31d3a47a27923",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
provider "registry.terraform.io/hashicorp/local" {
|
||||||
|
version = "2.2.3"
|
||||||
|
hashes = [
|
||||||
|
"h1:aWp5iSUxBGgPv1UnV5yag9Pb0N+U1I0sZb38AXBFO8A=",
|
||||||
|
"zh:04f0978bb3e052707b8e82e46780c371ac1c66b689b4a23bbc2f58865ab7d5c0",
|
||||||
|
"zh:6484f1b3e9e3771eb7cc8e8bab8b35f939a55d550b3f4fb2ab141a24269ee6aa",
|
||||||
|
"zh:78a56d59a013cb0f7eb1c92815d6eb5cf07f8b5f0ae20b96d049e73db915b238",
|
||||||
|
"zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
|
||||||
|
"zh:8aa9950f4c4db37239bcb62e19910c49e47043f6c8587e5b0396619923657797",
|
||||||
|
"zh:996beea85f9084a725ff0e6473a4594deb5266727c5f56e9c1c7c62ded6addbb",
|
||||||
|
"zh:9a7ef7a21f48fabfd145b2e2a4240ca57517ad155017e86a30860d7c0c109de3",
|
||||||
|
"zh:a63e70ac052aa25120113bcddd50c1f3cfe61f681a93a50cea5595a4b2cc3e1c",
|
||||||
|
"zh:a6e8d46f94108e049ad85dbed60354236dc0b9b5ec8eabe01c4580280a43d3b8",
|
||||||
|
"zh:bb112ce7efbfcfa0e65ed97fa245ef348e0fd5bfa5a7e4ab2091a9bd469f0a9e",
|
||||||
|
"zh:d7bec0da5c094c6955efed100f3fe22fca8866859f87c025be1760feb174d6d9",
|
||||||
|
"zh:fb9f271b72094d07cef8154cd3d50e9aa818a0ea39130bc193132ad7b23076fd",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
provider "registry.terraform.io/hashicorp/template" {
|
||||||
|
version = "2.2.0"
|
||||||
|
hashes = [
|
||||||
|
"h1:94qn780bi1qjrbC3uQtjJh3Wkfwd5+tTtJHOb7KTg9w=",
|
||||||
|
"zh:01702196f0a0492ec07917db7aaa595843d8f171dc195f4c988d2ffca2a06386",
|
||||||
|
"zh:09aae3da826ba3d7df69efeb25d146a1de0d03e951d35019a0f80e4f58c89b53",
|
||||||
|
"zh:09ba83c0625b6fe0a954da6fbd0c355ac0b7f07f86c91a2a97849140fea49603",
|
||||||
|
"zh:0e3a6c8e16f17f19010accd0844187d524580d9fdb0731f675ffcf4afba03d16",
|
||||||
|
"zh:45f2c594b6f2f34ea663704cc72048b212fe7d16fb4cfd959365fa997228a776",
|
||||||
|
"zh:77ea3e5a0446784d77114b5e851c970a3dde1e08fa6de38210b8385d7605d451",
|
||||||
|
"zh:8a154388f3708e3df5a69122a23bdfaf760a523788a5081976b3d5616f7d30ae",
|
||||||
|
"zh:992843002f2db5a11e626b3fc23dc0c87ad3729b3b3cff08e32ffb3df97edbde",
|
||||||
|
"zh:ad906f4cebd3ec5e43d5cd6dc8f4c5c9cc3b33d2243c89c5fc18f97f7277b51d",
|
||||||
|
"zh:c979425ddb256511137ecd093e23283234da0154b7fa8b21c2687182d9aea8b2",
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
version: 2
|
||||||
|
ethernets:
|
||||||
|
ens3:
|
||||||
|
dhcp4: true
|
|
@ -1,9 +1,18 @@
|
||||||
{
|
{
|
||||||
"version": 4,
|
"version": 4,
|
||||||
"terraform_version": "1.3.2",
|
"terraform_version": "1.3.2",
|
||||||
"serial": 12,
|
"serial": 202,
|
||||||
"lineage": "ad020180-a9b1-2642-e7c1-0de5d2b318c5",
|
"lineage": "a6fc0daf-c775-a473-062d-9e8d010efa11",
|
||||||
"outputs": {},
|
"outputs": {
|
||||||
|
"debian_ip": {
|
||||||
|
"value": "192.168.122.218",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"ubuntu_ip": {
|
||||||
|
"value": "192.168.122.160",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
"resources": [
|
"resources": [
|
||||||
{
|
{
|
||||||
"mode": "data",
|
"mode": "data",
|
||||||
|
@ -34,9 +43,9 @@
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"filename": null,
|
"filename": null,
|
||||||
"id": "74c90b4966a0af6c145fc5551db49d4e5e463b0e5cdf771229aee494649157e3",
|
"id": "cfd52fa0a19d9f79f950972494b7d3c43c479e01aa0535088b5a4b1503c15be3",
|
||||||
"rendered": "#cloud-config\n# vim: syntax=yaml\n#\n# ***********************\n# \t---- for more examples look at: ------\n# ---\u003e https://cloudinit.readthedocs.io/en/latest/topics/examples.html\n# ******************************\n#\n# This is the configuration syntax that the write_files module\n# will know how to understand. encoding can be given b64 or gzip or (gz+b64).\n# The content will be decoded accordingly and then written to the path that is\n# provided.\n#\n# Note: Content strings here are truncated for example purposes.\nssh_pwauth: True\nchpasswd:\n list: |\n root:terraform-libvirt-linux\n expire: False\n",
|
"rendered": "#cloud-config\n# vim: syntax=yaml\n#\n# ***********************\n# \t---- for more examples look at: ------\n# ---\u003e https://cloudinit.readthedocs.io/en/latest/topics/examples.html\n# ******************************\n#\n# This is the configuration syntax that the write_files module\n# will know how to understand. encoding can be given b64 or gzip or (gz+b64).\n# The content will be decoded accordingly and then written to the path that is\n# provided.\n#\n# Note: Content strings here are truncated for example purposes.\n#users:\n# - default\n## - name: root\n####\tplain_text_passwd: foobar12\n##\tssh_import_id:\n##\t\t- gh:realaravinth\n# - name: atm\n#\tplain_text_passwd: foobar12\n#\tgecos: Aravinth Manivannan\n#\tgroups: users, admin\n#\tsudo: ALL=(ALL) NOPASSWD:ALL\n#\tlock_password: false\n#\tssh_import_id:\n#\t\t- gh:realaravinth\n\n\n\nusers:\n- name: root\n ssh_authorized_keys: \n - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/wXdHpwpY/4ubhYTmuNdGepQpj1kchvTUTApxMZyfyVW4uzrPRTYsle1y9QbTBV35qLkNajRC/wmC5/xPchdXpsJpuD9st1HMhLeR8qwaPyptiYJYT+z/WisWw2k6oWhG3QKvPoRtBdW9nhZnkG+O6zkuGXiRHpS7j2VVboDPpWEe1UdELQFVCwfraRal2g3ENFZ/9V1UrW/4ahRnQnSxERplZUm/fgSxQtmXubTkW68ut7yasBsrKFffMm8JztW0tWgTlTKONd3LCjv4juM0t5+cJDotNDnUR86Tq2PG8io7no/h8BWtazmjdpfGgn02ibX26BkdU0LDEYbJt5q9/Fh9TGk2ZwcMQeyepO1AWQgkmHXZWZELqu6MLQpqdtsOjHp9k0MeSpuIbdwzgf10Ydy7vK1z8irS24tVNNnJaMBwOlVOPwfyztHRADPkFcv2lKSjS1uyKR0FIkV8Kvs4txaIjmwv2LfMg6lF5W6j3ZPLyeE4cplJP0DDjzorSanu31xVnqVb3A8V9awsJ/4H7d59bI99c7QHL4K3fBVP3O0gqd31xAVRsdGs5Tj2P+RpiI6o5JJiOa1+DuBdWzrVIXYchQ30ZjaJp1wTNsYLmAsjeYuQZE2tf1xvywdzD4MB4avugDEWikzRWN9V5PHDZr1bamTCCjOrb2PRCd7eSQ== aravinth7820@gmail.com\n- name: atm\n gecos: Aravinth Manivannan\n groups: users, admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash\n lock_passwd: true\n plain_text_passwd: fooabr12\n ssh_authorized_keys: \n - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/wXdHpwpY/4ubhYTmuNdGepQpj1kchvTUTApxMZyfyVW4uzrPRTYsle1y9QbTBV35qLkNajRC/wmC5/xPchdXpsJpuD9st1HMhLeR8qwaPyptiYJYT+z/WisWw2k6oWhG3QKvPoRtBdW9nhZnkG+O6zkuGXiRHpS7j2VVboDPpWEe1UdELQFVCwfraRal2g3ENFZ/9V1UrW/4ahRnQnSxERplZUm/fgSxQtmXubTkW68ut7yasBsrKFffMm8JztW0tWgTlTKONd3LCjv4juM0t5+cJDotNDnUR86Tq2PG8io7no/h8BWtazmjdpfGgn02ibX26BkdU0LDEYbJt5q9/Fh9TGk2ZwcMQeyepO1AWQgkmHXZWZELqu6MLQpqdtsOjHp9k0MeSpuIbdwzgf10Ydy7vK1z8irS24tVNNnJaMBwOlVOPwfyztHRADPkFcv2lKSjS1uyKR0FIkV8Kvs4txaIjmwv2LfMg6lF5W6j3ZPLyeE4cplJP0DDjzorSanu31xVnqVb3A8V9awsJ/4H7d59bI99c7QHL4K3fBVP3O0gqd31xAVRsdGs5Tj2P+RpiI6o5JJiOa1+DuBdWzrVIXYchQ30ZjaJp1wTNsYLmAsjeYuQZE2tf1xvywdzD4MB4avugDEWikzRWN9V5PHDZr1bamTCCjOrb2PRCd7eSQ== aravinth7820@gmail.com\n\nssh_pwauth: true\nchpasswd:\n list: |\n root:foobar12\n atm:foobar12\n expire: False\n",
|
||||||
"template": "#cloud-config\n# vim: syntax=yaml\n#\n# ***********************\n# \t---- for more examples look at: ------\n# ---\u003e https://cloudinit.readthedocs.io/en/latest/topics/examples.html\n# ******************************\n#\n# This is the configuration syntax that the write_files module\n# will know how to understand. encoding can be given b64 or gzip or (gz+b64).\n# The content will be decoded accordingly and then written to the path that is\n# provided.\n#\n# Note: Content strings here are truncated for example purposes.\nssh_pwauth: True\nchpasswd:\n list: |\n root:terraform-libvirt-linux\n expire: False\n",
|
"template": "#cloud-config\n# vim: syntax=yaml\n#\n# ***********************\n# \t---- for more examples look at: ------\n# ---\u003e https://cloudinit.readthedocs.io/en/latest/topics/examples.html\n# ******************************\n#\n# This is the configuration syntax that the write_files module\n# will know how to understand. encoding can be given b64 or gzip or (gz+b64).\n# The content will be decoded accordingly and then written to the path that is\n# provided.\n#\n# Note: Content strings here are truncated for example purposes.\n#users:\n# - default\n## - name: root\n####\tplain_text_passwd: foobar12\n##\tssh_import_id:\n##\t\t- gh:realaravinth\n# - name: atm\n#\tplain_text_passwd: foobar12\n#\tgecos: Aravinth Manivannan\n#\tgroups: users, admin\n#\tsudo: ALL=(ALL) NOPASSWD:ALL\n#\tlock_password: false\n#\tssh_import_id:\n#\t\t- gh:realaravinth\n\n\n\nusers:\n- name: root\n ssh_authorized_keys: \n - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/wXdHpwpY/4ubhYTmuNdGepQpj1kchvTUTApxMZyfyVW4uzrPRTYsle1y9QbTBV35qLkNajRC/wmC5/xPchdXpsJpuD9st1HMhLeR8qwaPyptiYJYT+z/WisWw2k6oWhG3QKvPoRtBdW9nhZnkG+O6zkuGXiRHpS7j2VVboDPpWEe1UdELQFVCwfraRal2g3ENFZ/9V1UrW/4ahRnQnSxERplZUm/fgSxQtmXubTkW68ut7yasBsrKFffMm8JztW0tWgTlTKONd3LCjv4juM0t5+cJDotNDnUR86Tq2PG8io7no/h8BWtazmjdpfGgn02ibX26BkdU0LDEYbJt5q9/Fh9TGk2ZwcMQeyepO1AWQgkmHXZWZELqu6MLQpqdtsOjHp9k0MeSpuIbdwzgf10Ydy7vK1z8irS24tVNNnJaMBwOlVOPwfyztHRADPkFcv2lKSjS1uyKR0FIkV8Kvs4txaIjmwv2LfMg6lF5W6j3ZPLyeE4cplJP0DDjzorSanu31xVnqVb3A8V9awsJ/4H7d59bI99c7QHL4K3fBVP3O0gqd31xAVRsdGs5Tj2P+RpiI6o5JJiOa1+DuBdWzrVIXYchQ30ZjaJp1wTNsYLmAsjeYuQZE2tf1xvywdzD4MB4avugDEWikzRWN9V5PHDZr1bamTCCjOrb2PRCd7eSQ== aravinth7820@gmail.com\n- name: atm\n gecos: Aravinth Manivannan\n groups: users, admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash\n lock_passwd: true\n plain_text_passwd: fooabr12\n ssh_authorized_keys: \n - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/wXdHpwpY/4ubhYTmuNdGepQpj1kchvTUTApxMZyfyVW4uzrPRTYsle1y9QbTBV35qLkNajRC/wmC5/xPchdXpsJpuD9st1HMhLeR8qwaPyptiYJYT+z/WisWw2k6oWhG3QKvPoRtBdW9nhZnkG+O6zkuGXiRHpS7j2VVboDPpWEe1UdELQFVCwfraRal2g3ENFZ/9V1UrW/4ahRnQnSxERplZUm/fgSxQtmXubTkW68ut7yasBsrKFffMm8JztW0tWgTlTKONd3LCjv4juM0t5+cJDotNDnUR86Tq2PG8io7no/h8BWtazmjdpfGgn02ibX26BkdU0LDEYbJt5q9/Fh9TGk2ZwcMQeyepO1AWQgkmHXZWZELqu6MLQpqdtsOjHp9k0MeSpuIbdwzgf10Ydy7vK1z8irS24tVNNnJaMBwOlVOPwfyztHRADPkFcv2lKSjS1uyKR0FIkV8Kvs4txaIjmwv2LfMg6lF5W6j3ZPLyeE4cplJP0DDjzorSanu31xVnqVb3A8V9awsJ/4H7d59bI99c7QHL4K3fBVP3O0gqd31xAVRsdGs5Tj2P+RpiI6o5JJiOa1+DuBdWzrVIXYchQ30ZjaJp1wTNsYLmAsjeYuQZE2tf1xvywdzD4MB4avugDEWikzRWN9V5PHDZr1bamTCCjOrb2PRCd7eSQ== aravinth7820@gmail.com\n\nssh_pwauth: true\nchpasswd:\n list: |\n root:foobar12\n atm:foobar12\n expire: False\n",
|
||||||
"vars": null
|
"vars": null
|
||||||
},
|
},
|
||||||
"sensitive_attributes": []
|
"sensitive_attributes": []
|
||||||
|
@ -52,12 +61,12 @@
|
||||||
{
|
{
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"id": "/tmp/terraform-provider-libvirt-pool-ubuntu/commoninit.iso;f998a504-a990-4b4a-bb52-4df8b70f3934",
|
"id": "/tmp/terraform-provider-libvirt-pool-ubuntu/commoninit.iso;8eb942e9-315e-40f4-bc9a-d0c31618b101",
|
||||||
"meta_data": "",
|
"meta_data": "",
|
||||||
"name": "commoninit.iso",
|
"name": "commoninit.iso",
|
||||||
"network_config": "version: 2\nethernets:\n ens3:\n dhcp4: true\n",
|
"network_config": "version: 2\nethernets:\n ens3:\n dhcp4: true\n",
|
||||||
"pool": "ubuntu",
|
"pool": "ubuntu",
|
||||||
"user_data": "#cloud-config\n# vim: syntax=yaml\n#\n# ***********************\n# \t---- for more examples look at: ------\n# ---\u003e https://cloudinit.readthedocs.io/en/latest/topics/examples.html\n# ******************************\n#\n# This is the configuration syntax that the write_files module\n# will know how to understand. encoding can be given b64 or gzip or (gz+b64).\n# The content will be decoded accordingly and then written to the path that is\n# provided.\n#\n# Note: Content strings here are truncated for example purposes.\nssh_pwauth: True\nchpasswd:\n list: |\n root:terraform-libvirt-linux\n expire: False\n"
|
"user_data": "#cloud-config\n# vim: syntax=yaml\n#\n# ***********************\n# \t---- for more examples look at: ------\n# ---\u003e https://cloudinit.readthedocs.io/en/latest/topics/examples.html\n# ******************************\n#\n# This is the configuration syntax that the write_files module\n# will know how to understand. encoding can be given b64 or gzip or (gz+b64).\n# The content will be decoded accordingly and then written to the path that is\n# provided.\n#\n# Note: Content strings here are truncated for example purposes.\n#users:\n# - default\n## - name: root\n####\tplain_text_passwd: foobar12\n##\tssh_import_id:\n##\t\t- gh:realaravinth\n# - name: atm\n#\tplain_text_passwd: foobar12\n#\tgecos: Aravinth Manivannan\n#\tgroups: users, admin\n#\tsudo: ALL=(ALL) NOPASSWD:ALL\n#\tlock_password: false\n#\tssh_import_id:\n#\t\t- gh:realaravinth\n\n\n\nusers:\n- name: root\n ssh_authorized_keys: \n - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/wXdHpwpY/4ubhYTmuNdGepQpj1kchvTUTApxMZyfyVW4uzrPRTYsle1y9QbTBV35qLkNajRC/wmC5/xPchdXpsJpuD9st1HMhLeR8qwaPyptiYJYT+z/WisWw2k6oWhG3QKvPoRtBdW9nhZnkG+O6zkuGXiRHpS7j2VVboDPpWEe1UdELQFVCwfraRal2g3ENFZ/9V1UrW/4ahRnQnSxERplZUm/fgSxQtmXubTkW68ut7yasBsrKFffMm8JztW0tWgTlTKONd3LCjv4juM0t5+cJDotNDnUR86Tq2PG8io7no/h8BWtazmjdpfGgn02ibX26BkdU0LDEYbJt5q9/Fh9TGk2ZwcMQeyepO1AWQgkmHXZWZELqu6MLQpqdtsOjHp9k0MeSpuIbdwzgf10Ydy7vK1z8irS24tVNNnJaMBwOlVOPwfyztHRADPkFcv2lKSjS1uyKR0FIkV8Kvs4txaIjmwv2LfMg6lF5W6j3ZPLyeE4cplJP0DDjzorSanu31xVnqVb3A8V9awsJ/4H7d59bI99c7QHL4K3fBVP3O0gqd31xAVRsdGs5Tj2P+RpiI6o5JJiOa1+DuBdWzrVIXYchQ30ZjaJp1wTNsYLmAsjeYuQZE2tf1xvywdzD4MB4avugDEWikzRWN9V5PHDZr1bamTCCjOrb2PRCd7eSQ== aravinth7820@gmail.com\n- name: atm\n gecos: Aravinth Manivannan\n groups: users, admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash\n lock_passwd: true\n plain_text_passwd: fooabr12\n ssh_authorized_keys: \n - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/wXdHpwpY/4ubhYTmuNdGepQpj1kchvTUTApxMZyfyVW4uzrPRTYsle1y9QbTBV35qLkNajRC/wmC5/xPchdXpsJpuD9st1HMhLeR8qwaPyptiYJYT+z/WisWw2k6oWhG3QKvPoRtBdW9nhZnkG+O6zkuGXiRHpS7j2VVboDPpWEe1UdELQFVCwfraRal2g3ENFZ/9V1UrW/4ahRnQnSxERplZUm/fgSxQtmXubTkW68ut7yasBsrKFffMm8JztW0tWgTlTKONd3LCjv4juM0t5+cJDotNDnUR86Tq2PG8io7no/h8BWtazmjdpfGgn02ibX26BkdU0LDEYbJt5q9/Fh9TGk2ZwcMQeyepO1AWQgkmHXZWZELqu6MLQpqdtsOjHp9k0MeSpuIbdwzgf10Ydy7vK1z8irS24tVNNnJaMBwOlVOPwfyztHRADPkFcv2lKSjS1uyKR0FIkV8Kvs4txaIjmwv2LfMg6lF5W6j3ZPLyeE4cplJP0DDjzorSanu31xVnqVb3A8V9awsJ/4H7d59bI99c7QHL4K3fBVP3O0gqd31xAVRsdGs5Tj2P+RpiI6o5JJiOa1+DuBdWzrVIXYchQ30ZjaJp1wTNsYLmAsjeYuQZE2tf1xvywdzD4MB4avugDEWikzRWN9V5PHDZr1bamTCCjOrb2PRCd7eSQ== aravinth7820@gmail.com\n\nssh_pwauth: true\nchpasswd:\n list: |\n root:foobar12\n atm:foobar12\n expire: False\n"
|
||||||
},
|
},
|
||||||
"sensitive_attributes": [],
|
"sensitive_attributes": [],
|
||||||
"private": "bnVsbA==",
|
"private": "bnVsbA==",
|
||||||
|
@ -81,7 +90,7 @@
|
||||||
"arch": "x86_64",
|
"arch": "x86_64",
|
||||||
"autostart": false,
|
"autostart": false,
|
||||||
"boot_device": [],
|
"boot_device": [],
|
||||||
"cloudinit": "/tmp/terraform-provider-libvirt-pool-ubuntu/commoninit.iso;f998a504-a990-4b4a-bb52-4df8b70f3934",
|
"cloudinit": "/tmp/terraform-provider-libvirt-pool-ubuntu/commoninit.iso;8eb942e9-315e-40f4-bc9a-d0c31618b101",
|
||||||
"cmdline": null,
|
"cmdline": null,
|
||||||
"console": [
|
"console": [
|
||||||
{
|
{
|
||||||
|
@ -131,7 +140,7 @@
|
||||||
"websocket": 0
|
"websocket": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"id": "cd8a2617-049f-46e7-884b-06f522ad6d8a",
|
"id": "0fecd569-c5e6-4229-b672-254a7fe32421",
|
||||||
"initrd": "",
|
"initrd": "",
|
||||||
"kernel": "",
|
"kernel": "",
|
||||||
"machine": "pc",
|
"machine": "pc",
|
||||||
|
@ -140,16 +149,18 @@
|
||||||
"name": "debian-ansible-playground-terraform",
|
"name": "debian-ansible-playground-terraform",
|
||||||
"network_interface": [
|
"network_interface": [
|
||||||
{
|
{
|
||||||
"addresses": [],
|
"addresses": [
|
||||||
|
"192.168.122.218"
|
||||||
|
],
|
||||||
"bridge": "",
|
"bridge": "",
|
||||||
"hostname": "",
|
"hostname": "",
|
||||||
"mac": "52:54:00:66:55:DF",
|
"mac": "52:54:00:76:6C:F5",
|
||||||
"macvtap": "",
|
"macvtap": "",
|
||||||
"network_id": "f50e127a-7413-4d45-80de-587b22da0aa6",
|
"network_id": "f50e127a-7413-4d45-80de-587b22da0aa6",
|
||||||
"network_name": "default",
|
"network_name": "default",
|
||||||
"passthrough": "",
|
"passthrough": "",
|
||||||
"vepa": "",
|
"vepa": "",
|
||||||
"wait_for_lease": false
|
"wait_for_lease": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"nvram": [],
|
"nvram": [],
|
||||||
|
@ -185,8 +196,8 @@
|
||||||
"arch": "x86_64",
|
"arch": "x86_64",
|
||||||
"autostart": false,
|
"autostart": false,
|
||||||
"boot_device": [],
|
"boot_device": [],
|
||||||
"cloudinit": "/tmp/terraform-provider-libvirt-pool-ubuntu/commoninit.iso;f998a504-a990-4b4a-bb52-4df8b70f3934",
|
"cloudinit": "/tmp/terraform-provider-libvirt-pool-ubuntu/commoninit.iso;8eb942e9-315e-40f4-bc9a-d0c31618b101",
|
||||||
"cmdline": [],
|
"cmdline": null,
|
||||||
"console": [
|
"console": [
|
||||||
{
|
{
|
||||||
"source_host": "127.0.0.1",
|
"source_host": "127.0.0.1",
|
||||||
|
@ -235,7 +246,7 @@
|
||||||
"websocket": 0
|
"websocket": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"id": "c932a058-d7f3-4b2c-a21f-b54a3c3e8c10",
|
"id": "611b6e01-520c-4da8-9536-e943fd56653b",
|
||||||
"initrd": "",
|
"initrd": "",
|
||||||
"kernel": "",
|
"kernel": "",
|
||||||
"machine": "pc",
|
"machine": "pc",
|
||||||
|
@ -245,17 +256,17 @@
|
||||||
"network_interface": [
|
"network_interface": [
|
||||||
{
|
{
|
||||||
"addresses": [
|
"addresses": [
|
||||||
"192.168.122.105"
|
"192.168.122.160"
|
||||||
],
|
],
|
||||||
"bridge": "",
|
"bridge": "",
|
||||||
"hostname": "",
|
"hostname": "",
|
||||||
"mac": "52:54:00:AA:5B:84",
|
"mac": "52:54:00:9A:58:4F",
|
||||||
"macvtap": "",
|
"macvtap": "",
|
||||||
"network_id": "f50e127a-7413-4d45-80de-587b22da0aa6",
|
"network_id": "f50e127a-7413-4d45-80de-587b22da0aa6",
|
||||||
"network_name": "default",
|
"network_name": "default",
|
||||||
"passthrough": "",
|
"passthrough": "",
|
||||||
"vepa": "",
|
"vepa": "",
|
||||||
"wait_for_lease": false
|
"wait_for_lease": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"nvram": [],
|
"nvram": [],
|
||||||
|
@ -288,10 +299,10 @@
|
||||||
{
|
{
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"allocation": 572428288,
|
"allocation": 3506176,
|
||||||
"available": 11409358848,
|
"available": 11978280960,
|
||||||
"capacity": 11981787136,
|
"capacity": 11981787136,
|
||||||
"id": "b8d85970-bfed-4907-9b73-c26c3578b7c6",
|
"id": "ad588a0e-dd3a-4f8d-be7b-2072dffc8668",
|
||||||
"name": "ubuntu",
|
"name": "ubuntu",
|
||||||
"path": "/tmp/terraform-provider-libvirt-pool-ubuntu",
|
"path": "/tmp/terraform-provider-libvirt-pool-ubuntu",
|
||||||
"type": "dir",
|
"type": "dir",
|
||||||
|
@ -357,6 +368,39 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "local_file",
|
||||||
|
"name": "hosts_yml",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/local\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"content": "live:\n hosts:\n ubuntu:\n ansible_host: 192.168.122.160\n ansible_user: atm\n debian:\n ansible_host: 192.168.122.218\n ansible_user: atm\n",
|
||||||
|
"content_base64": null,
|
||||||
|
"directory_permission": "0777",
|
||||||
|
"file_permission": "0777",
|
||||||
|
"filename": "./ansible/inventory/hosts.yml",
|
||||||
|
"id": "e90e3b1680ed947dc878c3dc00ace65ad63287ab",
|
||||||
|
"sensitive_content": null,
|
||||||
|
"source": null
|
||||||
|
},
|
||||||
|
"sensitive_attributes": [],
|
||||||
|
"private": "bnVsbA==",
|
||||||
|
"dependencies": [
|
||||||
|
"data.template_file.network_config",
|
||||||
|
"data.template_file.user_data",
|
||||||
|
"libvirt_cloudinit_disk.commoninit",
|
||||||
|
"libvirt_domain.domain-debian-ansible-playground",
|
||||||
|
"libvirt_domain.domain-ubuntu",
|
||||||
|
"libvirt_pool.ubuntu",
|
||||||
|
"libvirt_volume.debian-qcow2",
|
||||||
|
"libvirt_volume.ubuntu-qcow2"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"check_results": []
|
"check_results": []
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"version": 4,
|
||||||
|
"terraform_version": "1.3.2",
|
||||||
|
"serial": 194,
|
||||||
|
"lineage": "a6fc0daf-c775-a473-062d-9e8d010efa11",
|
||||||
|
"outputs": {},
|
||||||
|
"resources": [],
|
||||||
|
"check_results": []
|
||||||
|
}
|
Loading…
Reference in a new issue