mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Adding volume for metrics server.
This commit is contained in:
parent
1b2fc53f37
commit
f437f810e4
3 changed files with 22 additions and 7 deletions
|
@ -117,7 +117,7 @@ resource "digitalocean_droplet" "app-push" {
|
|||
}
|
||||
|
||||
resource "digitalocean_droplet" "app-refresh" {
|
||||
count = 2
|
||||
count = 4
|
||||
image = var.droplet_os
|
||||
name = "app-refresh${count.index+1}"
|
||||
region = var.droplet_region
|
||||
|
@ -446,11 +446,22 @@ resource "digitalocean_droplet" "db-mongo-secondary" {
|
|||
# }
|
||||
# }
|
||||
|
||||
resource "digitalocean_volume" "metrics_volume" {
|
||||
count = 0
|
||||
region = "nyc1"
|
||||
name = "metrics"
|
||||
size = 100
|
||||
initial_filesystem_type = "xfs"
|
||||
description = "Storage for NewsBlur Prometheus metrics"
|
||||
}
|
||||
|
||||
resource "digitalocean_droplet" "db-metrics" {
|
||||
image = var.droplet_os
|
||||
name = "db-metrics"
|
||||
region = var.droplet_region
|
||||
size = var.droplet_size
|
||||
size = var.metrics_droplet_size
|
||||
# volume_ids = [digitalocean_volume.metrics_volume.0.id]
|
||||
volume_ids = ["f815908f-e1b7-11eb-a10f-0a58ac145428"] # 100GB volume created outside TF. Remove when upgrading to 200GB
|
||||
ssh_keys = [digitalocean_ssh_key.default.fingerprint]
|
||||
provisioner "local-exec" {
|
||||
command = "/srv/newsblur/ansible/utils/generate_inventory.py; sleep 120"
|
||||
|
|
|
@ -29,6 +29,11 @@ variable "mongo_droplet_size" {
|
|||
default = "m-4vcpu-32gb"
|
||||
}
|
||||
|
||||
variable "metrics_droplet_size" {
|
||||
type = string
|
||||
default = "s-1vcpu-2gb"
|
||||
}
|
||||
|
||||
variable "mongo_secondary_droplet_size" {
|
||||
type = string
|
||||
default = "m-2vcpu-16gb"
|
||||
|
|
|
@ -28,6 +28,8 @@ def main(roles=None, command=None, path=None):
|
|||
|
||||
if not roles:
|
||||
roles = ['app']
|
||||
if not isinstance(roles, list):
|
||||
roles = [roles]
|
||||
|
||||
while True:
|
||||
try:
|
||||
|
@ -50,7 +52,7 @@ def main(roles=None, command=None, path=None):
|
|||
def create_streams_for_roles(hosts, roles, command=None, path=None):
|
||||
streams = list()
|
||||
found = set()
|
||||
|
||||
print(path)
|
||||
if not path:
|
||||
path = "/srv/newsblur/logs/newsblur.log"
|
||||
if not command:
|
||||
|
@ -62,10 +64,7 @@ def create_streams_for_roles(hosts, roles, command=None, path=None):
|
|||
follow_host(hosts, streams, found, hostname, command, path)
|
||||
else:
|
||||
host = role
|
||||
role = re.search(r'([^0-9]+)', host).group()
|
||||
for hostname in hosts[role]:
|
||||
if hostname['name'] == host:
|
||||
follow_host(hosts, streams, found, hostname, command, path)
|
||||
follow_host(hosts, streams, found, host, command)
|
||||
|
||||
return streams
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue