Closed thatsk closed 1 year ago
@lhw any lights on this
Something like this should work:
data "foreman_image" "example" {
name = "some image name"
}
resource "foreman_host" "example" {
name = "compute01.dc1.company.com"
image_id = data.foreman_image.example.id
}
this is error @lhw
"error": {"id":null,"errors":{"ptable_id":["can't be blank unless a custom partition has been defined"],"medium_id":["can't be blank"]},"full_messages":["Ptable can't be blank unless a custom partition has been defined","Medium can't be blank"]}
}
]
}
This was working upto 0.4.5 and now latest seems like some new stuff has been added.
resource "foreman_host" "newtest" {
name = "test02p1"
compute_profile_id = "${data.foreman_computeprofile.medium.id}"
build = true
compute_resource_id = "${data.foreman_computeresource.int-msp.id}"
domain_id = 2
hostgroup_id = "${data.foreman_hostgroup.terraform.id}"
image_id = "${data.foreman_image.example.id}"
model_id = 0
operatingsystem_id = "${data.foreman_operatingsystem.Centos79.id}"
owner_id = 3
retry_count = 2
parameters = {
"puppet_environment" = "integration",
}
}
resource "null_resource" "newtest" {
triggers = {
templateid = "${foreman_host.newtest.id}"
}
connection {
type = "ssh"
host = "${foreman_host.newtest.interfaces_attributes[0].ip}"
user = "root"
password = "${var.password}"
port = "22"
agent = false
}
provisioner "file" {
source = "scripts/"
destination = "/tmp"
}
}
when I am checking the code it has been refactored for provision_method and build params.
which param is defining i need to use this image for cloning and which param say it goes in network boot
on 0.5.0 says methods are deprecated now and need to use method and build and if we get some lights on this. https://github.com/terraform-coop/terraform-provider-foreman/releases/tag/v0.5.0
@lhw i am trying to understand and findiing solution but this is not working even I use build true or false
it says use build arg how to use that in terraform code
Hello Team, I am trying to use image as provisioned but by default it is going to install via network boot. Is there any param we need to set to use for cloning VM template.