86 lines
3.0 KiB
HCL
86 lines
3.0 KiB
HCL
resource "juju_application" "filebeat" {
|
|
name = "filebeat"
|
|
|
|
model = var.model-name
|
|
|
|
charm {
|
|
name = "filebeat"
|
|
channel = "latest/stable"
|
|
}
|
|
|
|
units = 0
|
|
|
|
endpoint_bindings = [{
|
|
space = var.oam-space
|
|
}]
|
|
|
|
config = {
|
|
logpath = "/var/log/*.log /var/log/*/*.log /var/log/syslog"
|
|
install_sources = <<-EOF
|
|
- 'deb http://192.168.1.12/artifacts.elastic.co/packages/6.x/apt stable main'
|
|
EOF
|
|
install_keys = <<-EOF
|
|
- |
|
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
|
Version: SKS 1.1.6
|
|
Comment: Hostname: keyserver.ubuntu.com
|
|
mQENBFI3HsoBCADXDtbNJnxbPqB1vDNtCsqhe49vFYsZN9IOZsZXgp7aHjh6CJBDA+bGFOwy
|
|
hbd7at35jQjWAw1O3cfYsKAmFy+Ar3LHCMkV3oZspJACTIgCrwnkic/9CUliQe324qvObU2Q
|
|
RtP4Fl0zWcfb/S8UYzWXWIFuJqMvE9MaRY1bwUBvzoqavLGZj3SF1SPO+TB5QrHkrQHBsmX+
|
|
Jda6d4Ylt8/t6CvMwgQNlrlzIO9WT+YN6zS+sqHd1YK/aY5qhoLNhp9G/HxhcSVCkLq8SStj
|
|
1ZZ1S9juBPoXV1ZWNbxFNGwOh/NYGldD2kmBf3YgCqeLzHahsAEpvAm8TBa7Q9W21C8vABEB
|
|
AAG0RUVsYXN0aWNzZWFyY2ggKEVsYXN0aWNzZWFyY2ggU2lnbmluZyBLZXkpIDxkZXZfb3Bz
|
|
QGVsYXN0aWNzZWFyY2gub3JnPokBOAQTAQIAIgUCUjceygIbAwYLCQgHAwIGFQgCCQoLBBYC
|
|
AwECHgECF4AACgkQ0n1mbNiOQrRzjAgAlTUQ1mgo3nK6BGXbj4XAJvuZDG0HILiUt+pPnz75
|
|
nsf0NWhqR4yGFlmpuctgCmTD+HzYtV9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BERQ/qPDlGRlOgVTd9xUfHFkzB52c70E=
|
|
=92oX
|
|
-----END PGP PUBLIC KEY BLOCK-----
|
|
EOF
|
|
}
|
|
}
|
|
|
|
resource "juju_integration" "filebeat-integration" {
|
|
for_each = toset(var.all_services)
|
|
|
|
model = var.model-name
|
|
|
|
application {
|
|
name = juju_application.filebeat.name
|
|
endpoint = "beats-host"
|
|
}
|
|
|
|
application {
|
|
name = "${each.value}"
|
|
endpoint = "juju-info"
|
|
}
|
|
}
|
|
|
|
|
|
resource "juju_integration" "filebeat-graylog" {
|
|
|
|
model = var.model-name
|
|
|
|
application {
|
|
name = juju_application.filebeat.name
|
|
endpoint = "logstash"
|
|
}
|
|
|
|
application {
|
|
offer_url = juju_offer.graylog.url
|
|
}
|
|
}
|