foreman

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2018 License: MPL-2.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

View Source
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

View Source
const (
	// Default log level if one is not provided
	DefaultProviderLogLevel string = "INFO"
	// Default output log file if one is not provided
	DefaultProviderLogFile string = "terraform-provider-foreman.log"
)

Provider configuration default values

View Source
const (
	// Specifying the log file as "-" preserves the standard behavior of the
	// Golang stdlib log package.
	LogFileStdLog string = "-"
)

Log file constants

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.

func Provider

func Provider() terraform.ResourceProvider

Provider : Defines params for provider in terraform and available resources

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
	// Set of credentials needed to authenticate against Foreman
	ClientCredentials api.ClientCredentials
}

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, error)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL