Documentation
¶
Index ¶
Constants ¶
const ( // Environment variable to configure the provider_loglevel attribute ProviderLogLevelEnv string = "FOREMAN_PROVIDER_LOGLEVEL" // Environment variable to configure the provider_logfile attribute ProviderLogFileEnv string = "FOREMAN_PROVIDER_LOGFILE" // Environment variable to configure the client_username attribute ClientUsernameEnv string = "FOREMAN_CLIENT_USERNAME" // Environment variable to configure the client_password attribute ClientPasswordEnv string = "FOREMAN_CLIENT_PASSWORD" )
Environment variables the provider recognizes for configuration
const ( // Default log level if one is not provided DefaultProviderLogLevel string = "NONE" // Default output log file if one is not provided DefaultProviderLogFile string = "terraform-provider-foreman.log" )
Provider configuration default values
const (
DEFAULT_RETRY_COUNT = 2
)
const ( // Specifying the log file as "-" preserves the standard behavior of the // Golang stdlib log package. LogFileStdLog string = "-" )
Log file constants
const TIMELAYOUT = "2006-01-02 15:04:05 -0700" // TZ as +-0000
TIMELAYOUT specifies the format of the datetime string used in sync_date
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶
func InitLogger(logConfig LoggingConfig)
InitLogger initialize the provider's shared logging instance. The shared logger will attempt to log to a file. If an error is encountered while trying to set up the log file , the error is captured with Golang stdlib "log" and the default log writer is used.
Types ¶
type Config ¶
type Config struct { // Server definition. The server's URL will be the 'base URL' the REST // client uses for issuing API requests to the API gateway. Server api.Server // Whether or not to verify the server's certificate/hostname. This flag // is passed to the TLS config when initializing the REST client for API // communication. // // See 'pkg/crypto/tls/#Config.InsecureSkipVerify' for more information. ClientTLSInsecure bool // Whether or not the client should try to authenticate to foreman // through the HTTP negotiate mechanism. NegotiateAuthEnabled bool // Set of credentials needed to authenticate against Foreman ClientCredentials api.ClientCredentials // Location for all API Calls LocationID int // Organization for all API Calls OrganizationID int }
Config struct defines the necessary information needed to configure the terraform provider for communication with the Foreman API.
func (*Config) Client ¶
func (c *Config) Client() (*api.Client, diag.Diagnostics)
Client creates a client reference for the Foreman REST API given the provider configuration options. After creating a client reference, the client is then authenticated with the credentials supplied to the provider configuration.
type LoggingConfig ¶
type LoggingConfig struct { // The log level to use LogLevel logger.LogLevel // The path to the log file LogFile string }
Configuration options for the provider logging
Source Files
¶
- config.go
- data_source_foreman_architecture.go
- data_source_foreman_common_parameter.go
- data_source_foreman_computeprofile.go
- data_source_foreman_computeresource.go
- data_source_foreman_defaulttemplate.go
- data_source_foreman_domain.go
- data_source_foreman_environment.go
- data_source_foreman_hostgroup.go
- data_source_foreman_httpproxy.go
- data_source_foreman_image.go
- data_source_foreman_jobtemplate.go
- data_source_foreman_katello_content_credential.go
- data_source_foreman_katello_content_views.go
- data_source_foreman_katello_lifecycle_environment.go
- data_source_foreman_katello_product.go
- data_source_foreman_katello_repositories.go
- data_source_foreman_katello_sync_plan.go
- data_source_foreman_media.go
- data_source_foreman_model.go
- data_source_foreman_operatingsystem.go
- data_source_foreman_parameter.go
- data_source_foreman_partitiontable.go
- data_source_foreman_provisioningtemplate.go
- data_source_foreman_puppetclass.go
- data_source_foreman_setting.go
- data_source_foreman_smartclassparameter.go
- data_source_foreman_smartproxy.go
- data_source_foreman_subnet.go
- data_source_foreman_templateinput.go
- data_source_foreman_templatekind.go
- data_source_foreman_user.go
- data_source_foreman_usergroup.go
- provider.go
- resource_foreman_architecture.go
- resource_foreman_common_parameter.go
- resource_foreman_computeprofile.go
- resource_foreman_computeresource.go
- resource_foreman_defaulttemplate.go
- resource_foreman_domain.go
- resource_foreman_environment.go
- resource_foreman_host.go
- resource_foreman_hostgroup.go
- resource_foreman_httpproxy.go
- resource_foreman_image.go
- resource_foreman_jobtemplate.go
- resource_foreman_katello_content_credential.go
- resource_foreman_katello_content_views.go
- resource_foreman_katello_lifecycle_environment.go
- resource_foreman_katello_product.go
- resource_foreman_katello_repositories.go
- resource_foreman_katello_sync_plan.go
- resource_foreman_media.go
- resource_foreman_model.go
- resource_foreman_operatingsystem.go
- resource_foreman_override_value.go
- resource_foreman_parameter.go
- resource_foreman_partitiontable.go
- resource_foreman_provisioningtemplate.go
- resource_foreman_smartproxy.go
- resource_foreman_subnet.go
- resource_foreman_template_input.go
- resource_foreman_user.go
- resource_foreman_usergroup.go
- resource_helper.go