This doc was autogenerated.

Foreman Provider

The Foreman provider is used to interact with the many resources supported by Foreman through the Foreman REST API.

This project way previously developed, owned, and maintained by the SRE - Orchestration pod at Wayfair. Current development is happening at Github

What is Foreman?

Foreman

Foreman is a complete lifecycle management tool for physical and virtual servers. It provides system administrators the power to easily automate repetitive tasks, quickly deploy applications, and proactively manage servers, on-premise or in the cloud.

Configuring the Provider

provider "foreman" {
  provider_loglevel = "INFO"
  provider_logfile = "terraform-provider-foreman.log"

  client_username = "admin"
  client_password = "changeme"
  client_tls_insecure = "true"

  server_hostname = "127.0.0.1"
  server_protocol = "https"
}

Environment Variables

Some of the provider configuration options can be provided through environment variables. Environment variables are prefixed with the provider name and correspond to options in the provider schema definition:

  • FOREMAN_PROVIDER_LOGLEVEL
  • FOREMAN_PROVIDER_LOGFILE
  • FOREMAN_CLIENT_USERNAME
  • FOREMAN_CLIENT_PASSWORD

Example Usage:

$> export FOREMAN_PROVIDER_LOGLEVEL='INFO'
$> export FOREMAN_PROVIDER_LOGFILE='-'
$> export FOREMAN_CLIENT_USERNAME='admin'
$> export FOREMAN_CLIENT_PASSWORD='changeme'
$> terraform init && terraform plan

Argument Reference

The following arguments are supported:

  • client_auth_negotiate - (Optional) Whether or not the client should try to authenticate through the HTTP negotiate mechanism. Defaults to false.
  • client_password - (Optional) The username to authenticate against Foreman. This can also be set through the environment variable FOREMAN_CLIENT_PASSWORD. Defaults to "".
  • client_tls_insecure - (Optional) Whether or not to verify the server's certificate. Defaults to false.
  • client_username - (Optional) The username to authenticate against Foreman. This can also be set through the environment variable FOREMAN_CLIENT_USERNAME. Defaults to "".
  • location_id - (Optional) The location for all resources requested and created by the providerDefaults 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
  • organization_id - (Optional) 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
  • provider_logfile - (Optional) Where to deirect provider-specific log output. A value of '-' preserves the default behavior of the log package from Golang stdlib and will be combined with the main terraform.log file produced by terraform. If the desired output file does not exist, it will be created. If the file already exists, logs will be appended to the file. This can also be set through the enviornment variable FOREMAN_PROVIDER_LOGFILE. Defaults to 'terraform-provider-foreman.log'.
  • provider_loglevel - (Optional) The level of verbosity for the provider's log file. This setting determines which types of log messages are written and which are ignored. Possible values (from most verbose to least verbose) include 'DEBUG', 'TRACE', 'INFO', 'WARNING', 'ERROR', and 'NONE'. The provider's logs will be written to the location specified by provider_logfile. This can also be set through the environment variable FOREMAN_PROVIDER_LOGLEVEL. Defaults to 'INFO'.
  • server_hostname - (Required) The hostname / IP address of the Foreman REST API server
  • server_protocol - (Optional) The protocol the Foreman REST API server is using for communication. Defaults to "https".