Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change role_name to gocarbon #13

Merged
merged 1 commit into from
Aug 17, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
distro: ['rockylinux8', 'ubuntu2204', 'debian12']
scenario: ['carbonapi', 'go-carbon']
scenario: ['carbonapi', 'gocarbon']

steps:
- name: Checkout code
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Collection tested on RockyLinux 8, Debian 12 and Ubuntu 22.04.

## Roles

* [go-carbon](roles/go-carbon/README.md): Install and configure go-carbon
* [gocarbon](roles/gocarbon/README.md): Install and configure go-carbon
* [carbonapi](roles/carbonapi/README.md) Install and configure carbonapi


Expand All @@ -21,7 +21,7 @@ Collection tested on RockyLinux 8, Debian 12 and Ubuntu 22.04.
become: true
collections: tbauriedel.gographite
roles:
- go-carbon
- gocarbon
- carbonapi
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
- tbauriedel.gographite

roles:
- go-carbon
- gocarbon
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependency:
driver:
name: docker
platforms:
- name: go-carbon
- name: gocarbon
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
cgroupns_mode: host
Expand Down
File renamed without changes.
117 changes: 0 additions & 117 deletions roles/go-carbon/README.md

This file was deleted.

34 changes: 0 additions & 34 deletions roles/go-carbon/defaults/main.yml

This file was deleted.

5 changes: 0 additions & 5 deletions roles/go-carbon/templates/storage-aggregation.conf.j2

This file was deleted.

2 changes: 0 additions & 2 deletions roles/go-carbon/vars/Debian.yml

This file was deleted.

2 changes: 0 additions & 2 deletions roles/go-carbon/vars/RedHat.yml

This file was deleted.

117 changes: 117 additions & 0 deletions roles/gocarbon/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# tbauriedel.gocarbon

Installs and configures [go-carbon](https://github.com/go-graphite/go-carbon).

## Variables

A detailed documentation can be found inside of the [official go-carbon repo](https://github.com/go-graphite/go-carbon?tab=readme-ov-file#configuration).

Default variables are defined [here](defaults/main.yml).

`gocarbon_version`: Version (Default: `0.17.3`)
`gocarbon_storage_dir`: Storage directory (Default: `/var/lib/graphite`)
`gocarbon_group`: Service user (Default: `carbon`)
`gocarbon_user`: Service group (Default: `carbon`)

`gocarbon_max_cpu`: Max CPU (Default: `1`)
`gocarbon_whisper_workers`: Max workers (Default: `1`)
`gocarbon_cache_max_size`: Max cache size (Default: `1000000`)
`gocarbon_udp_enabled`: Enable udp listener (Default: `true`)
`gocarbon_upd_listen`: UDP listener (Default: `127.0.0.1:2003`)
`gocarbon_tcp_enabled`: Enable TCP listener (Default: `true`)
`gocarbon_tcp_listen`: TCP listener (Default: `127.0.0.1:2003`)
`gocarbon_carbonlink_enabled`: Enable carbonlink listener (Default: `true`)
`gocarbon_carbonlink_listen`: carbonlink listener (Default: `127.0.0.1:7200`)
`gocarbon_pickle_enabled`: Enable pickle listener (Default: `true`)
`gocarbon_pickle_listen`: pickle listener (Default: `127.0.0.1:2004`)
`gocarbon_carbonserver_enabled`: Enable carbonserver (Default: `true`)
`gocarbon_carbonserver_listen`: carbonserver listener: (Default: `127.0.0.1:8080`)

`gocarbon_logging_file`: Logfile (Default: `/var/log/go-carbon/go-carbon.log`)
`gocarbon_logging_severity`: Log severity (Default: `warn`)

`gocarbon_extra_conf:` Add some extra custom configuration

`gocarbon_storage_schemas`: List of storage retentions (Default: [here](defaults/main.yml))
`gocarbon_storage_schemas.name`: Name of schema
`gocarbon_storage_schemas.pattern`: Pattern that should match
`gocarbon_storage_schemas.retentions`: Retention policy
`gocarbon_storage_schemas.compressed`: Enable compression (Default: `false`)

`gocarbon_storage_aggregation`: Add storage aggregation

## Config file

If you dont add some custom configuration, the go-carbon.conf will look like this.
```
#
# Ansible managed
#

[common]
user = "carbon"
graph-prefix = "carbon.agents.{host}"
metric-endpoint = "local"
max-cpu = 1
metric-interval = "1m0s"

[whisper]
data-dir = "/var/lib/graphite/whisper/"
schemas-file = "/etc/go-carbon/storage-schemas.conf"
aggregation-file = ""
quotas-file = ""
workers = 1
max-updates-per-second = 0
sparse-create = false
physical-size-factor = 0.75
flock = false
compressed = false
enabled = true
hash-filenames = true
remove-empty-file = false
online-migration = false
online-migration-rate = 5
online-migration-global-scope = ""

[cache]
max-size = 1000000
write-strategy = "max"

[carbonserver]
listen = "127.0.0.1:8080"
enabled = true

[udp]
listen = "127.0.0.1:2003"
enabled = true
buffer-size = 0

[tcp]
listen = "127.0.0.1:2003"
enabled = true
buffer-size = 0
compression = ""

[carbonlink]
listen = "127.0.0.1:7200"
enabled = true
read-timeout = "30s"

[pickle]
listen = "127.0.0.1:2004"
max-message-size = 67108864
enabled = true
buffer-size = 0


[[logging]]
logger = ""
file = "/var/log/go-carbon/go-carbon.log"
level = "warn"
encoding = "mixed"
encoding-time = "iso8601"
encoding-duration = "seconds"
sample-tick = ""
sample-initial = 0
sample-thereafter = 0
```
34 changes: 34 additions & 0 deletions roles/gocarbon/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
gocarbon_version: 0.17.3

gocarbon_storage_dir: /var/lib/graphite
gocarbon_group: carbon
gocarbon_user: carbon

gocarbon_max_cpu: 1
gocarbon_metric_interval: 1m0s
gocarbon_whisper_workers: 1
gocarbon_cache_max_size: 1000000
gocarbon_udp_enabled: "true"
gocarbon_upd_listen: 127.0.0.1:2003
gocarbon_tcp_enabled: "true"
gocarbon_tcp_listen: 127.0.0.1:2003
gocarbon_carbonlink_enabled: "true"
gocarbon_carbonlink_listen: 127.0.0.1:7200
gocarbon_pickle_enabled: "true"
gocarbon_pickle_listen: 127.0.0.1:2004
gocarbon_carbonserver_enabled: "true"
gocarbon_carbonserver_listen: 127.0.0.1:8080

gocarbon_logging_file: /var/log/go-carbon/go-carbon.log
gocarbon_logging_severity: warn

gocarbon_extra_conf: ""

gocarbon_storage_schemas:
- name: default
pattern: .*
retentions: 60s:30d,1h:5y
compressed: "false"

gocarbon_storage_aggregation: ""
File renamed without changes.
File renamed without changes.
Loading