summaryrefslogtreecommitdiff
path: root/roles/monitoring/graphite/carbon/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/monitoring/graphite/carbon/tasks/main.yml')
-rw-r--r--roles/monitoring/graphite/carbon/tasks/main.yml51
1 files changed, 51 insertions, 0 deletions
diff --git a/roles/monitoring/graphite/carbon/tasks/main.yml b/roles/monitoring/graphite/carbon/tasks/main.yml
new file mode 100644
index 00000000..52ee20c9
--- /dev/null
+++ b/roles/monitoring/graphite/carbon/tasks/main.yml
@@ -0,0 +1,51 @@
+---
+## TODO: create zfs volume depending on being graphite_carbon_zfs defined
+
+- name: instsall apt packages
+ apt:
+ name: graphite-carbon
+ state: present
+
+- name: configure carbon-cache receiver interfaces
+ loop: "{{ graphite_carbon_cache_receivers | dict2items }}"
+ loop_control:
+ label: "{{ item.key }} = {{ item.value.interface }}"
+ ini_file:
+ path: /etc/carbon/carbon.conf
+ section: cache
+ option: "{{ item.key | upper }}_RECEIVER_INTERFACE"
+ value: "{{ item.value.interface }}"
+ notify: restart carbon-cache
+
+- name: configure carbon-cache receiver ports
+ loop: "{{ graphite_carbon_cache_receivers | dict2items }}"
+ loop_control:
+ label: "{{ item.key }} = {{ item.value.port }}"
+ ini_file:
+ path: /etc/carbon/carbon.conf
+ section: cache
+ option: "{{ item.key | upper }}_RECEIVER_PORT"
+ value: "{{ item.value.port }}"
+ notify: restart carbon-cache
+
+- name: set carbon-cache query interface
+ ini_file:
+ path: /etc/carbon/carbon.conf
+ section: cache
+ option: CACHE_QUERY_INTERFACE
+ value: "{{ graphite_carbon_cache.interface }}"
+ notify: restart carbon-cache
+
+- name: set carbon-cache query port
+ ini_file:
+ path: /etc/carbon/carbon.conf
+ section: cache
+ option: CACHE_QUERY_PORT
+ value: "{{ graphite_carbon_cache.port }}"
+ notify: restart carbon-cache
+
+- name: configure storage schemas
+ template:
+ src: storage-schemas.conf.j2
+ dest: /etc/carbon/storage-schemas.conf
+ notify: restart carbon-cache