Terraform provider to setup Centreon Web application.
Requirements
- General developper tools like make, bash, ...
- Go (to build the provider)
- Terraform (to use the provider)
Building the provider
Clone repository to: $GOPATH/src/github.com/smutel/terraform-provider-centreon
$ mkdir -p $GOPATH/src/github.com/smutel
$ cd $GOPATH/src/github.com/smutel
$ git clone git@github.com:smutel/terraform-provider-centreon.git
Enter the provider directory and build the provider
$ cd $GOPATH/src/github.com/smutel/terraform-provider-centreon
$ make build
Installing the provider
You can install the provider manually in your global terraform provider folder
or you can also use the makefile to install the provider in your local provider folder:
$ make localinstall
==> Creating folder terraform.d/plugins/linux_amd64
mkdir -p ~/.terraform.d/plugins/linux_amd64
==> Installing provider in this folder
cp terraform-provider-centreon ~/.terraform.d/plugins/linux_amd64
Using the provider
The definition of the provider is optional.
All the paramters could be setup by environment variables.
provider centreon {
# Environment variable CENTREON_URL
url = "http://127.0.0.1"
# Environment variable CENTREON_ALLOW_UNVERIFIED_SSL
allow_unverified_ssl = false
# Environment variable CENTREON_USER
user = "admin"
# Environment variable CENTREON_PASSWORD
password = "centreon"
}
For further information, check this documentation
Contributing to this project
To contribute to this project I suggest to use the centreon style guides.
This project is still in progress and is linked to this other project go-centreon.
Examples
You can find some examples in the examples folder.
Each example can be executed directly with command terraform init & terraform apply.
You can set different environment variables for your test:
- CENTREON_URL to define the URL (and optionally the port) | DEFAULT=http://127.0.0.1
- CENTREON_ALLOW_UNVERIFIED_SSL to avoid checking the SSL certs (true or false) | DEFAULT=false
- CENTREON_USER to define the user | DEFAULT=admin
- CENTREON_PASSWORD to define the password | DEFAULT=centreon
$ export CENTREON_URL="http://10.164.48.254:8080"
$ export CENTREON_ALLOW_UNVERIFIED_SSL="true"
$ export CENTREON_USER="admin"
$ export CENTREON_PASSWORD="centreon"
$ cd examples/commands
$ terraform init & terraform apply
Known bugs which can impact this provider