2016-12-12 16:28:26 +01:00
|
|
|
---
|
|
|
|
layout: "icinga2"
|
|
|
|
page_title: "Icinga2: host"
|
|
|
|
sidebar_current: "docs-icinga2-resource-host"
|
|
|
|
description: |-
|
|
|
|
Configures a host resource. This allows hosts to be configured, updated and deleted.
|
|
|
|
---
|
|
|
|
|
|
|
|
# icinga2\_host
|
|
|
|
|
|
|
|
Configures an Icinga2 host resource. This allows hosts to be configured, updated,
|
2017-02-18 23:48:50 +01:00
|
|
|
and deleted.
|
2016-12-12 16:28:26 +01:00
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
2017-04-17 12:17:54 +02:00
|
|
|
```hcl
|
2016-12-12 16:28:26 +01:00
|
|
|
# Configure a new host to be monitored by an Icinga2 Server
|
|
|
|
provider "icinga2" {
|
2017-02-18 23:48:50 +01:00
|
|
|
api_url = "https://192.168.33.5:5665/v1"
|
2016-12-12 16:28:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "icinga2_host" "host" {
|
|
|
|
hostname = "terraform-host-1"
|
|
|
|
address = "10.10.10.1"
|
|
|
|
check_command = "hostalive"
|
2017-02-18 23:48:50 +01:00
|
|
|
templates = ["bp-host-web"]
|
|
|
|
|
2016-12-12 16:28:26 +01:00
|
|
|
vars {
|
2017-02-18 23:48:50 +01:00
|
|
|
os = "linux"
|
|
|
|
osver = "1"
|
|
|
|
allowance = "none"
|
2016-12-12 16:28:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `address` - (Required) The address of the host.
|
2017-02-18 23:48:50 +01:00
|
|
|
* `check_command` - (Required) The name of an existing Icinga2 CheckCommand object that is used to determine if the host is available or not.
|
2016-12-12 16:28:26 +01:00
|
|
|
* `hostname` - (Required) The hostname of the host.
|
|
|
|
* `templates` - (Optional) A list of Icinga2 templates to assign to the host.
|
|
|
|
* `vars` - (Optional) A mapping of variables to assign to the host.
|
|
|
|
|