-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resource foreman_host not able to create host because of organization_id / location_id #179
Comments
I believe that's because by adding quotes, you try to set both organization_id and location_id as strings.
|
i tried that already, i tried every variant which came to my mind, here the logs with debug with using no quotes: provider "foreman" {
organization_id = 1
location_id = 10
provider_loglevel = "DEBUG"
provider_logfile = "terraform-provider-foreman.log"
client_username = var.foreman_user
client_password = var.foreman_password
client_tls_insecure = "true"
server_hostname = local.foreman_host
server_protocol = "https"
}
foreman says:
|
Thanks for investigating further! These look like two different usages to me: in the first one, where That this works is just a coincidence because the host struct accepts these keys. The error is in the first scenario. We had this already in other cases, where the fields need to be omitted. It's the difference between WrapJSON and WrapJSONWithTaxonomy. |
you have understood whats mainly the case but you overlooked the issue first its the opposite, the first one (org and loc outside host) is for guessing user context (what the terraform provider tries to do) but it never was correctly implemented by foreman so they do not use this the second -> host{organization,location} is for setting the actual loc and organization id, as the foreman webui does it, thats why the foreman web ui can provision a host successfully and this provider can't the foreman terraform provider uses host:{} location: organization:, thats wrong because host{location, organization} is not set, so it fails the foreman webui does set host{location,organization} so it can successfully create a host, the webui NEVER sets loc and organization OUTSIDE host, there is no case where the webui does this to note, the foreman ui does not set location, organization outside of the host{} even when loc and organization are defaulting to what is configured for the user. |
fails for me with
foreman version: 3.10.0
source = "terraform-coop/foreman"
version = "0.6.3"
The text was updated successfully, but these errors were encountered: