Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .forms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ default:
description: "Branch of the config Git repository."
key: config_git_branch
widget: cy_branch
source: config_git_repository
type: string
description: "The branch used by the config repository"
source: config_git_repository
default: "config"
required: true
Cycloid:
Expand All @@ -96,6 +96,20 @@ default:
type: string
default: "2.9"
terraform:
ec2-ami:
- name: "EC2 AMI name"
description: "The AMI name to use for the EC2 machine to launch. You can use a regex like debian-11-*."
key: debian_ami_name
widget: simple_text
type: string
default: "debian-11-*"
- name: "EC2 AMI owner"
description: "The name or ID of the owner of the AMI to use"
key: debian_ami_name
widget: simple_text
type: string
default: "136693071363"

application:
- name: "Extra AWS tags"
description: "Dict of extra tags to add on aws resources."
Expand Down
4 changes: 2 additions & 2 deletions ansible/environments/default_prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ nginx_sites_default:
}

07-grafana-80:
- listen 80 default_server
- listen 80
- server_name {{ grafana_domain_name }}
# - auth_basic "Restricted"
# - auth_basic_user_file auth_basic/grafana
Expand Down Expand Up @@ -630,7 +630,7 @@ nginx_sites_default_https:

10-force-https:
- listen 80 default_server
- return 301 https://$server_name$request_uri
- return 301 https://$host$request_uri

12-prometheus-443:
- listen 443 ssl default_server
Expand Down
18 changes: 18 additions & 0 deletions ansible/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
roles:
# Install docker
- role: geerlingguy.docker
docker_packages:
- "docker-{{ docker_edition }}"
- "docker-{{ docker_edition }}-cli"
- "containerd.io"
tags:
- docker

Expand All @@ -42,6 +46,20 @@

# Monitoring client part
- role: cycloid.telegraf
telegraf_agent_version: 1.10.0
telegraf_plugins_default:
- plugin: cpu
config:
- percpu = true
- plugin: disk
- plugin: diskio
- plugin: mem
- plugin: net
- plugin: system
- plugin: swap
- plugin: netstat
- plugin: processes
- plugin: kernel
tags:
- telegraf

Expand Down
4 changes: 2 additions & 2 deletions ansible/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
scm: git

- src: https://github.com/cycloidio/ansible-prometheus.git
version: master
version: fix_jinja_indent
name: cycloid.prometheus
scm: git

Expand All @@ -15,7 +15,7 @@
scm: git

- src: https://github.com/dj-wasabi/ansible-telegraf
version: master
version: 0.14.0
name: dj-wasabi.telegraf
scm: git

Expand Down
2 changes: 1 addition & 1 deletion terraform/module-prometheus/ami.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ data "aws_ami" "debian" {
values = ["ebs"]
}

owners = ["379101102735"] # Debian
owners = [var.debian_ami_owner] # Debian
}

2 changes: 1 addition & 1 deletion terraform/module-prometheus/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ output "rds_port" {
}

output "rds_database" {
value = var.create_rds_database ? aws_db_instance.grafana[0].name : ""
value = var.create_rds_database ? aws_db_instance.grafana[0].db_name : ""
}

output "rds_username" {
Expand Down
2 changes: 1 addition & 1 deletion terraform/module-prometheus/prometheus.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ resource "aws_instance" "prometheus" {

resource "aws_eip" "prometheus" {
instance = aws_instance.prometheus.id
vpc = true
domain = "vpc"
count = var.prometheus_enable_eip ? 1 : 0
}

Expand Down
2 changes: 1 addition & 1 deletion terraform/module-prometheus/rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ resource "aws_db_instance" "grafana" {
engine = var.rds_engine
engine_version = var.rds_engine_version
instance_class = var.rds_type
name = var.rds_database
db_name = var.rds_database
username = var.rds_username
password = var.rds_password

Expand Down
6 changes: 5 additions & 1 deletion terraform/module-prometheus/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ locals {
###

variable "debian_ami_name" {
default = "debian-stretch-*"
default = "debian-11-*"
}

variable "debian_ami_owner" {
default = "136693071363"
}

variable "prometheus_disk_size" {
Expand Down
8 changes: 8 additions & 0 deletions terraform/prometheus.tf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ module "prometheus" {

#####################################

#. debian_ami_name (optional):
#+ The debian name to use. You can use a regex like debian-11-*.
debian_ami_name = "debian-11-*"

#. debian_ami_owner (optional):
#+ The name or ID of the owner of the image to use.
debian_ami_owner = "136693071363"

#. vpc_id (required):
#+ Amazon VPC id on which create each components.
vpc_id = data.terraform_remote_state.infrastructure.outputs.infra_vpc_id
Expand Down