Open rogermartensson opened 1 year ago
You need to set location_id
and organization_id
in your provider configuration.
I see. Is it possible to enhance the error message to say that there are missing parameters in the provider configuration? Or maybe set these as mandatory in the provider?
Don't seem to be a data source for locations and organizations either. Or can I find that in some other data source?
I think some older versions of Foreman didn't need those parameters, hence they were optional.
You can use the GUI to find the values for your environment. Under the Administer->Locatons/Organizations menu. When you click on a Location or Org the ID will be visible in the URL, prepending the name.
You need to set location_id
and organization_id
since foreman version 1.21
There's an argument for making them required fields now, as versions <1.21 are ancient and haven't been supported for years.
Should we do this? It might be as easy as switching from Optional
to Required
in provider.go
:
"organization_id": {
Type: schema.TypeInt,
Required: true,
Default: 0,
Description: "The organization for all resource requsted and created by the Provier " +
"Defaults to \"0\". Set organization_id and location_id to a value < 0 if you need " +
"to disable Locations and Organizations on Foreman older than 1.21",
},
"location_id": {
Type: schema.TypeInt,
Optional: true,
Required: 0,
Description: "The location for all resources requested and created by the provider" +
"Defaults to \"0\". Set organization_id and location_id to a value < 0 if you need " +
"to disable Locations and Organizations on Foreman older than 1.21",
},
Using foreman version 3.4.1.
I'm trying to set up a very simple server using the example found in the documentation.
The error message I get is:
There doesn't seem to be a way for me to set this.